fixed crashes when activity tab enabled

updated version code
This commit is contained in:
Mariotaku Lee 2015-04-27 00:39:49 +08:00
parent 1639240c1e
commit 1a0d3eeb83
4 changed files with 36 additions and 14 deletions

View File

@ -1,6 +1,7 @@
import java.text.SimpleDateFormat
apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
apply from: rootProject.file('global.gradle')
apply from: rootProject.file('signing.gradle')
@ -10,7 +11,7 @@ android {
applicationId "org.mariotaku.twidere"
minSdkVersion 14
targetSdkVersion 22
versionCode 108
versionCode 110
versionName "0.3.0"
multiDexEnabled true
}
@ -65,11 +66,12 @@ configurations.all {
dependencies {
// wearApp project(':twidere.wear')
apt 'com.bluelinelabs:logansquare-compiler:1.0.6'
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:support-v13:22.1.0'
compile 'com.android.support:appcompat-v7:22.1.0'
compile 'com.android.support:cardview-v7:22.1.0'
compile 'com.android.support:recyclerview-v7:22.1.0'
compile 'com.android.support:support-v13:22.1.1'
compile 'com.android.support:appcompat-v7:22.1.1'
compile 'com.android.support:cardview-v7:22.1.1'
compile 'com.android.support:recyclerview-v7:22.1.1'
compile 'com.sothree.slidinguppanel:library:3.0.0'
compile 'com.twitter:twitter-text:1.11.1'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.3'
@ -89,6 +91,7 @@ dependencies {
compile 'com.sprylab.android.texturevideoview:texturevideoview:1.0.0'
compile 'com.squareup:pollexor:2.0.2'
compile 'org.apache.commons:commons-lang3:3.4'
compile 'com.bluelinelabs:logansquare:1.0.6'
googleCompile 'com.google.android.gms:play-services-maps:7.0.0'
googleCompile 'com.google.maps.android:android-maps-utils:0.3.4'
fdroidCompile 'org.osmdroid:osmdroid-android:4.3'

View File

@ -1344,16 +1344,19 @@ public class UserFragment extends BaseSupportFragment implements OnClickListener
final AppCompatActivity activity = (AppCompatActivity) getActivity();
final IThemedActivity themed = (IThemedActivity) activity;
final int themeRes = themed.getCurrentThemeResourceId();
final int actionBarColor;
if (ThemeUtils.isDarkTheme(themeRes)) {
final int actionBarColor = getResources().getColor(R.color.background_color_action_bar_dark);
mTintedStatusContent.setColor(actionBarColor, themed.getCurrentThemeBackgroundAlpha());
mActionBarBackground.setColor(actionBarColor);
ActivityAccessor.setTaskDescription(activity, new TaskDescriptionCompat(null, null, actionBarColor));
actionBarColor = getResources().getColor(R.color.background_color_action_bar_dark);
} else {
mTintedStatusContent.setColor(color, themed.getCurrentThemeBackgroundAlpha());
mActionBarBackground.setColor(color);
ActivityAccessor.setTaskDescription(activity, new TaskDescriptionCompat(null, null, color));
actionBarColor = color;
}
if (mTintedStatusContent != null) {
mTintedStatusContent.setColor(actionBarColor, themed.getCurrentThemeBackgroundAlpha());
}
if (mActionBarBackground != null) {
mActionBarBackground.setColor(actionBarColor);
}
ActivityAccessor.setTaskDescription(activity, new TaskDescriptionCompat(null, null, actionBarColor));
mDescriptionView.setLinkTextColor(color);
mProfileBannerView.setBackgroundColor(color);
mLocationView.setLinkTextColor(color);

View File

@ -23,6 +23,7 @@ import android.content.Context;
import android.content.SharedPreferences;
import android.database.sqlite.SQLiteDatabase;
import android.os.Handler;
import android.util.Log;
import android.util.Pair;
import com.bluelinelabs.logansquare.LoganSquare;
@ -30,6 +31,7 @@ import com.bluelinelabs.logansquare.LoganSquare;
import org.mariotaku.jsonserializer.JSONFileIO;
import org.mariotaku.twidere.app.TwidereApplication;
import org.mariotaku.twidere.model.ParcelableActivity;
import org.mariotaku.twidere.util.Utils;
import java.io.File;
import java.io.FileInputStream;
@ -159,7 +161,14 @@ public abstract class Twitter4JActivitiesLoader extends ParcelableActivitiesLoad
try {
return LoganSquare.parseList(new FileInputStream(file), ParcelableActivity.class);
} catch (final IOException e) {
e.printStackTrace();
if (Utils.isDebugBuild()) {
Log.w(LOGTAG, e);
}
} catch (RuntimeException e) {
if (Utils.isDebugBuild()) {
throw e;
}
Log.e(LOGTAG, "Error unserializing data", e);
}
return null;
}

View File

@ -19,12 +19,19 @@
package org.mariotaku.twidere.model;
import com.bluelinelabs.logansquare.annotation.JsonField;
import com.bluelinelabs.logansquare.annotation.JsonObject;
@JsonObject
public class UnreadItem {
public final long id, account_id;
@JsonField(name = "id")
public long id;
@JsonField(name = "account_id")
public long account_id;
public UnreadItem() {
}
public UnreadItem(final long id, final long account_id) {
this.id = id;