Skip to content

Commit

Permalink
Merge pull request #15 from daktak/development
Browse files Browse the repository at this point in the history
0.5.8
  • Loading branch information
daktak committed Mar 8, 2016
2 parents afa460c + 7475e5d commit 47a0c46
Show file tree
Hide file tree
Showing 28 changed files with 351 additions and 337 deletions.
Binary file modified .gradle/2.8/taskArtifacts/cache.properties.lock
Binary file not shown.
Binary file modified .gradle/2.8/taskArtifacts/fileHashes.bin
Binary file not shown.
Binary file modified .gradle/2.8/taskArtifacts/fileSnapshots.bin
Binary file not shown.
Binary file modified .gradle/2.8/taskArtifacts/outputFileStates.bin
Binary file not shown.
Binary file modified .gradle/2.8/taskArtifacts/taskArtifacts.bin
Binary file not shown.
491 changes: 256 additions & 235 deletions .idea/workspace.xml

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions app/app.iml
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,10 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/23.2.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-vector-drawable/23.2.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/lint" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/transforms" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
Expand Down
15 changes: 7 additions & 8 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ android {
buildToolsVersion "23.0.2"
defaultConfig {
applicationId 'org.androidpn.client'
minSdkVersion 19
minSdkVersion 17
targetSdkVersion 23
versionCode 20160303
versionName "0.5.6"
versionCode 20160308
versionName "0.5.7"
}
buildTypes {
release {
Expand All @@ -32,25 +32,24 @@ dependencies {
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support:design:23.2.0'
//compile files('src/main/lib/asmack.jar')
compile "jivesoftware:smack:3.2.1"
compile "org.igniterealtime.smack:smack:3.2.1"

//TODO
//compile "org.igniterealtime.smack:smack-java7:4.1.0"
//compile "org.igniterealtime.smack:smack-android:4.1.0"
// Optional for XMPPTCPConnection
//compile "org.igniterealtime.smack:smack-tcp:4.1.0"
// Optional for XMPP-IM (RFC 6121) support (Roster, Threaded Chats, …)
//compile "org.igniterealtime.smack:smack-im:4.1.0"
// Optional for XMPP extensions support
//compile "org.igniterealtime.smack:smack-extensions:4.1.0"
//compile "org.igniterealtime.smack:smack-android-extensions:4.1.0"
//compile "org.igniterealtime.smack:smack-tcp:4.1.0"
//compile "org.igniterealtime.smack:smack-experimental:4.1.0"

}

android {
lintOptions {
disable 'InnerclassSeparator','GoogleAppIndexingWarning','InvalidPackage'
disable 'InnerclassSeparator','GoogleAppIndexingWarning','InvalidPackage','IconDensities'
checkReleaseBuilds false
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.androidpn.client"
android:versionCode="20160303"
android:versionName="0.5.6" >
android:versionCode="20160308"
android:versionName="0.5.7" >

<uses-sdk
android:minSdkVersion="19"
android:minSdkVersion="17"
android:targetSdkVersion="23" />

<uses-permission android:name="android.permission.READ_PHONE_STATE" />
Expand Down
2 changes: 1 addition & 1 deletion app/build/outputs/logs/manifest-merger-debug-report.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ ADDED from /home/daktak/StudioProjects/androidpn-client/app/src/main/AndroidMani
android:name
ADDED from /home/daktak/StudioProjects/androidpn-client/app/src/main/AndroidManifest.xml:11:26-82
application
ADDED from /home/daktak/StudioProjects/androidpn-client/app/src/main/AndroidManifest.xml:13:5-45:23
ADDED from /home/daktak/StudioProjects/androidpn-client/app/src/main/AndroidManifest.xml:13:5-45:19
MERGED from [com.android.support:appcompat-v7:23.2.0] /home/daktak/StudioProjects/androidpn-client/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.2.0/AndroidManifest.xml:25:5-20
MERGED from [com.android.support:support-v4:23.2.0] /home/daktak/StudioProjects/androidpn-client/app/build/intermediates/exploded-aar/com.android.support/support-v4/23.2.0/AndroidManifest.xml:22:5-20
MERGED from [com.android.support:animated-vector-drawable:23.2.0] /home/daktak/StudioProjects/androidpn-client/app/build/intermediates/exploded-aar/com.android.support/animated-vector-drawable/23.2.0/AndroidManifest.xml:7:5-20
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
</application>
</application>
</manifest>

48 changes: 24 additions & 24 deletions app/src/main/java/org/androidpn/client/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import android.widget.ListView;
import android.widget.SimpleCursorAdapter;


import java.util.List;

public class MainActivity extends AppCompatActivity
Expand All @@ -35,7 +36,7 @@ public class MainActivity extends AppCompatActivity

private static final String LOGTAG = LogUtil
.makeLogTag(MainActivity.class);
String[] perms = { Manifest.permission.READ_PHONE_STATE };
String[] perms = {Manifest.permission.READ_PHONE_STATE};

@Override
protected void onCreate(Bundle savedInstanceState) {
Expand All @@ -56,7 +57,7 @@ protected void onCreate(Bundle savedInstanceState) {
}
}

public void set(){
public void set() {
resetList();

SharedPreferences mySharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
Expand All @@ -72,7 +73,7 @@ public void set(){
}
}

public void resetList(){
public void resetList() {
datasource = new PNNotificationDataSource(this);
datasource.open();
ListView notifyList = (ListView) findViewById(R.id.listView);
Expand All @@ -84,31 +85,31 @@ public void resetList(){
if (datasource.getAllNotifications().isEmpty()) {
Log.d(LOGTAG, "No Notifications");
} else {
if (prefDtTm){
if (prefDtTm) {
prefDtTmFrmt = mySharedPreferences.getString("prefDttmFormat", "%d/%m/%Y %H:%M");
}
// The desired columns to be bound
Cursor cursor = datasource.fetchAllNotifications(prefDtTmFrmt);

String[] columns = new String[] {
String[] columns = new String[]{
MySQLiteHelper.COLUMN_TITLE,
MySQLiteHelper.COLUMN_MESSAGE
};

// the XML defined views which the data will be bound to
int[] to = new int[] {
int[] to = new int[]{
R.id.tvTitle,
R.id.tvMessage
};
if (prefDtTm){
columns = new String[] {
if (prefDtTm) {
columns = new String[]{
MySQLiteHelper.COLUMN_TITLE,
MySQLiteHelper.COLUMN_MESSAGE,
MySQLiteHelper.COLUMN_DTTM
};

// the XML defined views which the data will be bound to
to = new int[] {
to = new int[]{
R.id.tvTitle,
R.id.tvMessage,
R.id.tvDate
Expand Down Expand Up @@ -197,11 +198,11 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
*/
boolean reset = fixTheme.fixTheme(this);
if (reset) {
Log.d(LOGTAG,"Theme change");
Log.d(LOGTAG, "Theme change");
finish();
startActivity(getIntent());
}
// loadPref();
// loadPref();
if (EasyPermissions.hasPermissions(this, perms)) {
if (serviceManager != null) {

Expand All @@ -219,27 +220,26 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
}
}

@Override
protected void onResume() {
boolean reset = fixTheme.fixTheme(this);
super.onResume();
instance = this;
if (EasyPermissions.hasPermissions(this, perms)) {
resetList();
} else {
// Ask for both permissions
EasyPermissions.requestPermissions(this, getString(R.string.rationale_phone_state),
RC_PHONE_STATE, perms);
@Override
protected void onResume() {
super.onResume();
boolean reset = fixTheme.fixTheme(this);
instance = this;
if (EasyPermissions.hasPermissions(this, perms)) {
resetList();
} else {
// Ask for both permissions
EasyPermissions.requestPermissions(this, getString(R.string.rationale_phone_state),
RC_PHONE_STATE, perms);
}
}
}

@Override
protected void onPause() {
super.onPause();
instance = null;
}


@Override
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ private ConnectTask() {

public void run() {
Log.i(LOGTAG, "ConnectTask.run()...");

boolean connected = false;
if (!xmppManager.isConnected()) {
// Create the configuration for this new connection
ConnectionConfiguration connConfig = new ConnectionConfiguration(
Expand All @@ -315,12 +315,15 @@ public void run() {
ProviderManager.getInstance().addIQProvider("notification",
"androidpn:iq:notification",
new NotificationIQProvider());
connected = true;

} catch (XMPPException e) {
Log.e(LOGTAG, "XMPP connection failed", e);
}

xmppManager.runTask();
if (connected) {
xmppManager.runTask();
}

} else {
Log.i(LOGTAG, "XMPP connected already");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ public void onAnimationEnd(Animator animation) {
mDownView.setTranslationX(deltaX - mSwipingSlop);
mDownView.setAlpha(Math.max(0f, Math.min(1f,
1f - 2f * Math.abs(deltaX) / mViewWidth)));
view.performClick();
return true;
}
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ public void onAnimationEnd(Animator animation) {
// TODO: use an ease-out interpolator or such
mView.setAlpha(Math.max(0f, Math.min(1f,
1f - 2f * Math.abs(deltaX) / mViewWidth)));
view.performClick();
return true;
}
break;
Expand Down
File renamed without changes
5 changes: 2 additions & 3 deletions app/src/main/res/layout/row.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
android:textIsSelectable="false" />

<TextView
android:text="Heading"
android:text=""
android:id="@+id/tvTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Expand All @@ -28,7 +28,7 @@
android:textAlignment="viewStart"
android:textAppearance="?android:attr/textAppearanceSearchResultTitle" />
<TextView
android:text="Content and more"
android:text=""
android:id="@+id/tvMessage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Expand All @@ -38,5 +38,4 @@
android:textAlignment="viewEnd"
android:layout_weight="0"
android:textAppearance="?android:attr/textAppearance" />

</LinearLayout>
Binary file removed app/src/main/res/mipmap-hdpi/ic_launcher.png
Binary file not shown.
Binary file removed app/src/main/res/mipmap-mdpi/ic_launcher.png
Binary file not shown.
Binary file removed app/src/main/res/mipmap-xhdpi/ic_launcher.png
Binary file not shown.
Binary file removed app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Binary file not shown.
Binary file removed app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Binary file not shown.
1 change: 0 additions & 1 deletion app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<color name="blue">#3F51B5</color>
<color name="blue_dark">#303F9F</color>
<color name="blue_darkest">#FF042570</color>
<color name="pink">#FF4081</color>
<color name="black">#000000</color>
<color name="green">#ff8ab000</color>
</resources>
1 change: 0 additions & 1 deletion app/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
<dimen name="fab_margin">16dp</dimen>
</resources>
1 change: 0 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
<string name="pref_xmppport">Port</string>
<string name="toast">Toast</string>
<string name="pref_toast">Popup Notification</string>
<string name="pref_settings">Settings</string>
<string name="pref_auto">Run the service on boot</string>
<string name="auto">Auto Start</string>
<string name="dttm">Show Date and Time</string>
Expand Down
51 changes: 24 additions & 27 deletions app/src/main/res/xml/settings.xml
Original file line number Diff line number Diff line change
@@ -1,33 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>

<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">

<PreferenceCategory android:title="@string/pref_settings" >
<ListPreference android:title="@string/theme"
android:key="theme"
android:defaultValue="dark"
android:entries="@array/themeNames"
android:entryValues="@array/themeValues" />
<CheckBoxPreference
android:defaultValue="true"
android:key="prefAutostart"
android:summary="@string/pref_auto"
android:title="@string/auto" >
</CheckBoxPreference>
<CheckBoxPreference
android:defaultValue="false"
android:key="prefDtTm"
android:summary="@string/pref_dttm"
android:title="@string/dttm" >
</CheckBoxPreference>
<EditTextPreference
android:title="@string/dttmfrmt"
android:summary="@string/pref_dttmfrmt"
android:defaultValue="%d/%m/%Y %H:%M"
android:dependency="prefDtTm"
android:key="prefDttmFormat"/>

</PreferenceCategory>
<PreferenceCategory android:title="@string/pref_host" >
<EditTextPreference
android:title="@string/apikey"
Expand All @@ -45,6 +18,30 @@
android:defaultValue="5222"
android:inputType="number"
android:key="prefXmppport"/>
<CheckBoxPreference
android:defaultValue="true"
android:key="prefAutostart"
android:summary="@string/pref_auto"
android:title="@string/auto" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/display" >
<ListPreference android:title="@string/theme"
android:key="theme"
android:defaultValue="dark"
android:entries="@array/themeNames"
android:entryValues="@array/themeValues" />
<CheckBoxPreference
android:defaultValue="false"
android:key="prefDtTm"
android:summary="@string/pref_dttm"
android:title="@string/dttm" >
</CheckBoxPreference>
<EditTextPreference
android:title="@string/dttmfrmt"
android:summary="@string/pref_dttmfrmt"
android:defaultValue="%d/%m/%Y %H:%M"
android:dependency="prefDtTm"
android:key="prefDttmFormat"/>
</PreferenceCategory>
<PreferenceCategory android:title="@string/pref_notify_settings" >
<CheckBoxPreference
Expand Down
Loading

0 comments on commit 47a0c46

Please # to comment.