Skip to content

Commit

Permalink
fix another NPE that was introduced by a previous fix :-|
Browse files Browse the repository at this point in the history
use proguard to overcome an issue with the support library, see https://code.google.com/p/android/issues/detail?id=78377

Release 1.1.2
  • Loading branch information
dmfs committed Feb 17, 2015
1 parent 777b020 commit ffade5f
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 33 deletions.
4 changes: 2 additions & 2 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.dmfs.tasks"
android:versionCode="76"
android:versionName="1.1.1" >
android:versionCode="77"
android:versionName="1.1.2" >

<uses-sdk
android:minSdkVersion="8"
Expand Down
20 changes: 0 additions & 20 deletions proguard-project.txt

This file was deleted.

83 changes: 83 additions & 0 deletions proguard.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*,!code/allocation/variable
-dontwarn android.support.**

-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class com.android.vending.licensing.ILicensingService

-keepclasseswithmembernames class * {
native <methods>;
}

-keepclasseswithmembernames class * {
public <init>(android.content.Context, android.util.AttributeSet);
}

-keepclasseswithmembernames class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
}

-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}

-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}

# Keep our own classes to keep stack traces readable.
-keep class org.dmfs.** {*;}

# Allow obfuscation of android.support.v7.internal.view.menu.**
# to avoid problem on Samsung 4.2.2 devices with appcompat v21
# see https://code.google.com/p/android/issues/detail?id=78377
-keep class !android.support.v7.internal.view.menu.**,android.support.** {*;}

# this is required to keep the Annotations for retention-magic and to keep the line numbers n stack traces
-keepattributes *Annotation*,SourceFile,LineNumberTable

# keep relevant members in Activities
-keepclassmembers class * extends android.app.Activity
{
# optional, keep TAG fields if you use them for automatic namespacing
# you don't need this line if don't use the "permanent" feature or
# if you set the namespace like so:
# @Retain(permanent = true, classNS = TAG)
# or
# @Retain(permanent = true, classNS = "someNameSpace")
java.lang.String TAG;

# optional, keep names of retained fields
# you don't need this line if don't use the "permanent" feature or
# if you set the key manually like in @Retain(key = "someKey");
@org.dmfs.android.retentionmagic.annotations.* <fields>;

private long mId;
}

# same for Fragments
-keepclassmembers class * extends android.app.Fragment
{
java.lang.String TAG;
@org.dmfs.android.retentionmagic.annotations.* <fields>;
private long mId;
}

# same for support library Fragments
-keepclassmembers class * extends android.support.v4.app.Fragment
{
java.lang.String TAG;
@org.dmfs.android.retentionmagic.annotations.* <fields>;
private long mId;
}
1 change: 1 addition & 0 deletions project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ android.library=false
android.library.reference.1=../task-provider
android.library.reference.2=../PagerSlidingTabStrip/library
android.library.reference.3=../appcompat_v7_3
proguard.config=proguard.cfg
Binary file added releases/tasks-1.1.2.apk
Binary file not shown.
21 changes: 10 additions & 11 deletions src/org/dmfs/tasks/ViewTaskFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -411,17 +411,6 @@ private void updateView()
mDetailView.setModel(mModel);
mDetailView.setValues(mContentSet);
mContent.addView(mDetailView);

if (TaskFieldAdapters.IS_CLOSED.get(mContentSet))
{
((ImageView) mActionButton.findViewById(android.R.id.icon)).setImageResource(R.drawable.content_edit);
mActionButtonAction = ACTION_EDIT;
}
else
{
mActionButtonAction = ACTION_COMPLETE;
}

}

mActionButton = mDetailView.findViewById(R.id.action_button);
Expand Down Expand Up @@ -450,6 +439,16 @@ public void onClick(View v)
});
}

if (mContentSet != null && TaskFieldAdapters.IS_CLOSED.get(mContentSet))
{
((ImageView) mActionButton.findViewById(android.R.id.icon)).setImageResource(R.drawable.content_edit);
mActionButtonAction = ACTION_EDIT;
}
else
{
mActionButtonAction = ACTION_COMPLETE;
}

if (mColorBar != null)
{
updateColor((float) mRootView.getScrollY() / mColorBar.getMeasuredHeight());
Expand Down

0 comments on commit ffade5f

Please sign in to comment.