Some other changes

This commit is contained in:
tom79 2019-11-08 18:05:35 +01:00
parent ac026bc869
commit 87bb6d41f8
5 changed files with 22 additions and 41 deletions

View File

@ -11,6 +11,7 @@ android {
multiDexEnabled true
renderscriptTargetApi 28 as int
renderscriptSupportModeEnabled true
vectorDrawables.useSupportLibrary = true
}
dexOptions {
javaMaxHeapSize "4g"
@ -69,6 +70,7 @@ ext.netCipherVersion = "2.0.0-alpha1"
ext.acraVersion = "5.4.0"
dependencies {
implementation 'com.android.support:appcompat-v7:29.0.2'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
@ -124,6 +126,5 @@ dependencies {
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
implementation 'com.github.smarteist:autoimageslider:1.3.2'
//debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.0-beta-2'
implementation 'com.jaredrummler:colorpicker:1.1.0'
implementation 'com.afollestad:aesthetic:1.0.0-beta05'
implementation 'com.jaredrummler:cyanea:1.0.2'
}

View File

@ -8,26 +8,24 @@ import android.content.res.Configuration;
import androidx.annotation.NonNull;
import com.afollestad.aesthetic.Aesthetic;
import com.afollestad.aesthetic.AestheticActivity;
import com.google.android.material.snackbar.Snackbar;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Toast;
import com.franmontiel.localechanger.LocaleChanger;
import com.jaredrummler.cyanea.app.CyaneaAppCompatActivity;
import com.vanniktech.emoji.EmojiManager;
import com.vanniktech.emoji.one.EmojiOneProvider;
import java.util.Timer;
import app.fedilab.android.helper.Helper;
import app.fedilab.android.helper.ThemeHelper;
import es.dmoral.toasty.Toasty;
/**
@ -36,7 +34,7 @@ import es.dmoral.toasty.Toasty;
*/
@SuppressLint("Registered")
public class BaseActivity extends AestheticActivity {
public class BaseActivity extends CyaneaAppCompatActivity {
public static final int READ_WRITE_STORAGE = 52;

View File

@ -25,6 +25,7 @@ import androidx.multidex.MultiDexApplication;
import com.evernote.android.job.JobManager;
import com.franmontiel.localechanger.LocaleChanger;
import com.jaredrummler.cyanea.Cyanea;
import net.gotev.uploadservice.UploadService;
@ -75,7 +76,7 @@ public class MainApplication extends MultiDexApplication {
if( Helper.liveNotifType(getApplicationContext()) == Helper.NOTIF_NONE) {
NotificationsSyncJob.schedule(false);
}
Cyanea.init(this, super.getResources());
ApplicationJob.cancelAllJob(BackupStatusesSyncJob.BACKUP_SYNC);
BackupStatusesSyncJob.schedule(false);
ApplicationJob.cancelAllJob(BackupNotificationsSyncJob.BACKUP_NOTIFICATIONS_SYNC);

View File

@ -1,15 +1,11 @@
package app.fedilab.android.helper;
import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.util.TypedValue;
import com.afollestad.aesthetic.Aesthetic;
import app.fedilab.android.R;
import static android.content.Context.MODE_PRIVATE;
@ -20,21 +16,6 @@ public class ThemeHelper {
public static void changeTheme(Context context, int theme){
final SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
Aesthetic.get()
.activityTheme(theme)
.attribute(R.attr.cardviewColor,null, R.color.mastodonC1, true)
.colorAccent(null, R.color.mastodonC4)
.colorPrimary(null,R.color.mastodonC1)
.colorPrimaryDark(null,R.color.mastodonC1)
.colorNavigationBar(null,R.color.mastodonC1)
.colorStatusBar(null,R.color.mastodonC1)
.toolbarIconColor(null,R.color.white)
.colorWindowBackground(null,R.color.mastodonC1)
.apply();
}
public static int getAttColor(Context context, int attColor){

View File

@ -3,55 +3,55 @@
<attr name="cardviewColor" type="color"/>
<!-- Light theme -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<style name="AppTheme" parent="Theme.Cyanea.Light.DarkActionBar">
<item name="cardviewColor">@color/white</item>
</style>
<style name="AppTheme_NoActionBar_Fedilab" parent="Theme.AppCompat.Light.NoActionBar">
<style name="AppTheme_NoActionBar_Fedilab" parent="Theme.Cyanea.Light.NoActionBar">
<item name="cardviewColor">@color/white</item>
</style>
<!-- BLACK theme -->
<style name="AppThemeBlack" parent="Theme.AppCompat">
<style name="AppThemeBlack" parent="Theme.Cyanea.Dark">
<item name="cardviewColor">@color/black</item>
</style>
<style name="AppThemeBlack_NoActionBar" parent="Theme.AppCompat.NoActionBar">
<style name="AppThemeBlack_NoActionBar" parent="Theme.Cyanea.Dark.NoActionBar">
<item name="cardviewColor">@color/black</item>
</style>
<!-- Dark theme -->
<style name="AppThemeDark" parent="Theme.AppCompat">
<style name="AppThemeDark" parent="Theme.Cyanea.Dark">
<item name="cardviewColor">@color/mastodonC1</item>
</style>
<style name="AppThemeDark_NoActionBar" parent="Theme.AppCompat.NoActionBar">
<style name="AppThemeDark_NoActionBar" parent="Theme.Cyanea.Dark.NoActionBar">
<item name="cardviewColor">@color/mastodonC1</item>
</style>
<style name="Dialog" parent="Theme.AppCompat.Light.Dialog.Alert">
<style name="Dialog" parent="Cyanea.AlertDialog.Theme.Light">
</style>
<style name="DialogDark" parent="Theme.AppCompat.Dialog.Alert">
<style name="DialogDark" parent="Cyanea.AlertDialog.Theme.Dark">
</style>
<style name="DialogBlack" parent="Theme.AppCompat.Dialog.Alert">
<style name="DialogBlack" parent="Cyanea.AlertDialog.Theme.Dark">
</style>
<style name="TransparentLight" parent="Theme.AppCompat.Light">
<style name="TransparentLight" parent="Theme.Cyanea.Light">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowContentOverlay">@null</item>
</style>
<style name="TransparentDark" parent="Theme.AppCompat">
<style name="TransparentDark" parent="Theme.Cyanea.Dark">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowContentOverlay">@null</item>
</style>
<style name="TransparentBlack" parent="Theme.AppCompat">
<style name="TransparentBlack" parent="Theme.Cyanea.Dark">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowContentOverlay">@null</item>
@ -65,7 +65,7 @@
<!-- Light theme -->
<style name="AppAdminTheme" parent="Theme.AppCompat">
<style name="AppAdminTheme" parent="Theme.Cyanea.Dark">
</style>