copy release notes
This commit is contained in:
parent
ea0f88b733
commit
e7489d3fd0
|
@ -0,0 +1,156 @@
|
|||
package app.fedilab.android.activities;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.res.Configuration;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.view.ActionMode;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.franmontiel.localechanger.LocaleChanger;
|
||||
import com.google.android.material.snackbar.Snackbar;
|
||||
import com.jaredrummler.cyanea.app.CyaneaAppCompatActivity;
|
||||
import com.vanniktech.emoji.EmojiManager;
|
||||
import com.vanniktech.emoji.one.EmojiOneProvider;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Timer;
|
||||
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
|
||||
/**
|
||||
* Created by Thomas on 12/12/2017.
|
||||
* Base activity which updates security provider
|
||||
*/
|
||||
|
||||
@SuppressLint("Registered")
|
||||
public class BaseActivity extends AllBaseActivity {
|
||||
|
||||
|
||||
public static final int READ_WRITE_STORAGE = 52;
|
||||
public static Timer timer;
|
||||
public static boolean canShowActionMode = true;
|
||||
|
||||
static {
|
||||
Helper.installProvider();
|
||||
EmojiManager.install(new EmojiOneProvider());
|
||||
}
|
||||
|
||||
private ProgressDialog mProgressDialog;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
||||
/*if (BuildConfig.DEBUG) {
|
||||
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
|
||||
.detectDiskReads()
|
||||
.detectDiskWrites()
|
||||
.detectAll()
|
||||
.penaltyLog()
|
||||
.build());
|
||||
StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()
|
||||
.detectLeakedSqlLiteObjects()
|
||||
.detectLeakedClosableObjects()
|
||||
.detectLeakedRegistrationObjects()
|
||||
.detectActivityLeaks()
|
||||
.penaltyLog()
|
||||
// .penaltyDeath()
|
||||
.build());
|
||||
}*/
|
||||
canShowActionMode = true;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
|
||||
}
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (timer != null) {
|
||||
timer.cancel();
|
||||
timer = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onConfigurationChanged(@NotNull Configuration newConfig) {
|
||||
super.onConfigurationChanged(newConfig);
|
||||
LocaleChanger.onConfigurationChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void attachBaseContext(@NotNull Context newBase) {
|
||||
newBase = LocaleChanger.configureBaseContext(newBase);
|
||||
super.attachBaseContext(newBase);
|
||||
}
|
||||
|
||||
public boolean requestPermission(String permission) {
|
||||
boolean isGranted = ContextCompat.checkSelfPermission(this, permission) == PackageManager.PERMISSION_GRANTED;
|
||||
if (!isGranted) {
|
||||
ActivityCompat.requestPermissions(
|
||||
this,
|
||||
new String[]{permission},
|
||||
READ_WRITE_STORAGE);
|
||||
}
|
||||
return isGranted;
|
||||
}
|
||||
|
||||
public void isPermissionGranted(boolean isGranted, String permission) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
||||
if (requestCode == READ_WRITE_STORAGE) {
|
||||
isPermissionGranted(grantResults[0] == PackageManager.PERMISSION_GRANTED, permissions[0]);
|
||||
}
|
||||
}
|
||||
|
||||
protected void showLoading(@NonNull String message) {
|
||||
mProgressDialog = new ProgressDialog(this);
|
||||
mProgressDialog.setMessage(message);
|
||||
mProgressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
|
||||
mProgressDialog.setCancelable(false);
|
||||
mProgressDialog.show();
|
||||
}
|
||||
|
||||
protected void hideLoading() {
|
||||
if (mProgressDialog != null) {
|
||||
mProgressDialog.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
protected void showSnackbar(@NonNull String message) {
|
||||
View view = findViewById(android.R.id.content);
|
||||
if (view != null) {
|
||||
Snackbar.make(view, message, Snackbar.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toasty.info(BaseActivity.this, message, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onActionModeStarted(ActionMode mode) {
|
||||
if (!canShowActionMode) {
|
||||
mode.finish();
|
||||
}
|
||||
super.onActionModeStarted(mode);
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,156 @@
|
|||
package app.fedilab.android.activities;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.res.Configuration;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.view.ActionMode;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.franmontiel.localechanger.LocaleChanger;
|
||||
import com.google.android.material.snackbar.Snackbar;
|
||||
import com.jaredrummler.cyanea.app.CyaneaAppCompatActivity;
|
||||
import com.vanniktech.emoji.EmojiManager;
|
||||
import com.vanniktech.emoji.one.EmojiOneProvider;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Timer;
|
||||
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
|
||||
/**
|
||||
* Created by Thomas on 12/12/2017.
|
||||
* Base activity which updates security provider
|
||||
*/
|
||||
|
||||
@SuppressLint("Registered")
|
||||
public class BaseActivity extends CyaneaAppCompatActivity {
|
||||
|
||||
|
||||
public static final int READ_WRITE_STORAGE = 52;
|
||||
public static Timer timer;
|
||||
public static boolean canShowActionMode = true;
|
||||
|
||||
static {
|
||||
Helper.installProvider();
|
||||
EmojiManager.install(new EmojiOneProvider());
|
||||
}
|
||||
|
||||
private ProgressDialog mProgressDialog;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
||||
/*if (BuildConfig.DEBUG) {
|
||||
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
|
||||
.detectDiskReads()
|
||||
.detectDiskWrites()
|
||||
.detectAll()
|
||||
.penaltyLog()
|
||||
.build());
|
||||
StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()
|
||||
.detectLeakedSqlLiteObjects()
|
||||
.detectLeakedClosableObjects()
|
||||
.detectLeakedRegistrationObjects()
|
||||
.detectActivityLeaks()
|
||||
.penaltyLog()
|
||||
// .penaltyDeath()
|
||||
.build());
|
||||
}*/
|
||||
canShowActionMode = true;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
|
||||
}
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (timer != null) {
|
||||
timer.cancel();
|
||||
timer = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onConfigurationChanged(@NotNull Configuration newConfig) {
|
||||
super.onConfigurationChanged(newConfig);
|
||||
LocaleChanger.onConfigurationChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void attachBaseContext(@NotNull Context newBase) {
|
||||
newBase = LocaleChanger.configureBaseContext(newBase);
|
||||
super.attachBaseContext(newBase);
|
||||
}
|
||||
|
||||
public boolean requestPermission(String permission) {
|
||||
boolean isGranted = ContextCompat.checkSelfPermission(this, permission) == PackageManager.PERMISSION_GRANTED;
|
||||
if (!isGranted) {
|
||||
ActivityCompat.requestPermissions(
|
||||
this,
|
||||
new String[]{permission},
|
||||
READ_WRITE_STORAGE);
|
||||
}
|
||||
return isGranted;
|
||||
}
|
||||
|
||||
public void isPermissionGranted(boolean isGranted, String permission) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
||||
if (requestCode == READ_WRITE_STORAGE) {
|
||||
isPermissionGranted(grantResults[0] == PackageManager.PERMISSION_GRANTED, permissions[0]);
|
||||
}
|
||||
}
|
||||
|
||||
protected void showLoading(@NonNull String message) {
|
||||
mProgressDialog = new ProgressDialog(this);
|
||||
mProgressDialog.setMessage(message);
|
||||
mProgressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
|
||||
mProgressDialog.setCancelable(false);
|
||||
mProgressDialog.show();
|
||||
}
|
||||
|
||||
protected void hideLoading() {
|
||||
if (mProgressDialog != null) {
|
||||
mProgressDialog.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
protected void showSnackbar(@NonNull String message) {
|
||||
View view = findViewById(android.R.id.content);
|
||||
if (view != null) {
|
||||
Snackbar.make(view, message, Snackbar.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toasty.info(BaseActivity.this, message, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onActionModeStarted(ActionMode mode) {
|
||||
if (!canShowActionMode) {
|
||||
mode.finish();
|
||||
}
|
||||
super.onActionModeStarted(mode);
|
||||
|
||||
}
|
||||
}
|
|
@ -81,7 +81,7 @@ import app.fedilab.android.sqlite.StatusCacheDAO;
|
|||
* Charts for owner notifications activity
|
||||
*/
|
||||
|
||||
public class OwnerNotificationChartsActivity extends BaseActivity implements OnRetrieveNotificationChartsInterface {
|
||||
public class BaseOwnerNotificationChartsActivity extends BaseActivity implements OnRetrieveNotificationChartsInterface {
|
||||
|
||||
|
||||
private Button settings_time_from, settings_time_to;
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
package app.fedilab.android.activities;
|
||||
|
||||
import com.vanniktech.emoji.EmojiManager;
|
||||
import com.vanniktech.emoji.one.EmojiOneProvider;
|
||||
|
||||
|
||||
/**
|
||||
* Created by Thomas on 12/12/2017.
|
||||
* Base activity which updates security provider
|
||||
*/
|
||||
|
||||
@SuppressLint("Registered")
|
||||
public class BaseActivity extends AllBaseActivity {
|
||||
|
||||
static {
|
||||
Helper.installProvider();
|
||||
EmojiManager.install(new EmojiOneProvider());
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue