forked from mirrors/Fedilab
Remove cyanea
This commit is contained in:
parent
da4ed393a9
commit
ccf7ac5cff
173 changed files with 343 additions and 1159 deletions
|
@ -88,7 +88,6 @@ dependencies {
|
||||||
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
|
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
|
||||||
implementation 'androidx.preference:preference:1.2.0'
|
implementation 'androidx.preference:preference:1.2.0'
|
||||||
implementation "org.conscrypt:conscrypt-android:2.5.2"
|
implementation "org.conscrypt:conscrypt-android:2.5.2"
|
||||||
implementation 'com.github.evozi:Cyanea:1.0.7'
|
|
||||||
implementation 'com.vanniktech:emoji-one:0.6.0'
|
implementation 'com.vanniktech:emoji-one:0.6.0'
|
||||||
implementation 'com.github.GrenderG:Toasty:1.5.2'
|
implementation 'com.github.GrenderG:Toasty:1.5.2'
|
||||||
implementation 'org.framagit.tom79:SparkButton:1.0.13'
|
implementation 'org.framagit.tom79:SparkButton:1.0.13'
|
||||||
|
|
|
@ -287,15 +287,15 @@
|
||||||
android:name=".activities.InstanceActivity"
|
android:name=".activities.InstanceActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||||
android:label="@string/action_about_instance"
|
android:label="@string/action_about_instance"
|
||||||
android:theme="@style/DialogDark" />
|
android:theme="@style/MaterialAlertDialog.Material3" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.InstanceProfileActivity"
|
android:name=".activities.InstanceProfileActivity"
|
||||||
android:excludeFromRecents="true"
|
android:excludeFromRecents="true"
|
||||||
android:theme="@style/DialogDark" />
|
android:theme="@style/MaterialAlertDialog.Material3" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.ProxyActivity"
|
android:name=".activities.ProxyActivity"
|
||||||
android:excludeFromRecents="true"
|
android:excludeFromRecents="true"
|
||||||
android:theme="@style/DialogDark" />
|
android:theme="@style/MaterialAlertDialog.Material3" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.HashTagActivity"
|
android:name=".activities.HashTagActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
|
@ -310,7 +310,7 @@
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.InstanceHealthActivity"
|
android:name=".activities.InstanceHealthActivity"
|
||||||
android:excludeFromRecents="true"
|
android:excludeFromRecents="true"
|
||||||
android:theme="@style/DialogDark" />
|
android:theme="@style/MaterialAlertDialog.Material3" />
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.ReportActivity"
|
android:name=".activities.ReportActivity"
|
||||||
|
|
|
@ -28,7 +28,6 @@ import android.content.Intent;
|
||||||
import android.content.IntentFilter;
|
import android.content.IntentFilter;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.graphics.PorterDuff;
|
import android.graphics.PorterDuff;
|
||||||
import android.graphics.drawable.ColorDrawable;
|
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
|
@ -39,7 +38,6 @@ import android.text.Editable;
|
||||||
import android.text.Html;
|
import android.text.Html;
|
||||||
import android.text.TextWatcher;
|
import android.text.TextWatcher;
|
||||||
import android.util.Patterns;
|
import android.util.Patterns;
|
||||||
import android.view.ContextThemeWrapper;
|
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
|
@ -59,7 +57,6 @@ import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.appcompat.widget.PopupMenu;
|
import androidx.appcompat.widget.PopupMenu;
|
||||||
import androidx.appcompat.widget.SearchView;
|
import androidx.appcompat.widget.SearchView;
|
||||||
import androidx.core.app.ActivityOptionsCompat;
|
import androidx.core.app.ActivityOptionsCompat;
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.core.view.GravityCompat;
|
import androidx.core.view.GravityCompat;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.fragment.app.FragmentTransaction;
|
import androidx.fragment.app.FragmentTransaction;
|
||||||
|
@ -77,7 +74,6 @@ import com.bumptech.glide.request.target.CustomTarget;
|
||||||
import com.bumptech.glide.request.transition.Transition;
|
import com.bumptech.glide.request.transition.Transition;
|
||||||
import com.google.android.material.snackbar.Snackbar;
|
import com.google.android.material.snackbar.Snackbar;
|
||||||
import com.google.android.material.tabs.TabLayout;
|
import com.google.android.material.tabs.TabLayout;
|
||||||
import com.jaredrummler.cyanea.Cyanea;
|
|
||||||
|
|
||||||
import org.jsoup.Jsoup;
|
import org.jsoup.Jsoup;
|
||||||
import org.jsoup.nodes.Document;
|
import org.jsoup.nodes.Document;
|
||||||
|
@ -196,8 +192,6 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
|
||||||
context.startActivity(intentCompose);
|
context.startActivity(intentCompose);
|
||||||
})
|
})
|
||||||
.setTextColor(ThemeHelper.getAttColor(BaseMainActivity.this, R.attr.mTextColor))
|
.setTextColor(ThemeHelper.getAttColor(BaseMainActivity.this, R.attr.mTextColor))
|
||||||
.setActionTextColor(ContextCompat.getColor(BaseMainActivity.this, R.color.cyanea_accent_reference))
|
|
||||||
.setBackgroundTint(ContextCompat.getColor(BaseMainActivity.this, R.color.cyanea_primary_dark_reference))
|
|
||||||
.show();
|
.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -259,7 +253,7 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else if (b.getBoolean(Helper.RECEIVE_RECREATE_ACTIVITY, false)) {
|
} else if (b.getBoolean(Helper.RECEIVE_RECREATE_ACTIVITY, false)) {
|
||||||
Cyanea.getInstance().edit().apply().recreate(BaseMainActivity.this);
|
|
||||||
} else if (b.getBoolean(Helper.RECEIVE_NEW_MESSAGE, false)) {
|
} else if (b.getBoolean(Helper.RECEIVE_NEW_MESSAGE, false)) {
|
||||||
Status statusSent = (Status) b.getSerializable(Helper.RECEIVE_STATUS_ACTION);
|
Status statusSent = (Status) b.getSerializable(Helper.RECEIVE_STATUS_ACTION);
|
||||||
String statusEditId = b.getString(Helper.ARG_EDIT_STATUS_ID, null);
|
String statusEditId = b.getString(Helper.ARG_EDIT_STATUS_ID, null);
|
||||||
|
@ -271,8 +265,6 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
|
||||||
startActivity(intentContext);
|
startActivity(intentContext);
|
||||||
})
|
})
|
||||||
.setTextColor(ThemeHelper.getAttColor(BaseMainActivity.this, R.attr.mTextColor))
|
.setTextColor(ThemeHelper.getAttColor(BaseMainActivity.this, R.attr.mTextColor))
|
||||||
.setActionTextColor(ContextCompat.getColor(BaseMainActivity.this, R.color.cyanea_accent_reference))
|
|
||||||
.setBackgroundTint(ContextCompat.getColor(BaseMainActivity.this, R.color.cyanea_primary_dark_reference))
|
|
||||||
.show();
|
.show();
|
||||||
//The message was edited, we need to update the timeline
|
//The message was edited, we need to update the timeline
|
||||||
if (statusEditId != null) {
|
if (statusEditId != null) {
|
||||||
|
@ -303,7 +295,6 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(BaseMainActivity.this);
|
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(BaseMainActivity.this);
|
||||||
ThemeHelper.applyTheme(this);
|
|
||||||
if (!Helper.isLoggedIn(BaseMainActivity.this)) {
|
if (!Helper.isLoggedIn(BaseMainActivity.this)) {
|
||||||
//It is not, the user is redirected to the login page
|
//It is not, the user is redirected to the login page
|
||||||
Intent myIntent = new Intent(BaseMainActivity.this, LoginActivity.class);
|
Intent myIntent = new Intent(BaseMainActivity.this, LoginActivity.class);
|
||||||
|
@ -329,13 +320,10 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
|
||||||
actionBar.setDisplayShowTitleEnabled(false);
|
actionBar.setDisplayShowTitleEnabled(false);
|
||||||
}
|
}
|
||||||
rateThisApp();
|
rateThisApp();
|
||||||
SharedPreferences cyneaPref = getSharedPreferences("com.jaredrummler.cyanea", Context.MODE_PRIVATE);
|
|
||||||
binding.tabLayout.setTabTextColors(ThemeHelper.getAttColor(BaseMainActivity.this, R.attr.mTextColor), cyneaPref.getInt("theme_accent", -1));
|
|
||||||
binding.tabLayout.setTabIconTint(ThemeHelper.getColorStateList(BaseMainActivity.this));
|
|
||||||
binding.compose.setOnClickListener(v -> startActivity(new Intent(this, ComposeActivity.class)));
|
binding.compose.setOnClickListener(v -> startActivity(new Intent(this, ComposeActivity.class)));
|
||||||
headerMenuOpen = false;
|
headerMenuOpen = false;
|
||||||
binding.bottomNavView.setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
|
||||||
binding.navView.setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
|
||||||
|
|
||||||
|
|
||||||
// Passing each menu ID as a set of Ids because each
|
// Passing each menu ID as a set of Ids because each
|
||||||
|
@ -537,14 +525,14 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
|
||||||
});
|
});
|
||||||
|
|
||||||
headerMainBinding.headerOptionInfo.setOnClickListener(v -> {
|
headerMainBinding.headerOptionInfo.setOnClickListener(v -> {
|
||||||
PopupMenu popup = new PopupMenu(new ContextThemeWrapper(BaseMainActivity.this, Helper.popupStyle()), headerMainBinding.headerOptionInfo);
|
PopupMenu popup = new PopupMenu(BaseMainActivity.this, headerMainBinding.headerOptionInfo);
|
||||||
popup.getMenuInflater()
|
popup.getMenuInflater()
|
||||||
.inflate(R.menu.main, popup.getMenu());
|
.inflate(R.menu.main, popup.getMenu());
|
||||||
|
|
||||||
popup.setOnMenuItemClickListener(item -> {
|
popup.setOnMenuItemClickListener(item -> {
|
||||||
int itemId = item.getItemId();
|
int itemId = item.getItemId();
|
||||||
if (itemId == R.id.action_logout_account) {
|
if (itemId == R.id.action_logout_account) {
|
||||||
AlertDialog.Builder alt_bld = new AlertDialog.Builder(BaseMainActivity.this, Helper.dialogStyle());
|
AlertDialog.Builder alt_bld = new AlertDialog.Builder(BaseMainActivity.this);
|
||||||
alt_bld.setTitle(R.string.action_logout);
|
alt_bld.setTitle(R.string.action_logout);
|
||||||
if (currentAccount.mastodon_account != null && currentAccount.mastodon_account.username != null && currentAccount.instance != null) {
|
if (currentAccount.mastodon_account != null && currentAccount.mastodon_account.username != null && currentAccount.instance != null) {
|
||||||
alt_bld.setMessage(getString(R.string.logout_account_confirmation, currentAccount.mastodon_account.username, currentAccount.instance));
|
alt_bld.setMessage(getString(R.string.logout_account_confirmation, currentAccount.mastodon_account.username, currentAccount.instance));
|
||||||
|
@ -1123,7 +1111,7 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
|
||||||
view = binding.bottomNavView.findViewById(R.id.nav_public);
|
view = binding.bottomNavView.findViewById(R.id.nav_public);
|
||||||
showExtendedFilter = false;
|
showExtendedFilter = false;
|
||||||
}
|
}
|
||||||
PopupMenu popup = new PopupMenu(new ContextThemeWrapper(BaseMainActivity.this, Helper.popupStyle()), view, Gravity.TOP);
|
PopupMenu popup = new PopupMenu(BaseMainActivity.this, view, Gravity.TOP);
|
||||||
popup.getMenuInflater()
|
popup.getMenuInflater()
|
||||||
.inflate(R.menu.option_filter_toots, popup.getMenu());
|
.inflate(R.menu.option_filter_toots, popup.getMenu());
|
||||||
Menu menu = popup.getMenu();
|
Menu menu = popup.getMenu();
|
||||||
|
@ -1190,7 +1178,7 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
|
||||||
itemShowReplies.setChecked(show_replies);
|
itemShowReplies.setChecked(show_replies);
|
||||||
editor.apply();
|
editor.apply();
|
||||||
} else if (itemId == R.id.action_filter) {
|
} else if (itemId == R.id.action_filter) {
|
||||||
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(BaseMainActivity.this, Helper.dialogStyle());
|
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(BaseMainActivity.this);
|
||||||
LayoutInflater inflater = getLayoutInflater();
|
LayoutInflater inflater = getLayoutInflater();
|
||||||
View dialogView = inflater.inflate(R.layout.popup_filter_regex, new LinearLayout(BaseMainActivity.this), false);
|
View dialogView = inflater.inflate(R.layout.popup_filter_regex, new LinearLayout(BaseMainActivity.this), false);
|
||||||
dialogBuilder.setView(dialogView);
|
dialogBuilder.setView(dialogView);
|
||||||
|
@ -1269,8 +1257,6 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
|
||||||
if (!singleBar) {
|
if (!singleBar) {
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
binding.bottomNavView.getOrCreateBadge(R.id.nav_privates).setNumber(count);
|
binding.bottomNavView.getOrCreateBadge(R.id.nav_privates).setNumber(count);
|
||||||
binding.bottomNavView.getBadge(R.id.nav_privates).setBackgroundColor(ContextCompat.getColor(BaseMainActivity.this, R.color.cyanea_accent_reference));
|
|
||||||
binding.bottomNavView.getBadge(R.id.nav_privates).setBadgeTextColor(ThemeHelper.getAttColor(BaseMainActivity.this, R.attr.mTextColor));
|
|
||||||
} else {
|
} else {
|
||||||
binding.bottomNavView.removeBadge(R.id.nav_privates);
|
binding.bottomNavView.removeBadge(R.id.nav_privates);
|
||||||
}
|
}
|
||||||
|
@ -1289,8 +1275,6 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
|
||||||
if (!singleBar) {
|
if (!singleBar) {
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
binding.bottomNavView.getOrCreateBadge(R.id.nav_notifications).setNumber(count);
|
binding.bottomNavView.getOrCreateBadge(R.id.nav_notifications).setNumber(count);
|
||||||
binding.bottomNavView.getBadge(R.id.nav_notifications).setBackgroundColor(ContextCompat.getColor(BaseMainActivity.this, R.color.cyanea_accent_reference));
|
|
||||||
binding.bottomNavView.getBadge(R.id.nav_notifications).setBadgeTextColor(ThemeHelper.getAttColor(BaseMainActivity.this, R.attr.mTextColor));
|
|
||||||
} else {
|
} else {
|
||||||
binding.bottomNavView.removeBadge(R.id.nav_notifications);
|
binding.bottomNavView.removeBadge(R.id.nav_notifications);
|
||||||
}
|
}
|
||||||
|
@ -1355,8 +1339,6 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
|
||||||
case HOME:
|
case HOME:
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
binding.bottomNavView.getOrCreateBadge(R.id.nav_home).setNumber(count);
|
binding.bottomNavView.getOrCreateBadge(R.id.nav_home).setNumber(count);
|
||||||
binding.bottomNavView.getBadge(R.id.nav_home).setBackgroundColor(ContextCompat.getColor(BaseMainActivity.this, R.color.cyanea_accent_reference));
|
|
||||||
binding.bottomNavView.getBadge(R.id.nav_home).setBadgeTextColor(ThemeHelper.getAttColor(BaseMainActivity.this, R.attr.mTextColor));
|
|
||||||
} else {
|
} else {
|
||||||
binding.bottomNavView.removeBadge(R.id.nav_home);
|
binding.bottomNavView.removeBadge(R.id.nav_home);
|
||||||
}
|
}
|
||||||
|
@ -1364,8 +1346,6 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
|
||||||
case LOCAL:
|
case LOCAL:
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
binding.bottomNavView.getOrCreateBadge(R.id.nav_local).setNumber(count);
|
binding.bottomNavView.getOrCreateBadge(R.id.nav_local).setNumber(count);
|
||||||
binding.bottomNavView.getBadge(R.id.nav_local).setBackgroundColor(ContextCompat.getColor(BaseMainActivity.this, R.color.cyanea_accent_reference));
|
|
||||||
binding.bottomNavView.getBadge(R.id.nav_local).setBadgeTextColor(ThemeHelper.getAttColor(BaseMainActivity.this, R.attr.mTextColor));
|
|
||||||
} else {
|
} else {
|
||||||
binding.bottomNavView.removeBadge(R.id.nav_local);
|
binding.bottomNavView.removeBadge(R.id.nav_local);
|
||||||
}
|
}
|
||||||
|
@ -1373,8 +1353,6 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
|
||||||
case PUBLIC:
|
case PUBLIC:
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
binding.bottomNavView.getOrCreateBadge(R.id.nav_public).setNumber(count);
|
binding.bottomNavView.getOrCreateBadge(R.id.nav_public).setNumber(count);
|
||||||
binding.bottomNavView.getBadge(R.id.nav_public).setBackgroundColor(ContextCompat.getColor(BaseMainActivity.this, R.color.cyanea_accent_reference));
|
|
||||||
binding.bottomNavView.getBadge(R.id.nav_public).setBadgeTextColor(ThemeHelper.getAttColor(BaseMainActivity.this, R.attr.mTextColor));
|
|
||||||
} else {
|
} else {
|
||||||
binding.bottomNavView.removeBadge(R.id.nav_public);
|
binding.bottomNavView.removeBadge(R.id.nav_public);
|
||||||
}
|
}
|
||||||
|
@ -1382,8 +1360,6 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
|
||||||
case NOTIFICATION:
|
case NOTIFICATION:
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
binding.bottomNavView.getOrCreateBadge(R.id.nav_notifications).setNumber(count);
|
binding.bottomNavView.getOrCreateBadge(R.id.nav_notifications).setNumber(count);
|
||||||
binding.bottomNavView.getBadge(R.id.nav_notifications).setBackgroundColor(ContextCompat.getColor(BaseMainActivity.this, R.color.cyanea_accent_reference));
|
|
||||||
binding.bottomNavView.getBadge(R.id.nav_notifications).setBadgeTextColor(ThemeHelper.getAttColor(BaseMainActivity.this, R.attr.mTextColor));
|
|
||||||
} else {
|
} else {
|
||||||
binding.bottomNavView.removeBadge(R.id.nav_notifications);
|
binding.bottomNavView.removeBadge(R.id.nav_notifications);
|
||||||
}
|
}
|
||||||
|
@ -1391,8 +1367,6 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
|
||||||
case DIRECT:
|
case DIRECT:
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
binding.bottomNavView.getOrCreateBadge(R.id.nav_privates).setNumber(count);
|
binding.bottomNavView.getOrCreateBadge(R.id.nav_privates).setNumber(count);
|
||||||
binding.bottomNavView.getBadge(R.id.nav_privates).setBackgroundColor(ContextCompat.getColor(BaseMainActivity.this, R.color.cyanea_accent_reference));
|
|
||||||
binding.bottomNavView.getBadge(R.id.nav_privates).setBadgeTextColor(ThemeHelper.getAttColor(BaseMainActivity.this, R.attr.mTextColor));
|
|
||||||
} else {
|
} else {
|
||||||
binding.bottomNavView.removeBadge(R.id.nav_privates);
|
binding.bottomNavView.removeBadge(R.id.nav_privates);
|
||||||
}
|
}
|
||||||
|
@ -1525,7 +1499,7 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
|
||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
if (item.getItemId() == R.id.action_logout) {
|
if (item.getItemId() == R.id.action_logout) {
|
||||||
AlertDialog.Builder alt_bld = new AlertDialog.Builder(BaseMainActivity.this, Helper.dialogStyle());
|
AlertDialog.Builder alt_bld = new AlertDialog.Builder(BaseMainActivity.this);
|
||||||
alt_bld.setTitle(R.string.action_logout);
|
alt_bld.setTitle(R.string.action_logout);
|
||||||
alt_bld.setMessage(getString(R.string.logout_account_confirmation, account.mastodon_account.username, account.instance));
|
alt_bld.setMessage(getString(R.string.logout_account_confirmation, account.mastodon_account.username, account.instance));
|
||||||
alt_bld.setPositiveButton(R.string.action_logout, (dialog, id) -> {
|
alt_bld.setPositiveButton(R.string.action_logout, (dialog, id) -> {
|
||||||
|
|
|
@ -23,9 +23,6 @@ import androidx.multidex.MultiDex;
|
||||||
import androidx.multidex.MultiDexApplication;
|
import androidx.multidex.MultiDexApplication;
|
||||||
import androidx.preference.PreferenceManager;
|
import androidx.preference.PreferenceManager;
|
||||||
|
|
||||||
import com.jaredrummler.cyanea.Cyanea;
|
|
||||||
import com.jaredrummler.cyanea.prefs.CyaneaTheme;
|
|
||||||
|
|
||||||
import org.acra.ACRA;
|
import org.acra.ACRA;
|
||||||
import org.acra.ReportField;
|
import org.acra.ReportField;
|
||||||
import org.acra.config.CoreConfigurationBuilder;
|
import org.acra.config.CoreConfigurationBuilder;
|
||||||
|
@ -33,8 +30,6 @@ import org.acra.config.DialogConfigurationBuilder;
|
||||||
import org.acra.config.MailSenderConfigurationBuilder;
|
import org.acra.config.MailSenderConfigurationBuilder;
|
||||||
import org.acra.data.StringFormat;
|
import org.acra.data.StringFormat;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import es.dmoral.toasty.Toasty;
|
import es.dmoral.toasty.Toasty;
|
||||||
|
|
||||||
|
|
||||||
|
@ -54,12 +49,9 @@ public class MainApplication extends MultiDexApplication {
|
||||||
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(MainApplication.this);
|
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(MainApplication.this);
|
||||||
|
|
||||||
|
|
||||||
Cyanea.init(this, super.getResources());
|
|
||||||
List<CyaneaTheme> list = CyaneaTheme.Companion.from(getAssets(), "themes/cyanea_themes.json");
|
|
||||||
boolean custom_theme = sharedpreferences.getBoolean("use_custom_theme", false);
|
boolean custom_theme = sharedpreferences.getBoolean("use_custom_theme", false);
|
||||||
boolean no_theme_set = sharedpreferences.getBoolean("no_theme_set", true);
|
boolean no_theme_set = sharedpreferences.getBoolean("no_theme_set", true);
|
||||||
if (no_theme_set && !custom_theme) {
|
if (no_theme_set && !custom_theme) {
|
||||||
list.get(0).apply(Cyanea.getInstance());
|
|
||||||
SharedPreferences.Editor editor = sharedpreferences.edit();
|
SharedPreferences.Editor editor = sharedpreferences.edit();
|
||||||
editor.putBoolean("no_theme_set", false);
|
editor.putBoolean("no_theme_set", false);
|
||||||
editor.apply();
|
editor.apply();
|
||||||
|
@ -92,7 +84,6 @@ public class MainApplication extends MultiDexApplication {
|
||||||
.withResIcon(R.mipmap.ic_launcher)
|
.withResIcon(R.mipmap.ic_launcher)
|
||||||
.withText(getString(R.string.crash_title))
|
.withText(getString(R.string.crash_title))
|
||||||
.withCommentPrompt(getString(R.string.crash_message))
|
.withCommentPrompt(getString(R.string.crash_message))
|
||||||
.withResTheme(R.style.DialogDark)
|
|
||||||
.withPositiveButtonText(getString(R.string.send_email))
|
.withPositiveButtonText(getString(R.string.send_email))
|
||||||
.withNegativeButtonText(getString(R.string.cancel))
|
.withNegativeButtonText(getString(R.string.cancel))
|
||||||
.build()
|
.build()
|
||||||
|
|
|
@ -18,13 +18,11 @@ package app.fedilab.android.activities;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.PackageInfo;
|
import android.content.pm.PackageInfo;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.graphics.drawable.ColorDrawable;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
import androidx.core.app.ActivityOptionsCompat;
|
import androidx.core.app.ActivityOptionsCompat;
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -39,7 +37,6 @@ import app.fedilab.android.databinding.ActivityAboutBinding;
|
||||||
import app.fedilab.android.helper.CrossActionHelper;
|
import app.fedilab.android.helper.CrossActionHelper;
|
||||||
import app.fedilab.android.helper.Helper;
|
import app.fedilab.android.helper.Helper;
|
||||||
import app.fedilab.android.helper.MastodonHelper;
|
import app.fedilab.android.helper.MastodonHelper;
|
||||||
import app.fedilab.android.helper.ThemeHelper;
|
|
||||||
import app.fedilab.android.viewmodel.mastodon.AccountsVM;
|
import app.fedilab.android.viewmodel.mastodon.AccountsVM;
|
||||||
|
|
||||||
|
|
||||||
|
@ -52,13 +49,12 @@ public class AboutActivity extends BaseActivity {
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
ThemeHelper.applyThemeBar(this);
|
|
||||||
binding = ActivityAboutBinding.inflate(getLayoutInflater());
|
binding = ActivityAboutBinding.inflate(getLayoutInflater());
|
||||||
setContentView(binding.getRoot());
|
setContentView(binding.getRoot());
|
||||||
|
|
||||||
if (getSupportActionBar() != null) {
|
if (getSupportActionBar() != null) {
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -79,7 +75,6 @@ public class AboutActivity extends BaseActivity {
|
||||||
}
|
}
|
||||||
binding.aboutSupportPaypal.setOnClickListener(v -> Helper.openBrowser(AboutActivity.this, "https://www.paypal.me/Mastalab"));
|
binding.aboutSupportPaypal.setOnClickListener(v -> Helper.openBrowser(AboutActivity.this, "https://www.paypal.me/Mastalab"));
|
||||||
|
|
||||||
binding.accountFollow.setBackgroundTintList(ThemeHelper.getButtonActionColorStateList(AboutActivity.this));
|
|
||||||
if (BuildConfig.DONATIONS) {
|
if (BuildConfig.DONATIONS) {
|
||||||
binding.aboutSupportPaypal.setVisibility(View.VISIBLE);
|
binding.aboutSupportPaypal.setVisibility(View.VISIBLE);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -17,7 +17,6 @@ package app.fedilab.android.activities;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.graphics.PorterDuff;
|
import android.graphics.PorterDuff;
|
||||||
import android.graphics.drawable.ColorDrawable;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
@ -36,7 +35,6 @@ import app.fedilab.android.client.entities.api.admin.AdminAccount;
|
||||||
import app.fedilab.android.client.entities.api.admin.AdminReport;
|
import app.fedilab.android.client.entities.api.admin.AdminReport;
|
||||||
import app.fedilab.android.databinding.ActivityAdminReportBinding;
|
import app.fedilab.android.databinding.ActivityAdminReportBinding;
|
||||||
import app.fedilab.android.helper.Helper;
|
import app.fedilab.android.helper.Helper;
|
||||||
import app.fedilab.android.helper.ThemeHelper;
|
|
||||||
import app.fedilab.android.ui.drawer.StatusReportAdapter;
|
import app.fedilab.android.ui.drawer.StatusReportAdapter;
|
||||||
import app.fedilab.android.viewmodel.mastodon.AdminVM;
|
import app.fedilab.android.viewmodel.mastodon.AdminVM;
|
||||||
import es.dmoral.toasty.Toasty;
|
import es.dmoral.toasty.Toasty;
|
||||||
|
@ -52,13 +50,12 @@ public class AccountReportActivity extends BaseActivity {
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
ThemeHelper.applyThemeBar(this);
|
|
||||||
binding = ActivityAdminReportBinding.inflate(getLayoutInflater());
|
binding = ActivityAdminReportBinding.inflate(getLayoutInflater());
|
||||||
setContentView(binding.getRoot());
|
setContentView(binding.getRoot());
|
||||||
|
|
||||||
if (getSupportActionBar() != null) {
|
if (getSupportActionBar() != null) {
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
report = null;
|
report = null;
|
||||||
|
|
|
@ -14,12 +14,10 @@ package app.fedilab.android.activities;
|
||||||
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
|
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
|
||||||
* see <http://www.gnu.org/licenses>. */
|
* see <http://www.gnu.org/licenses>. */
|
||||||
|
|
||||||
import android.graphics.drawable.ColorDrawable;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.fragment.app.FragmentManager;
|
import androidx.fragment.app.FragmentManager;
|
||||||
import androidx.fragment.app.FragmentTransaction;
|
import androidx.fragment.app.FragmentTransaction;
|
||||||
|
|
||||||
|
@ -43,13 +41,12 @@ public class ActionActivity extends BaseActivity {
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
ThemeHelper.applyThemeBar(this);
|
|
||||||
binding = ActivityActionsBinding.inflate(getLayoutInflater());
|
binding = ActivityActionsBinding.inflate(getLayoutInflater());
|
||||||
setContentView(binding.getRoot());
|
setContentView(binding.getRoot());
|
||||||
|
|
||||||
if (getSupportActionBar() != null) {
|
if (getSupportActionBar() != null) {
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
|
||||||
}
|
}
|
||||||
canGoBack = false;
|
canGoBack = false;
|
||||||
binding.favourites.setOnClickListener(v -> displayTimeline(Timeline.TimeLineEnum.FAVOURITE_TIMELINE));
|
binding.favourites.setOnClickListener(v -> displayTimeline(Timeline.TimeLineEnum.FAVOURITE_TIMELINE));
|
||||||
|
|
|
@ -19,13 +19,11 @@ import static app.fedilab.android.BaseMainActivity.currentInstance;
|
||||||
import static app.fedilab.android.BaseMainActivity.emojis;
|
import static app.fedilab.android.BaseMainActivity.emojis;
|
||||||
|
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.graphics.drawable.ColorDrawable;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.TypedValue;
|
import android.util.TypedValue;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
|
|
||||||
import androidx.appcompat.app.ActionBar;
|
import androidx.appcompat.app.ActionBar;
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.preference.PreferenceManager;
|
import androidx.preference.PreferenceManager;
|
||||||
|
|
||||||
import app.fedilab.android.R;
|
import app.fedilab.android.R;
|
||||||
|
@ -33,7 +31,6 @@ import app.fedilab.android.client.entities.api.EmojiInstance;
|
||||||
import app.fedilab.android.databinding.ActivityAnnouncementBinding;
|
import app.fedilab.android.databinding.ActivityAnnouncementBinding;
|
||||||
import app.fedilab.android.exception.DBException;
|
import app.fedilab.android.exception.DBException;
|
||||||
import app.fedilab.android.helper.Helper;
|
import app.fedilab.android.helper.Helper;
|
||||||
import app.fedilab.android.helper.ThemeHelper;
|
|
||||||
import app.fedilab.android.ui.fragment.timeline.FragmentMastodonAnnouncement;
|
import app.fedilab.android.ui.fragment.timeline.FragmentMastodonAnnouncement;
|
||||||
|
|
||||||
|
|
||||||
|
@ -43,7 +40,7 @@ public class AnnouncementActivity extends BaseActivity {
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
ThemeHelper.applyTheme(this);
|
|
||||||
ActivityAnnouncementBinding binding = ActivityAnnouncementBinding.inflate(getLayoutInflater());
|
ActivityAnnouncementBinding binding = ActivityAnnouncementBinding.inflate(getLayoutInflater());
|
||||||
|
|
||||||
setContentView(binding.getRoot());
|
setContentView(binding.getRoot());
|
||||||
|
@ -53,7 +50,6 @@ public class AnnouncementActivity extends BaseActivity {
|
||||||
//Remove title
|
//Remove title
|
||||||
if (actionBar != null) {
|
if (actionBar != null) {
|
||||||
actionBar.setDisplayShowTitleEnabled(false);
|
actionBar.setDisplayShowTitleEnabled(false);
|
||||||
actionBar.setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
|
||||||
}
|
}
|
||||||
binding.title.setText(R.string.action_announcements);
|
binding.title.setText(R.string.action_announcements);
|
||||||
if (getSupportActionBar() != null) {
|
if (getSupportActionBar() != null) {
|
||||||
|
|
|
@ -19,8 +19,8 @@ import android.annotation.SuppressLint;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
import com.jaredrummler.cyanea.app.CyaneaAppCompatActivity;
|
|
||||||
import com.vanniktech.emoji.EmojiManager;
|
import com.vanniktech.emoji.EmojiManager;
|
||||||
import com.vanniktech.emoji.one.EmojiOneProvider;
|
import com.vanniktech.emoji.one.EmojiOneProvider;
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ import app.fedilab.android.helper.ThemeHelper;
|
||||||
|
|
||||||
|
|
||||||
@SuppressLint("Registered")
|
@SuppressLint("Registered")
|
||||||
public class BaseActivity extends CyaneaAppCompatActivity {
|
public class BaseActivity extends AppCompatActivity {
|
||||||
|
|
||||||
static {
|
static {
|
||||||
Helper.installProvider();
|
Helper.installProvider();
|
||||||
|
|
|
@ -16,7 +16,8 @@ package app.fedilab.android.activities;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
|
|
||||||
import com.jaredrummler.cyanea.app.CyaneaFragmentActivity;
|
import androidx.fragment.app.FragmentActivity;
|
||||||
|
|
||||||
import com.vanniktech.emoji.EmojiManager;
|
import com.vanniktech.emoji.EmojiManager;
|
||||||
import com.vanniktech.emoji.one.EmojiOneProvider;
|
import com.vanniktech.emoji.one.EmojiOneProvider;
|
||||||
|
|
||||||
|
@ -24,7 +25,7 @@ import app.fedilab.android.helper.Helper;
|
||||||
|
|
||||||
|
|
||||||
@SuppressLint("Registered")
|
@SuppressLint("Registered")
|
||||||
public class BaseFragmentActivity extends CyaneaFragmentActivity {
|
public class BaseFragmentActivity extends FragmentActivity {
|
||||||
|
|
||||||
|
|
||||||
static {
|
static {
|
||||||
|
|
|
@ -15,7 +15,6 @@ package app.fedilab.android.activities;
|
||||||
* see <http://www.gnu.org/licenses>. */
|
* see <http://www.gnu.org/licenses>. */
|
||||||
|
|
||||||
|
|
||||||
import android.graphics.drawable.ColorDrawable;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
|
@ -25,7 +24,6 @@ import android.view.MenuItem;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -42,7 +40,6 @@ import app.fedilab.android.databinding.ActivityCacheBinding;
|
||||||
import app.fedilab.android.exception.DBException;
|
import app.fedilab.android.exception.DBException;
|
||||||
import app.fedilab.android.helper.CacheHelper;
|
import app.fedilab.android.helper.CacheHelper;
|
||||||
import app.fedilab.android.helper.Helper;
|
import app.fedilab.android.helper.Helper;
|
||||||
import app.fedilab.android.helper.ThemeHelper;
|
|
||||||
import app.fedilab.android.ui.drawer.CacheAdapter;
|
import app.fedilab.android.ui.drawer.CacheAdapter;
|
||||||
|
|
||||||
public class CacheActivity extends BaseActivity {
|
public class CacheActivity extends BaseActivity {
|
||||||
|
@ -54,12 +51,11 @@ public class CacheActivity extends BaseActivity {
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
ThemeHelper.applyThemeBar(this);
|
|
||||||
binding = ActivityCacheBinding.inflate(getLayoutInflater());
|
binding = ActivityCacheBinding.inflate(getLayoutInflater());
|
||||||
setContentView(binding.getRoot());
|
setContentView(binding.getRoot());
|
||||||
if (getSupportActionBar() != null) {
|
if (getSupportActionBar() != null) {
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
|
||||||
}
|
}
|
||||||
CacheHelper.getCacheValues(CacheActivity.this, size -> {
|
CacheHelper.getCacheValues(CacheActivity.this, size -> {
|
||||||
if (size > 0) {
|
if (size > 0) {
|
||||||
|
@ -123,7 +119,7 @@ public class CacheActivity extends BaseActivity {
|
||||||
finish();
|
finish();
|
||||||
return true;
|
return true;
|
||||||
} else if (item.getItemId() == R.id.action_clear) {
|
} else if (item.getItemId() == R.id.action_clear) {
|
||||||
AlertDialog.Builder deleteConfirm = new AlertDialog.Builder(CacheActivity.this, Helper.dialogStyle());
|
AlertDialog.Builder deleteConfirm = new AlertDialog.Builder(CacheActivity.this);
|
||||||
deleteConfirm.setTitle(getString(R.string.delete_cache));
|
deleteConfirm.setTitle(getString(R.string.delete_cache));
|
||||||
deleteConfirm.setMessage(getString(R.string.delete_cache_message));
|
deleteConfirm.setMessage(getString(R.string.delete_cache_message));
|
||||||
deleteConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
|
deleteConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
|
||||||
|
@ -133,7 +129,7 @@ public class CacheActivity extends BaseActivity {
|
||||||
size = size / 1000000.0f;
|
size = size / 1000000.0f;
|
||||||
}
|
}
|
||||||
binding.fileCacheSize.setText(String.format("%s %s", String.format(Locale.getDefault(), "%.2f", size), getString(R.string.cache_units)));
|
binding.fileCacheSize.setText(String.format("%s %s", String.format(Locale.getDefault(), "%.2f", size), getString(R.string.cache_units)));
|
||||||
AlertDialog.Builder restartBuilder = new AlertDialog.Builder(CacheActivity.this, Helper.dialogStyle());
|
AlertDialog.Builder restartBuilder = new AlertDialog.Builder(CacheActivity.this);
|
||||||
restartBuilder.setMessage(getString(R.string.restart_the_app));
|
restartBuilder.setMessage(getString(R.string.restart_the_app));
|
||||||
restartBuilder.setNegativeButton(R.string.no, (dialogRestart, whichRestart) -> {
|
restartBuilder.setNegativeButton(R.string.no, (dialogRestart, whichRestart) -> {
|
||||||
recreate();
|
recreate();
|
||||||
|
|
|
@ -28,7 +28,6 @@ import android.content.Intent;
|
||||||
import android.content.IntentFilter;
|
import android.content.IntentFilter;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.graphics.drawable.ColorDrawable;
|
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
@ -86,7 +85,6 @@ import app.fedilab.android.helper.DividerDecorationSimple;
|
||||||
import app.fedilab.android.helper.Helper;
|
import app.fedilab.android.helper.Helper;
|
||||||
import app.fedilab.android.helper.MastodonHelper;
|
import app.fedilab.android.helper.MastodonHelper;
|
||||||
import app.fedilab.android.helper.MediaHelper;
|
import app.fedilab.android.helper.MediaHelper;
|
||||||
import app.fedilab.android.helper.ThemeHelper;
|
|
||||||
import app.fedilab.android.interfaces.OnDownloadInterface;
|
import app.fedilab.android.interfaces.OnDownloadInterface;
|
||||||
import app.fedilab.android.jobs.ComposeWorker;
|
import app.fedilab.android.jobs.ComposeWorker;
|
||||||
import app.fedilab.android.jobs.ScheduleThreadWorker;
|
import app.fedilab.android.jobs.ScheduleThreadWorker;
|
||||||
|
@ -216,7 +214,7 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana
|
||||||
}
|
}
|
||||||
if (canBeSent(statusDraft)) {
|
if (canBeSent(statusDraft)) {
|
||||||
if (promptSaveDraft) {
|
if (promptSaveDraft) {
|
||||||
AlertDialog.Builder alt_bld = new AlertDialog.Builder(ComposeActivity.this, Helper.dialogStyle());
|
AlertDialog.Builder alt_bld = new AlertDialog.Builder(ComposeActivity.this);
|
||||||
alt_bld.setMessage(R.string.save_draft);
|
alt_bld.setMessage(R.string.save_draft);
|
||||||
alt_bld.setPositiveButton(R.string.save, (dialog, id) -> {
|
alt_bld.setPositiveButton(R.string.save, (dialog, id) -> {
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
|
@ -317,7 +315,7 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana
|
||||||
} else if (item.getItemId() == R.id.action_photo_camera) {
|
} else if (item.getItemId() == R.id.action_photo_camera) {
|
||||||
photoFileUri = MediaHelper.dispatchTakePictureIntent(ComposeActivity.this);
|
photoFileUri = MediaHelper.dispatchTakePictureIntent(ComposeActivity.this);
|
||||||
} else if (item.getItemId() == R.id.action_contacts) {
|
} else if (item.getItemId() == R.id.action_contacts) {
|
||||||
AlertDialog.Builder builderSingle = new AlertDialog.Builder(ComposeActivity.this, Helper.dialogStyle());
|
AlertDialog.Builder builderSingle = new AlertDialog.Builder(ComposeActivity.this);
|
||||||
|
|
||||||
builderSingle.setTitle(getString(R.string.select_accounts));
|
builderSingle.setTitle(getString(R.string.select_accounts));
|
||||||
PopupContactBinding popupContactBinding = PopupContactBinding.inflate(getLayoutInflater(), new LinearLayout(ComposeActivity.this), false);
|
PopupContactBinding popupContactBinding = PopupContactBinding.inflate(getLayoutInflater(), new LinearLayout(ComposeActivity.this), false);
|
||||||
|
@ -444,7 +442,7 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
ThemeHelper.applyTheme(this);
|
|
||||||
binding = ActivityPaginationBinding.inflate(getLayoutInflater());
|
binding = ActivityPaginationBinding.inflate(getLayoutInflater());
|
||||||
setContentView(binding.getRoot());
|
setContentView(binding.getRoot());
|
||||||
setSupportActionBar(binding.toolbar);
|
setSupportActionBar(binding.toolbar);
|
||||||
|
@ -454,7 +452,6 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana
|
||||||
//Remove title
|
//Remove title
|
||||||
if (actionBar != null) {
|
if (actionBar != null) {
|
||||||
actionBar.setDisplayShowTitleEnabled(false);
|
actionBar.setDisplayShowTitleEnabled(false);
|
||||||
actionBar.setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
|
||||||
}
|
}
|
||||||
if (getSupportActionBar() != null) {
|
if (getSupportActionBar() != null) {
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
@ -500,7 +497,6 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana
|
||||||
if (sharedTitle != null && sharedSubject != null && sharedSubject.length() > sharedTitle.length()) {
|
if (sharedTitle != null && sharedSubject != null && sharedSubject.length() > sharedTitle.length()) {
|
||||||
sharedTitle = sharedSubject;
|
sharedTitle = sharedSubject;
|
||||||
}
|
}
|
||||||
binding.toolbar.setPopupTheme(Helper.popupStyle());
|
|
||||||
//Edit a scheduled status from server
|
//Edit a scheduled status from server
|
||||||
if (scheduledStatus != null) {
|
if (scheduledStatus != null) {
|
||||||
statusDraft = new StatusDraft();
|
statusDraft = new StatusDraft();
|
||||||
|
|
|
@ -20,7 +20,6 @@ import static app.fedilab.android.ui.drawer.StatusAdapter.sendAction;
|
||||||
|
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.graphics.drawable.ColorDrawable;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
|
@ -30,7 +29,6 @@ import android.view.MenuItem;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.appcompat.app.ActionBar;
|
import androidx.appcompat.app.ActionBar;
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
import androidx.preference.PreferenceManager;
|
import androidx.preference.PreferenceManager;
|
||||||
|
@ -43,7 +41,6 @@ import app.fedilab.android.databinding.ActivityConversationBinding;
|
||||||
import app.fedilab.android.exception.DBException;
|
import app.fedilab.android.exception.DBException;
|
||||||
import app.fedilab.android.helper.Helper;
|
import app.fedilab.android.helper.Helper;
|
||||||
import app.fedilab.android.helper.MastodonHelper;
|
import app.fedilab.android.helper.MastodonHelper;
|
||||||
import app.fedilab.android.helper.ThemeHelper;
|
|
||||||
import app.fedilab.android.ui.fragment.timeline.FragmentMastodonContext;
|
import app.fedilab.android.ui.fragment.timeline.FragmentMastodonContext;
|
||||||
import app.fedilab.android.viewmodel.mastodon.StatusesVM;
|
import app.fedilab.android.viewmodel.mastodon.StatusesVM;
|
||||||
|
|
||||||
|
@ -57,7 +54,7 @@ public class ContextActivity extends BaseActivity {
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
ThemeHelper.applyTheme(this);
|
|
||||||
app.fedilab.android.databinding.ActivityConversationBinding binding = ActivityConversationBinding.inflate(getLayoutInflater());
|
app.fedilab.android.databinding.ActivityConversationBinding binding = ActivityConversationBinding.inflate(getLayoutInflater());
|
||||||
setContentView(binding.getRoot());
|
setContentView(binding.getRoot());
|
||||||
setSupportActionBar(binding.toolbar);
|
setSupportActionBar(binding.toolbar);
|
||||||
|
@ -65,7 +62,6 @@ public class ContextActivity extends BaseActivity {
|
||||||
//Remove title
|
//Remove title
|
||||||
if (actionBar != null) {
|
if (actionBar != null) {
|
||||||
actionBar.setDisplayShowTitleEnabled(false);
|
actionBar.setDisplayShowTitleEnabled(false);
|
||||||
actionBar.setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
|
||||||
}
|
}
|
||||||
binding.title.setText(R.string.context_conversation);
|
binding.title.setText(R.string.context_conversation);
|
||||||
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(this);
|
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
@ -76,7 +72,6 @@ public class ContextActivity extends BaseActivity {
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
getSupportActionBar().setDisplayShowHomeEnabled(true);
|
getSupportActionBar().setDisplayShowHomeEnabled(true);
|
||||||
}
|
}
|
||||||
binding.toolbar.setPopupTheme(Helper.popupStyle());
|
|
||||||
Bundle b = getIntent().getExtras();
|
Bundle b = getIntent().getExtras();
|
||||||
displayCW = sharedpreferences.getBoolean(getString(R.string.SET_EXPAND_CW), false);
|
displayCW = sharedpreferences.getBoolean(getString(R.string.SET_EXPAND_CW), false);
|
||||||
Status focusedStatus = null; // or other values
|
Status focusedStatus = null; // or other values
|
||||||
|
|
|
@ -17,7 +17,6 @@ package app.fedilab.android.activities;
|
||||||
import static app.fedilab.android.BaseMainActivity.currentAccount;
|
import static app.fedilab.android.BaseMainActivity.currentAccount;
|
||||||
|
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.graphics.drawable.ColorDrawable;
|
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
@ -26,7 +25,6 @@ import android.text.TextUtils;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.preference.PreferenceManager;
|
import androidx.preference.PreferenceManager;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -39,7 +37,6 @@ import app.fedilab.android.client.entities.api.Status;
|
||||||
import app.fedilab.android.client.entities.api.Tag;
|
import app.fedilab.android.client.entities.api.Tag;
|
||||||
import app.fedilab.android.databinding.ActivityCustomSharingBinding;
|
import app.fedilab.android.databinding.ActivityCustomSharingBinding;
|
||||||
import app.fedilab.android.helper.Helper;
|
import app.fedilab.android.helper.Helper;
|
||||||
import app.fedilab.android.helper.ThemeHelper;
|
|
||||||
import app.fedilab.android.helper.customsharing.CustomSharingAsyncTask;
|
import app.fedilab.android.helper.customsharing.CustomSharingAsyncTask;
|
||||||
import app.fedilab.android.helper.customsharing.CustomSharingResponse;
|
import app.fedilab.android.helper.customsharing.CustomSharingResponse;
|
||||||
import app.fedilab.android.helper.customsharing.OnCustomSharingInterface;
|
import app.fedilab.android.helper.customsharing.OnCustomSharingInterface;
|
||||||
|
@ -66,14 +63,13 @@ public class CustomSharingActivity extends BaseActivity implements OnCustomShari
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
ThemeHelper.applyThemeBar(this);
|
|
||||||
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(CustomSharingActivity.this);
|
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(CustomSharingActivity.this);
|
||||||
binding = ActivityCustomSharingBinding.inflate(getLayoutInflater());
|
binding = ActivityCustomSharingBinding.inflate(getLayoutInflater());
|
||||||
setContentView(binding.getRoot());
|
setContentView(binding.getRoot());
|
||||||
if (getSupportActionBar() != null) {
|
if (getSupportActionBar() != null) {
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
getSupportActionBar().setDisplayShowHomeEnabled(true);
|
getSupportActionBar().setDisplayShowHomeEnabled(true);
|
||||||
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
|
||||||
}
|
}
|
||||||
Bundle b = getIntent().getExtras();
|
Bundle b = getIntent().getExtras();
|
||||||
status = null;
|
status = null;
|
||||||
|
|
|
@ -17,7 +17,6 @@ package app.fedilab.android.activities;
|
||||||
import static app.fedilab.android.BaseMainActivity.currentAccount;
|
import static app.fedilab.android.BaseMainActivity.currentAccount;
|
||||||
|
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.graphics.drawable.ColorDrawable;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
|
@ -30,7 +29,6 @@ import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.appcompat.app.ActionBar;
|
import androidx.appcompat.app.ActionBar;
|
||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
import androidx.preference.PreferenceManager;
|
import androidx.preference.PreferenceManager;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
@ -45,8 +43,6 @@ import app.fedilab.android.client.entities.api.Status;
|
||||||
import app.fedilab.android.client.entities.app.StatusDraft;
|
import app.fedilab.android.client.entities.app.StatusDraft;
|
||||||
import app.fedilab.android.databinding.ActivityDraftsBinding;
|
import app.fedilab.android.databinding.ActivityDraftsBinding;
|
||||||
import app.fedilab.android.exception.DBException;
|
import app.fedilab.android.exception.DBException;
|
||||||
import app.fedilab.android.helper.Helper;
|
|
||||||
import app.fedilab.android.helper.ThemeHelper;
|
|
||||||
import app.fedilab.android.ui.drawer.StatusDraftAdapter;
|
import app.fedilab.android.ui.drawer.StatusDraftAdapter;
|
||||||
import app.fedilab.android.viewmodel.mastodon.TimelinesVM;
|
import app.fedilab.android.viewmodel.mastodon.TimelinesVM;
|
||||||
|
|
||||||
|
@ -62,20 +58,16 @@ public class DraftActivity extends BaseActivity implements StatusDraftAdapter.Dr
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
ThemeHelper.applyTheme(this);
|
|
||||||
binding = ActivityDraftsBinding.inflate(getLayoutInflater());
|
binding = ActivityDraftsBinding.inflate(getLayoutInflater());
|
||||||
setContentView(binding.getRoot());
|
setContentView(binding.getRoot());
|
||||||
setSupportActionBar(binding.toolbar);
|
setSupportActionBar(binding.toolbar);
|
||||||
ActionBar actionBar = getSupportActionBar();
|
ActionBar actionBar = getSupportActionBar();
|
||||||
if (actionBar != null) {
|
|
||||||
actionBar.setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
|
||||||
}
|
|
||||||
|
|
||||||
//Remove title
|
//Remove title
|
||||||
if (actionBar != null) {
|
if (actionBar != null) {
|
||||||
actionBar.setDisplayShowTitleEnabled(false);
|
actionBar.setDisplayShowTitleEnabled(false);
|
||||||
}
|
}
|
||||||
binding.toolbar.setPopupTheme(Helper.popupStyle());
|
|
||||||
binding.title.setText(R.string.drafts);
|
binding.title.setText(R.string.drafts);
|
||||||
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(this);
|
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
float scale = sharedpreferences.getFloat(getString(R.string.SET_FONT_SCALE), 1.1f);
|
float scale = sharedpreferences.getFloat(getString(R.string.SET_FONT_SCALE), 1.1f);
|
||||||
|
@ -105,7 +97,7 @@ public class DraftActivity extends BaseActivity implements StatusDraftAdapter.Dr
|
||||||
finish();
|
finish();
|
||||||
return true;
|
return true;
|
||||||
} else if (item.getItemId() == R.id.action_delete) {
|
} else if (item.getItemId() == R.id.action_delete) {
|
||||||
AlertDialog.Builder unfollowConfirm = new AlertDialog.Builder(DraftActivity.this, Helper.dialogStyle());
|
AlertDialog.Builder unfollowConfirm = new AlertDialog.Builder(DraftActivity.this);
|
||||||
unfollowConfirm.setTitle(getString(R.string.delete_all));
|
unfollowConfirm.setTitle(getString(R.string.delete_all));
|
||||||
unfollowConfirm.setMessage(getString(R.string.remove_draft));
|
unfollowConfirm.setMessage(getString(R.string.remove_draft));
|
||||||
unfollowConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
|
unfollowConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
|
||||||
|
|
|
@ -18,7 +18,6 @@ import static app.fedilab.android.BaseMainActivity.currentAccount;
|
||||||
import static app.fedilab.android.BaseMainActivity.instanceInfo;
|
import static app.fedilab.android.BaseMainActivity.instanceInfo;
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.graphics.drawable.ColorDrawable;
|
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
@ -31,8 +30,6 @@ import android.view.View;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.core.graphics.drawable.DrawableCompat;
|
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||||
|
|
||||||
|
@ -52,7 +49,6 @@ import app.fedilab.android.databinding.ActivityEditProfileBinding;
|
||||||
import app.fedilab.android.exception.DBException;
|
import app.fedilab.android.exception.DBException;
|
||||||
import app.fedilab.android.helper.Helper;
|
import app.fedilab.android.helper.Helper;
|
||||||
import app.fedilab.android.helper.MastodonHelper;
|
import app.fedilab.android.helper.MastodonHelper;
|
||||||
import app.fedilab.android.helper.ThemeHelper;
|
|
||||||
import app.fedilab.android.viewmodel.mastodon.AccountsVM;
|
import app.fedilab.android.viewmodel.mastodon.AccountsVM;
|
||||||
import es.dmoral.toasty.Toasty;
|
import es.dmoral.toasty.Toasty;
|
||||||
|
|
||||||
|
@ -66,12 +62,11 @@ public class EditProfileActivity extends BaseActivity {
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
ThemeHelper.applyThemeBar(this);
|
|
||||||
binding = ActivityEditProfileBinding.inflate(getLayoutInflater());
|
binding = ActivityEditProfileBinding.inflate(getLayoutInflater());
|
||||||
setContentView(binding.getRoot());
|
setContentView(binding.getRoot());
|
||||||
if (getSupportActionBar() != null) {
|
if (getSupportActionBar() != null) {
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
new ViewModelProvider(EditProfileActivity.this).get(AccountsVM.class).getConnectedAccount(BaseMainActivity.currentInstance, BaseMainActivity.currentToken)
|
new ViewModelProvider(EditProfileActivity.this).get(AccountsVM.class).getConnectedAccount(BaseMainActivity.currentInstance, BaseMainActivity.currentToken)
|
||||||
|
@ -140,7 +135,7 @@ public class EditProfileActivity extends BaseActivity {
|
||||||
value = Html.fromHtml(field.value).toString();
|
value = Html.fromHtml(field.value).toString();
|
||||||
fieldItemBinding.value.setText(value);
|
fieldItemBinding.value.setText(value);
|
||||||
fieldItemBinding.remove.setOnClickListener(v -> {
|
fieldItemBinding.remove.setOnClickListener(v -> {
|
||||||
AlertDialog.Builder deleteConfirm = new AlertDialog.Builder(EditProfileActivity.this, Helper.dialogStyle());
|
AlertDialog.Builder deleteConfirm = new AlertDialog.Builder(EditProfileActivity.this);
|
||||||
deleteConfirm.setTitle(getString(R.string.delete_field));
|
deleteConfirm.setTitle(getString(R.string.delete_field));
|
||||||
deleteConfirm.setMessage(getString(R.string.delete_field_confirm));
|
deleteConfirm.setMessage(getString(R.string.delete_field_confirm));
|
||||||
deleteConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
|
deleteConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
|
||||||
|
@ -162,7 +157,7 @@ public class EditProfileActivity extends BaseActivity {
|
||||||
binding.addField.setOnClickListener(view -> {
|
binding.addField.setOnClickListener(view -> {
|
||||||
AccountFieldItemBinding fieldItemBinding = AccountFieldItemBinding.inflate(getLayoutInflater());
|
AccountFieldItemBinding fieldItemBinding = AccountFieldItemBinding.inflate(getLayoutInflater());
|
||||||
fieldItemBinding.remove.setOnClickListener(v -> {
|
fieldItemBinding.remove.setOnClickListener(v -> {
|
||||||
AlertDialog.Builder deleteConfirm = new AlertDialog.Builder(EditProfileActivity.this, Helper.dialogStyle());
|
AlertDialog.Builder deleteConfirm = new AlertDialog.Builder(EditProfileActivity.this);
|
||||||
deleteConfirm.setTitle(getString(R.string.delete_field));
|
deleteConfirm.setTitle(getString(R.string.delete_field));
|
||||||
deleteConfirm.setMessage(getString(R.string.delete_field_confirm));
|
deleteConfirm.setMessage(getString(R.string.delete_field_confirm));
|
||||||
deleteConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
|
deleteConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
|
||||||
|
@ -183,15 +178,6 @@ public class EditProfileActivity extends BaseActivity {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
ThemeHelper.changeColorOutlineButton(EditProfileActivity.this, binding.visibilityPublic);
|
|
||||||
ThemeHelper.changeColorOutlineButton(EditProfileActivity.this, binding.visibilityUnlisted);
|
|
||||||
ThemeHelper.changeColorOutlineButton(EditProfileActivity.this, binding.visibilityPrivate);
|
|
||||||
ThemeHelper.changeColorOutlineButton(EditProfileActivity.this, binding.visibilityDirect);
|
|
||||||
DrawableCompat.setTintList(DrawableCompat.wrap(binding.bot.getThumbDrawable()), ThemeHelper.getSwitchCompatThumbDrawable(EditProfileActivity.this));
|
|
||||||
DrawableCompat.setTintList(DrawableCompat.wrap(binding.discoverable.getThumbDrawable()), ThemeHelper.getSwitchCompatThumbDrawable(EditProfileActivity.this));
|
|
||||||
DrawableCompat.setTintList(DrawableCompat.wrap(binding.sensitive.getThumbDrawable()), ThemeHelper.getSwitchCompatThumbDrawable(EditProfileActivity.this));
|
|
||||||
ThemeHelper.changeColorOutlineButton(EditProfileActivity.this, binding.locked);
|
|
||||||
ThemeHelper.changeColorOutlineButton(EditProfileActivity.this, binding.unlocked);
|
|
||||||
|
|
||||||
//Actions with the activity
|
//Actions with the activity
|
||||||
accountsVM = new ViewModelProvider(EditProfileActivity.this).get(AccountsVM.class);
|
accountsVM = new ViewModelProvider(EditProfileActivity.this).get(AccountsVM.class);
|
||||||
|
|
|
@ -15,7 +15,6 @@ package app.fedilab.android.activities;
|
||||||
* see <http://www.gnu.org/licenses>. */
|
* see <http://www.gnu.org/licenses>. */
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.graphics.drawable.ColorDrawable;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
|
@ -28,7 +27,6 @@ import android.widget.Button;
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.lifecycle.LifecycleOwner;
|
import androidx.lifecycle.LifecycleOwner;
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
import androidx.lifecycle.ViewModelStoreOwner;
|
import androidx.lifecycle.ViewModelStoreOwner;
|
||||||
|
@ -43,8 +41,6 @@ import app.fedilab.android.R;
|
||||||
import app.fedilab.android.client.entities.api.Filter;
|
import app.fedilab.android.client.entities.api.Filter;
|
||||||
import app.fedilab.android.databinding.ActivityFiltersBinding;
|
import app.fedilab.android.databinding.ActivityFiltersBinding;
|
||||||
import app.fedilab.android.databinding.PopupAddFilterBinding;
|
import app.fedilab.android.databinding.PopupAddFilterBinding;
|
||||||
import app.fedilab.android.helper.Helper;
|
|
||||||
import app.fedilab.android.helper.ThemeHelper;
|
|
||||||
import app.fedilab.android.ui.drawer.FilterAdapter;
|
import app.fedilab.android.ui.drawer.FilterAdapter;
|
||||||
import app.fedilab.android.ui.drawer.KeywordAdapter;
|
import app.fedilab.android.ui.drawer.KeywordAdapter;
|
||||||
import app.fedilab.android.viewmodel.mastodon.FiltersVM;
|
import app.fedilab.android.viewmodel.mastodon.FiltersVM;
|
||||||
|
@ -63,7 +59,7 @@ public class FilterActivity extends BaseActivity implements FilterAdapter.Delete
|
||||||
* @param listener - {@link FilterAdapter.FilterAction}
|
* @param listener - {@link FilterAdapter.FilterAction}
|
||||||
*/
|
*/
|
||||||
public static void addEditFilter(Context context, Filter filter, FilterAdapter.FilterAction listener) {
|
public static void addEditFilter(Context context, Filter filter, FilterAdapter.FilterAction listener) {
|
||||||
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(context, Helper.dialogStyle());
|
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(context);
|
||||||
PopupAddFilterBinding popupAddFilterBinding = PopupAddFilterBinding.inflate(LayoutInflater.from(context));
|
PopupAddFilterBinding popupAddFilterBinding = PopupAddFilterBinding.inflate(LayoutInflater.from(context));
|
||||||
FiltersVM filtersVM = new ViewModelProvider((ViewModelStoreOwner) context).get(FiltersVM.class);
|
FiltersVM filtersVM = new ViewModelProvider((ViewModelStoreOwner) context).get(FiltersVM.class);
|
||||||
dialogBuilder.setView(popupAddFilterBinding.getRoot());
|
dialogBuilder.setView(popupAddFilterBinding.getRoot());
|
||||||
|
@ -250,13 +246,12 @@ public class FilterActivity extends BaseActivity implements FilterAdapter.Delete
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
ThemeHelper.applyThemeBar(this);
|
|
||||||
binding = ActivityFiltersBinding.inflate(getLayoutInflater());
|
binding = ActivityFiltersBinding.inflate(getLayoutInflater());
|
||||||
setContentView(binding.getRoot());
|
setContentView(binding.getRoot());
|
||||||
filterList = new ArrayList<>();
|
filterList = new ArrayList<>();
|
||||||
if (getSupportActionBar() != null) {
|
if (getSupportActionBar() != null) {
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FiltersVM filtersVM = new ViewModelProvider(FilterActivity.this).get(FiltersVM.class);
|
FiltersVM filtersVM = new ViewModelProvider(FilterActivity.this).get(FiltersVM.class);
|
||||||
|
|
|
@ -15,13 +15,11 @@ package app.fedilab.android.activities;
|
||||||
* see <http://www.gnu.org/licenses>. */
|
* see <http://www.gnu.org/licenses>. */
|
||||||
|
|
||||||
|
|
||||||
import android.graphics.drawable.ColorDrawable;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
@ -35,7 +33,6 @@ import app.fedilab.android.client.entities.api.Account;
|
||||||
import app.fedilab.android.client.entities.api.Accounts;
|
import app.fedilab.android.client.entities.api.Accounts;
|
||||||
import app.fedilab.android.databinding.ActivityStatusInfoBinding;
|
import app.fedilab.android.databinding.ActivityStatusInfoBinding;
|
||||||
import app.fedilab.android.helper.MastodonHelper;
|
import app.fedilab.android.helper.MastodonHelper;
|
||||||
import app.fedilab.android.helper.ThemeHelper;
|
|
||||||
import app.fedilab.android.ui.drawer.AccountFollowRequestAdapter;
|
import app.fedilab.android.ui.drawer.AccountFollowRequestAdapter;
|
||||||
import app.fedilab.android.viewmodel.mastodon.AccountsVM;
|
import app.fedilab.android.viewmodel.mastodon.AccountsVM;
|
||||||
|
|
||||||
|
@ -51,14 +48,13 @@ public class FollowRequestActivity extends BaseActivity {
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
ThemeHelper.applyTheme(this);
|
|
||||||
binding = ActivityStatusInfoBinding.inflate(getLayoutInflater());
|
binding = ActivityStatusInfoBinding.inflate(getLayoutInflater());
|
||||||
setContentView(binding.getRoot());
|
setContentView(binding.getRoot());
|
||||||
setSupportActionBar(binding.toolbar);
|
setSupportActionBar(binding.toolbar);
|
||||||
if (getSupportActionBar() != null) {
|
if (getSupportActionBar() != null) {
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
getSupportActionBar().setDisplayShowHomeEnabled(true);
|
getSupportActionBar().setDisplayShowHomeEnabled(true);
|
||||||
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
|
||||||
}
|
}
|
||||||
accountList = new ArrayList<>();
|
accountList = new ArrayList<>();
|
||||||
flagLoading = false;
|
flagLoading = false;
|
||||||
|
|
|
@ -15,7 +15,6 @@ package app.fedilab.android.activities;
|
||||||
* see <http://www.gnu.org/licenses>. */
|
* see <http://www.gnu.org/licenses>. */
|
||||||
|
|
||||||
|
|
||||||
import android.graphics.drawable.ColorDrawable;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.text.InputFilter;
|
import android.text.InputFilter;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
|
@ -24,7 +23,6 @@ import android.view.View;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.fragment.app.FragmentManager;
|
import androidx.fragment.app.FragmentManager;
|
||||||
import androidx.fragment.app.FragmentTransaction;
|
import androidx.fragment.app.FragmentTransaction;
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
|
@ -60,14 +58,13 @@ public class FollowedTagActivity extends BaseActivity implements FollowedTagAdap
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
ThemeHelper.applyThemeBar(this);
|
|
||||||
binding = ActivityFollowedTagsBinding.inflate(getLayoutInflater());
|
binding = ActivityFollowedTagsBinding.inflate(getLayoutInflater());
|
||||||
setContentView(binding.getRoot());
|
setContentView(binding.getRoot());
|
||||||
canGoBack = false;
|
canGoBack = false;
|
||||||
if (getSupportActionBar() != null) {
|
if (getSupportActionBar() != null) {
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
getSupportActionBar().setDisplayShowHomeEnabled(true);
|
getSupportActionBar().setDisplayShowHomeEnabled(true);
|
||||||
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
|
||||||
}
|
}
|
||||||
tagVM = new ViewModelProvider(FollowedTagActivity.this).get(TagVM.class);
|
tagVM = new ViewModelProvider(FollowedTagActivity.this).get(TagVM.class);
|
||||||
tagVM.followedTags(BaseMainActivity.currentInstance, BaseMainActivity.currentToken)
|
tagVM.followedTags(BaseMainActivity.currentInstance, BaseMainActivity.currentToken)
|
||||||
|
@ -91,7 +88,7 @@ public class FollowedTagActivity extends BaseActivity implements FollowedTagAdap
|
||||||
onBackPressed();
|
onBackPressed();
|
||||||
return true;
|
return true;
|
||||||
} else if (item.getItemId() == R.id.action_unfollow && tag != null) {
|
} else if (item.getItemId() == R.id.action_unfollow && tag != null) {
|
||||||
AlertDialog.Builder alt_bld = new AlertDialog.Builder(FollowedTagActivity.this, Helper.dialogStyle());
|
AlertDialog.Builder alt_bld = new AlertDialog.Builder(FollowedTagActivity.this);
|
||||||
alt_bld.setTitle(R.string.action_unfollow_tag);
|
alt_bld.setTitle(R.string.action_unfollow_tag);
|
||||||
alt_bld.setMessage(R.string.action_unfollow_tag_confirm);
|
alt_bld.setMessage(R.string.action_unfollow_tag_confirm);
|
||||||
alt_bld.setPositiveButton(R.string.unfollow, (dialog, id) -> {
|
alt_bld.setPositiveButton(R.string.unfollow, (dialog, id) -> {
|
||||||
|
@ -123,7 +120,7 @@ public class FollowedTagActivity extends BaseActivity implements FollowedTagAdap
|
||||||
AlertDialog alert = alt_bld.create();
|
AlertDialog alert = alt_bld.create();
|
||||||
alert.show();
|
alert.show();
|
||||||
} else if (item.getItemId() == R.id.action_follow_tag) {
|
} else if (item.getItemId() == R.id.action_follow_tag) {
|
||||||
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(FollowedTagActivity.this, Helper.dialogStyle());
|
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(FollowedTagActivity.this);
|
||||||
PopupAddFollowedTagtBinding popupAddFollowedTagtBinding = PopupAddFollowedTagtBinding.inflate(getLayoutInflater());
|
PopupAddFollowedTagtBinding popupAddFollowedTagtBinding = PopupAddFollowedTagtBinding.inflate(getLayoutInflater());
|
||||||
dialogBuilder.setView(popupAddFollowedTagtBinding.getRoot());
|
dialogBuilder.setView(popupAddFollowedTagtBinding.getRoot());
|
||||||
popupAddFollowedTagtBinding.addTag.setFilters(new InputFilter[]{new InputFilter.LengthFilter(255)});
|
popupAddFollowedTagtBinding.addTag.setFilters(new InputFilter[]{new InputFilter.LengthFilter(255)});
|
||||||
|
|
|
@ -18,7 +18,6 @@ package app.fedilab.android.activities;
|
||||||
import static app.fedilab.android.BaseMainActivity.currentAccount;
|
import static app.fedilab.android.BaseMainActivity.currentAccount;
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.graphics.drawable.ColorDrawable;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
|
@ -27,7 +26,6 @@ import android.view.MenuItem;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.appcompat.app.ActionBar;
|
import androidx.appcompat.app.ActionBar;
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||||
|
|
||||||
|
@ -46,7 +44,6 @@ import app.fedilab.android.client.entities.app.Timeline;
|
||||||
import app.fedilab.android.databinding.ActivityHashtagBinding;
|
import app.fedilab.android.databinding.ActivityHashtagBinding;
|
||||||
import app.fedilab.android.exception.DBException;
|
import app.fedilab.android.exception.DBException;
|
||||||
import app.fedilab.android.helper.Helper;
|
import app.fedilab.android.helper.Helper;
|
||||||
import app.fedilab.android.helper.ThemeHelper;
|
|
||||||
import app.fedilab.android.ui.fragment.timeline.FragmentMastodonTimeline;
|
import app.fedilab.android.ui.fragment.timeline.FragmentMastodonTimeline;
|
||||||
import app.fedilab.android.viewmodel.mastodon.FiltersVM;
|
import app.fedilab.android.viewmodel.mastodon.FiltersVM;
|
||||||
import app.fedilab.android.viewmodel.mastodon.ReorderVM;
|
import app.fedilab.android.viewmodel.mastodon.ReorderVM;
|
||||||
|
@ -68,7 +65,7 @@ public class HashTagActivity extends BaseActivity {
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
ThemeHelper.applyTheme(this);
|
|
||||||
ActivityHashtagBinding binding = ActivityHashtagBinding.inflate(getLayoutInflater());
|
ActivityHashtagBinding binding = ActivityHashtagBinding.inflate(getLayoutInflater());
|
||||||
|
|
||||||
setContentView(binding.getRoot());
|
setContentView(binding.getRoot());
|
||||||
|
@ -86,7 +83,6 @@ public class HashTagActivity extends BaseActivity {
|
||||||
//Remove title
|
//Remove title
|
||||||
if (actionBar != null) {
|
if (actionBar != null) {
|
||||||
actionBar.setDisplayShowTitleEnabled(false);
|
actionBar.setDisplayShowTitleEnabled(false);
|
||||||
actionBar.setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
|
||||||
}
|
}
|
||||||
binding.title.setText(tag);
|
binding.title.setText(tag);
|
||||||
if (getSupportActionBar() != null) {
|
if (getSupportActionBar() != null) {
|
||||||
|
@ -141,7 +137,6 @@ public class HashTagActivity extends BaseActivity {
|
||||||
bundle.putSerializable(Helper.ARG_TIMELINE_TYPE, Timeline.TimeLineEnum.TAG);
|
bundle.putSerializable(Helper.ARG_TIMELINE_TYPE, Timeline.TimeLineEnum.TAG);
|
||||||
bundle.putString(Helper.ARG_SEARCH_KEYWORD, tag);
|
bundle.putString(Helper.ARG_SEARCH_KEYWORD, tag);
|
||||||
Helper.addFragment(getSupportFragmentManager(), R.id.nav_host_fragment_tags, new FragmentMastodonTimeline(), bundle, null, null);
|
Helper.addFragment(getSupportFragmentManager(), R.id.nav_host_fragment_tags, new FragmentMastodonTimeline(), bundle, null, null);
|
||||||
binding.toolbar.setPopupTheme(Helper.popupStyle());
|
|
||||||
binding.compose.setOnClickListener(v -> {
|
binding.compose.setOnClickListener(v -> {
|
||||||
Intent intentToot = new Intent(HashTagActivity.this, ComposeActivity.class);
|
Intent intentToot = new Intent(HashTagActivity.this, ComposeActivity.class);
|
||||||
StatusDraft statusDraft = new StatusDraft();
|
StatusDraft statusDraft = new StatusDraft();
|
||||||
|
|
|
@ -45,7 +45,6 @@ import app.fedilab.android.R;
|
||||||
import app.fedilab.android.client.entities.api.Instance;
|
import app.fedilab.android.client.entities.api.Instance;
|
||||||
import app.fedilab.android.databinding.ActivityInstanceBinding;
|
import app.fedilab.android.databinding.ActivityInstanceBinding;
|
||||||
import app.fedilab.android.helper.Helper;
|
import app.fedilab.android.helper.Helper;
|
||||||
import app.fedilab.android.helper.ThemeHelper;
|
|
||||||
import app.fedilab.android.viewmodel.mastodon.InstancesVM;
|
import app.fedilab.android.viewmodel.mastodon.InstancesVM;
|
||||||
|
|
||||||
|
|
||||||
|
@ -58,7 +57,6 @@ public class InstanceActivity extends BaseActivity {
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
ThemeHelper.applyThemeDialog(this);
|
|
||||||
binding = ActivityInstanceBinding.inflate(getLayoutInflater());
|
binding = ActivityInstanceBinding.inflate(getLayoutInflater());
|
||||||
|
|
||||||
setContentView(binding.getRoot());
|
setContentView(binding.getRoot());
|
||||||
|
@ -71,13 +69,13 @@ public class InstanceActivity extends BaseActivity {
|
||||||
|
|
||||||
final SpannableString contentAbout = new SpannableString(getString(R.string.action_about_instance));
|
final SpannableString contentAbout = new SpannableString(getString(R.string.action_about_instance));
|
||||||
contentAbout.setSpan(new UnderlineSpan(), 0, contentAbout.length(), 0);
|
contentAbout.setSpan(new UnderlineSpan(), 0, contentAbout.length(), 0);
|
||||||
contentAbout.setSpan(new ForegroundColorSpan(ContextCompat.getColor(InstanceActivity.this, R.color.cyanea_accent_reference)), 0, contentAbout.length(),
|
contentAbout.setSpan(new ForegroundColorSpan(ContextCompat.getColor(InstanceActivity.this, R.color.colorAccent)), 0, contentAbout.length(),
|
||||||
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||||
binding.tos.setText(contentAbout);
|
binding.tos.setText(contentAbout);
|
||||||
|
|
||||||
final SpannableString contentPrivacy = new SpannableString(getString(R.string.action_privacy_policy));
|
final SpannableString contentPrivacy = new SpannableString(getString(R.string.action_privacy_policy));
|
||||||
contentPrivacy.setSpan(new UnderlineSpan(), 0, contentPrivacy.length(), 0);
|
contentPrivacy.setSpan(new UnderlineSpan(), 0, contentPrivacy.length(), 0);
|
||||||
contentPrivacy.setSpan(new ForegroundColorSpan(ContextCompat.getColor(InstanceActivity.this, R.color.cyanea_accent_reference)), 0, contentPrivacy.length(),
|
contentPrivacy.setSpan(new ForegroundColorSpan(ContextCompat.getColor(InstanceActivity.this, R.color.colorAccent)), 0, contentPrivacy.length(),
|
||||||
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||||
binding.privacy.setText(contentPrivacy);
|
binding.privacy.setText(contentPrivacy);
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,6 @@ import app.fedilab.android.R;
|
||||||
import app.fedilab.android.client.entities.app.InstanceSocial;
|
import app.fedilab.android.client.entities.app.InstanceSocial;
|
||||||
import app.fedilab.android.databinding.ActivityInstanceSocialBinding;
|
import app.fedilab.android.databinding.ActivityInstanceSocialBinding;
|
||||||
import app.fedilab.android.helper.Helper;
|
import app.fedilab.android.helper.Helper;
|
||||||
import app.fedilab.android.helper.ThemeHelper;
|
|
||||||
import app.fedilab.android.viewmodel.mastodon.InstanceSocialVM;
|
import app.fedilab.android.viewmodel.mastodon.InstanceSocialVM;
|
||||||
|
|
||||||
|
|
||||||
|
@ -45,7 +44,6 @@ public class InstanceHealthActivity extends BaseActivity {
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
ThemeHelper.applyThemeDialog(this);
|
|
||||||
binding = ActivityInstanceSocialBinding.inflate(getLayoutInflater());
|
binding = ActivityInstanceSocialBinding.inflate(getLayoutInflater());
|
||||||
|
|
||||||
setContentView(binding.getRoot());
|
setContentView(binding.getRoot());
|
||||||
|
|
|
@ -28,7 +28,6 @@ import androidx.lifecycle.ViewModelProvider;
|
||||||
import app.fedilab.android.R;
|
import app.fedilab.android.R;
|
||||||
import app.fedilab.android.databinding.ActivityInstanceProfileBinding;
|
import app.fedilab.android.databinding.ActivityInstanceProfileBinding;
|
||||||
import app.fedilab.android.helper.Helper;
|
import app.fedilab.android.helper.Helper;
|
||||||
import app.fedilab.android.helper.ThemeHelper;
|
|
||||||
import app.fedilab.android.viewmodel.mastodon.NodeInfoVM;
|
import app.fedilab.android.viewmodel.mastodon.NodeInfoVM;
|
||||||
import es.dmoral.toasty.Toasty;
|
import es.dmoral.toasty.Toasty;
|
||||||
|
|
||||||
|
@ -41,7 +40,7 @@ public class InstanceProfileActivity extends BaseActivity {
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
ThemeHelper.applyThemeDialog(this);
|
|
||||||
binding = ActivityInstanceProfileBinding.inflate(getLayoutInflater());
|
binding = ActivityInstanceProfileBinding.inflate(getLayoutInflater());
|
||||||
setContentView(binding.getRoot());
|
setContentView(binding.getRoot());
|
||||||
getWindow().setLayout(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
getWindow().setLayout(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||||
|
|
|
@ -35,7 +35,6 @@ import java.util.regex.Matcher;
|
||||||
import app.fedilab.android.R;
|
import app.fedilab.android.R;
|
||||||
import app.fedilab.android.client.entities.app.Account;
|
import app.fedilab.android.client.entities.app.Account;
|
||||||
import app.fedilab.android.helper.Helper;
|
import app.fedilab.android.helper.Helper;
|
||||||
import app.fedilab.android.helper.ThemeHelper;
|
|
||||||
import app.fedilab.android.ui.fragment.login.FragmentLoginMain;
|
import app.fedilab.android.ui.fragment.login.FragmentLoginMain;
|
||||||
import app.fedilab.android.viewmodel.mastodon.AccountsVM;
|
import app.fedilab.android.viewmodel.mastodon.AccountsVM;
|
||||||
import app.fedilab.android.viewmodel.mastodon.AdminVM;
|
import app.fedilab.android.viewmodel.mastodon.AdminVM;
|
||||||
|
@ -109,7 +108,7 @@ public class LoginActivity extends BaseActivity {
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
ThemeHelper.applyTheme(this);
|
|
||||||
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(LoginActivity.this);
|
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(LoginActivity.this);
|
||||||
setContentView(new FrameLayout(this));
|
setContentView(new FrameLayout(this));
|
||||||
FragmentLoginMain fragmentLoginMain = new FragmentLoginMain();
|
FragmentLoginMain fragmentLoginMain = new FragmentLoginMain();
|
||||||
|
|
|
@ -16,7 +16,6 @@ package app.fedilab.android.activities;
|
||||||
|
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.graphics.drawable.ColorDrawable;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.text.Editable;
|
import android.text.Editable;
|
||||||
import android.text.InputFilter;
|
import android.text.InputFilter;
|
||||||
|
@ -28,7 +27,6 @@ import android.view.View;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.fragment.app.FragmentManager;
|
import androidx.fragment.app.FragmentManager;
|
||||||
import androidx.fragment.app.FragmentTransaction;
|
import androidx.fragment.app.FragmentTransaction;
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
|
@ -82,14 +80,13 @@ public class MastodonListActivity extends BaseActivity implements MastodonListAd
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
ThemeHelper.applyThemeBar(this);
|
|
||||||
binding = ActivityListBinding.inflate(getLayoutInflater());
|
binding = ActivityListBinding.inflate(getLayoutInflater());
|
||||||
setContentView(binding.getRoot());
|
setContentView(binding.getRoot());
|
||||||
canGoBack = false;
|
canGoBack = false;
|
||||||
if (getSupportActionBar() != null) {
|
if (getSupportActionBar() != null) {
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
getSupportActionBar().setDisplayShowHomeEnabled(true);
|
getSupportActionBar().setDisplayShowHomeEnabled(true);
|
||||||
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
|
||||||
}
|
}
|
||||||
flagLoading = false;
|
flagLoading = false;
|
||||||
orderASC = true;
|
orderASC = true;
|
||||||
|
@ -147,7 +144,7 @@ public class MastodonListActivity extends BaseActivity implements MastodonListAd
|
||||||
onBackPressed();
|
onBackPressed();
|
||||||
return true;
|
return true;
|
||||||
} else if (item.getItemId() == R.id.action_manage_users) {
|
} else if (item.getItemId() == R.id.action_manage_users) {
|
||||||
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(MastodonListActivity.this, Helper.dialogStyle());
|
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(MastodonListActivity.this);
|
||||||
PopupManageAccountsListBinding popupManageAccountsListBinding = PopupManageAccountsListBinding.inflate(getLayoutInflater());
|
PopupManageAccountsListBinding popupManageAccountsListBinding = PopupManageAccountsListBinding.inflate(getLayoutInflater());
|
||||||
dialogBuilder.setView(popupManageAccountsListBinding.getRoot());
|
dialogBuilder.setView(popupManageAccountsListBinding.getRoot());
|
||||||
popupManageAccountsListBinding.loader.setVisibility(View.VISIBLE);
|
popupManageAccountsListBinding.loader.setVisibility(View.VISIBLE);
|
||||||
|
@ -244,7 +241,7 @@ public class MastodonListActivity extends BaseActivity implements MastodonListAd
|
||||||
dialogBuilder.setPositiveButton(R.string.close, (dialog, id) -> dialog.dismiss());
|
dialogBuilder.setPositiveButton(R.string.close, (dialog, id) -> dialog.dismiss());
|
||||||
dialogBuilder.create().show();
|
dialogBuilder.create().show();
|
||||||
} else if (item.getItemId() == R.id.action_delete && mastodonList != null) {
|
} else if (item.getItemId() == R.id.action_delete && mastodonList != null) {
|
||||||
AlertDialog.Builder alt_bld = new AlertDialog.Builder(MastodonListActivity.this, Helper.dialogStyle());
|
AlertDialog.Builder alt_bld = new AlertDialog.Builder(MastodonListActivity.this);
|
||||||
alt_bld.setTitle(R.string.action_lists_delete);
|
alt_bld.setTitle(R.string.action_lists_delete);
|
||||||
alt_bld.setMessage(R.string.action_lists_confirm_delete);
|
alt_bld.setMessage(R.string.action_lists_confirm_delete);
|
||||||
alt_bld.setPositiveButton(R.string.delete, (dialog, id) -> {
|
alt_bld.setPositiveButton(R.string.delete, (dialog, id) -> {
|
||||||
|
@ -282,7 +279,7 @@ public class MastodonListActivity extends BaseActivity implements MastodonListAd
|
||||||
AlertDialog alert = alt_bld.create();
|
AlertDialog alert = alt_bld.create();
|
||||||
alert.show();
|
alert.show();
|
||||||
} else if (item.getItemId() == R.id.action_add_list) {
|
} else if (item.getItemId() == R.id.action_add_list) {
|
||||||
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(MastodonListActivity.this, Helper.dialogStyle());
|
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(MastodonListActivity.this);
|
||||||
PopupAddListBinding popupAddListBinding = PopupAddListBinding.inflate(getLayoutInflater());
|
PopupAddListBinding popupAddListBinding = PopupAddListBinding.inflate(getLayoutInflater());
|
||||||
dialogBuilder.setView(popupAddListBinding.getRoot());
|
dialogBuilder.setView(popupAddListBinding.getRoot());
|
||||||
popupAddListBinding.addList.setFilters(new InputFilter[]{new InputFilter.LengthFilter(255)});
|
popupAddListBinding.addList.setFilters(new InputFilter[]{new InputFilter.LengthFilter(255)});
|
||||||
|
@ -322,7 +319,7 @@ public class MastodonListActivity extends BaseActivity implements MastodonListAd
|
||||||
dialogBuilder.setNegativeButton(R.string.cancel, (dialog, id) -> dialog.dismiss());
|
dialogBuilder.setNegativeButton(R.string.cancel, (dialog, id) -> dialog.dismiss());
|
||||||
dialogBuilder.create().show();
|
dialogBuilder.create().show();
|
||||||
} else if (item.getItemId() == R.id.action_edit) {
|
} else if (item.getItemId() == R.id.action_edit) {
|
||||||
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(MastodonListActivity.this, Helper.dialogStyle());
|
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(MastodonListActivity.this);
|
||||||
PopupAddListBinding popupAddListBinding = PopupAddListBinding.inflate(getLayoutInflater());
|
PopupAddListBinding popupAddListBinding = PopupAddListBinding.inflate(getLayoutInflater());
|
||||||
dialogBuilder.setView(popupAddListBinding.getRoot());
|
dialogBuilder.setView(popupAddListBinding.getRoot());
|
||||||
popupAddListBinding.addList.setFilters(new InputFilter[]{new InputFilter.LengthFilter(255)});
|
popupAddListBinding.addList.setFilters(new InputFilter[]{new InputFilter.LengthFilter(255)});
|
||||||
|
|
|
@ -24,7 +24,6 @@ import android.content.IntentFilter;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.graphics.Point;
|
import android.graphics.Point;
|
||||||
import android.graphics.drawable.ColorDrawable;
|
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
@ -64,7 +63,6 @@ import app.fedilab.android.client.entities.api.Status;
|
||||||
import app.fedilab.android.databinding.ActivityMediaPagerBinding;
|
import app.fedilab.android.databinding.ActivityMediaPagerBinding;
|
||||||
import app.fedilab.android.helper.Helper;
|
import app.fedilab.android.helper.Helper;
|
||||||
import app.fedilab.android.helper.MediaHelper;
|
import app.fedilab.android.helper.MediaHelper;
|
||||||
import app.fedilab.android.helper.ThemeHelper;
|
|
||||||
import app.fedilab.android.interfaces.OnDownloadInterface;
|
import app.fedilab.android.interfaces.OnDownloadInterface;
|
||||||
import app.fedilab.android.ui.fragment.media.FragmentMedia;
|
import app.fedilab.android.ui.fragment.media.FragmentMedia;
|
||||||
import es.dmoral.toasty.Toasty;
|
import es.dmoral.toasty.Toasty;
|
||||||
|
@ -114,7 +112,7 @@ public class MediaActivity extends BaseActivity implements OnDownloadInterface {
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
getWindow().requestFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
|
getWindow().requestFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
|
||||||
ThemeHelper.applyThemeBar(this);
|
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
ActivityCompat.postponeEnterTransition(MediaActivity.this);
|
ActivityCompat.postponeEnterTransition(MediaActivity.this);
|
||||||
binding = ActivityMediaPagerBinding.inflate(getLayoutInflater());
|
binding = ActivityMediaPagerBinding.inflate(getLayoutInflater());
|
||||||
|
@ -132,7 +130,6 @@ public class MediaActivity extends BaseActivity implements OnDownloadInterface {
|
||||||
if (getSupportActionBar() != null) {
|
if (getSupportActionBar() != null) {
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
getSupportActionBar().setDisplayShowHomeEnabled(true);
|
getSupportActionBar().setDisplayShowHomeEnabled(true);
|
||||||
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (attachments == null || attachments.size() == 0)
|
if (attachments == null || attachments.size() == 0)
|
||||||
|
|
|
@ -16,7 +16,6 @@ package app.fedilab.android.activities;
|
||||||
|
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.graphics.drawable.ColorDrawable;
|
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.text.method.LinkMovementMethod;
|
import android.text.method.LinkMovementMethod;
|
||||||
|
@ -25,7 +24,6 @@ import android.view.View;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.core.app.ActivityOptionsCompat;
|
import androidx.core.app.ActivityOptionsCompat;
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -49,13 +47,12 @@ public class PartnerShipActivity extends BaseActivity {
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
ThemeHelper.applyThemeBar(this);
|
|
||||||
ActivityPartnershipBinding binding = ActivityPartnershipBinding.inflate(getLayoutInflater());
|
ActivityPartnershipBinding binding = ActivityPartnershipBinding.inflate(getLayoutInflater());
|
||||||
setContentView(binding.getRoot());
|
setContentView(binding.getRoot());
|
||||||
|
|
||||||
if (getSupportActionBar() != null) {
|
if (getSupportActionBar() != null) {
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TextView about_partnership = findViewById(R.id.about_partnership);
|
TextView about_partnership = findViewById(R.id.about_partnership);
|
||||||
|
|
|
@ -25,7 +25,6 @@ import android.content.Intent;
|
||||||
import android.content.IntentFilter;
|
import android.content.IntentFilter;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.content.res.ColorStateList;
|
import android.content.res.ColorStateList;
|
||||||
import android.graphics.drawable.ColorDrawable;
|
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.text.SpannableString;
|
import android.text.SpannableString;
|
||||||
|
@ -135,7 +134,7 @@ public class ProfileActivity extends BaseActivity {
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
ThemeHelper.applyTheme(this);
|
|
||||||
binding = ActivityProfileBinding.inflate(getLayoutInflater());
|
binding = ActivityProfileBinding.inflate(getLayoutInflater());
|
||||||
setContentView(binding.getRoot());
|
setContentView(binding.getRoot());
|
||||||
setSupportActionBar(binding.toolbar);
|
setSupportActionBar(binding.toolbar);
|
||||||
|
@ -154,7 +153,6 @@ public class ProfileActivity extends BaseActivity {
|
||||||
//Remove title
|
//Remove title
|
||||||
if (actionBar != null) {
|
if (actionBar != null) {
|
||||||
actionBar.setDisplayShowTitleEnabled(false);
|
actionBar.setDisplayShowTitleEnabled(false);
|
||||||
actionBar.setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getSupportActionBar() != null) {
|
if (getSupportActionBar() != null) {
|
||||||
|
@ -164,7 +162,6 @@ public class ProfileActivity extends BaseActivity {
|
||||||
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(this);
|
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
float scale = sharedpreferences.getFloat(getString(R.string.SET_FONT_SCALE), 1.1f);
|
float scale = sharedpreferences.getFloat(getString(R.string.SET_FONT_SCALE), 1.1f);
|
||||||
binding.title.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18 * 1.1f / scale);
|
binding.title.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18 * 1.1f / scale);
|
||||||
binding.toolbar.setPopupTheme(Helper.popupStyle());
|
|
||||||
accountsVM = new ViewModelProvider(ProfileActivity.this).get(AccountsVM.class);
|
accountsVM = new ViewModelProvider(ProfileActivity.this).get(AccountsVM.class);
|
||||||
if (account != null) {
|
if (account != null) {
|
||||||
initializeView(account);
|
initializeView(account);
|
||||||
|
@ -263,8 +260,6 @@ public class ProfileActivity extends BaseActivity {
|
||||||
public void onTabReselected(TabLayout.Tab tab) {
|
public void onTabReselected(TabLayout.Tab tab) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
binding.accountTabLayout.setTabTextColors(ThemeHelper.getAttColor(ProfileActivity.this, R.attr.mTextColor), ContextCompat.getColor(ProfileActivity.this, R.color.cyanea_accent_dark_reference));
|
|
||||||
binding.accountTabLayout.setTabIconTint(ThemeHelper.getColorStateList(ProfileActivity.this));
|
|
||||||
boolean disableGif = sharedpreferences.getBoolean(getString(R.string.SET_DISABLE_GIF), false);
|
boolean disableGif = sharedpreferences.getBoolean(getString(R.string.SET_DISABLE_GIF), false);
|
||||||
String targetedUrl = disableGif ? account.avatar_static : account.avatar;
|
String targetedUrl = disableGif ? account.avatar_static : account.avatar;
|
||||||
Glide.with(ProfileActivity.this)
|
Glide.with(ProfileActivity.this)
|
||||||
|
@ -314,7 +309,7 @@ public class ProfileActivity extends BaseActivity {
|
||||||
|
|
||||||
final SpannableString content = new SpannableString(getString(R.string.disclaimer_full));
|
final SpannableString content = new SpannableString(getString(R.string.disclaimer_full));
|
||||||
content.setSpan(new UnderlineSpan(), 0, content.length(), 0);
|
content.setSpan(new UnderlineSpan(), 0, content.length(), 0);
|
||||||
content.setSpan(new ForegroundColorSpan(ContextCompat.getColor(ProfileActivity.this, R.color.cyanea_accent_reference)), 0, content.length(),
|
content.setSpan(new ForegroundColorSpan(ContextCompat.getColor(ProfileActivity.this, R.color.colorAccent)), 0, content.length(),
|
||||||
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||||
binding.warningMessage.setText(content);
|
binding.warningMessage.setText(content);
|
||||||
binding.warningMessage.setOnClickListener(view -> {
|
binding.warningMessage.setOnClickListener(view -> {
|
||||||
|
@ -427,7 +422,7 @@ public class ProfileActivity extends BaseActivity {
|
||||||
} else if (doAction == action.UNFOLLOW) {
|
} else if (doAction == action.UNFOLLOW) {
|
||||||
boolean confirm_unfollow = sharedpreferences.getBoolean(getString(R.string.SET_UNFOLLOW_VALIDATION), true);
|
boolean confirm_unfollow = sharedpreferences.getBoolean(getString(R.string.SET_UNFOLLOW_VALIDATION), true);
|
||||||
if (confirm_unfollow) {
|
if (confirm_unfollow) {
|
||||||
AlertDialog.Builder unfollowConfirm = new AlertDialog.Builder(ProfileActivity.this, Helper.dialogStyle());
|
AlertDialog.Builder unfollowConfirm = new AlertDialog.Builder(ProfileActivity.this);
|
||||||
unfollowConfirm.setTitle(getString(R.string.unfollow_confirm));
|
unfollowConfirm.setTitle(getString(R.string.unfollow_confirm));
|
||||||
unfollowConfirm.setMessage(account.acct);
|
unfollowConfirm.setMessage(account.acct);
|
||||||
unfollowConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
|
unfollowConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
|
||||||
|
@ -512,7 +507,7 @@ public class ProfileActivity extends BaseActivity {
|
||||||
//Recyclerview for identity proof has not been inflated yet
|
//Recyclerview for identity proof has not been inflated yet
|
||||||
if (identityProofsRecycler == null) {
|
if (identityProofsRecycler == null) {
|
||||||
identity_proofs_indicator.setOnClickListener(v -> {
|
identity_proofs_indicator.setOnClickListener(v -> {
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(ProfileActivity.this, Helper.dialogStyle());
|
AlertDialog.Builder builder = new AlertDialog.Builder(ProfileActivity.this);
|
||||||
identityProofsRecycler = new RecyclerView(ProfileActivity.this);
|
identityProofsRecycler = new RecyclerView(ProfileActivity.this);
|
||||||
LinearLayoutManager mLayoutManager = new LinearLayoutManager(ProfileActivity.this);
|
LinearLayoutManager mLayoutManager = new LinearLayoutManager(ProfileActivity.this);
|
||||||
identityProofsRecycler.setLayoutManager(mLayoutManager);
|
identityProofsRecycler.setLayoutManager(mLayoutManager);
|
||||||
|
@ -603,7 +598,7 @@ public class ProfileActivity extends BaseActivity {
|
||||||
binding.personalNote.setText(relationship.note);
|
binding.personalNote.setText(relationship.note);
|
||||||
}
|
}
|
||||||
binding.personalNote.setOnClickListener(view -> {
|
binding.personalNote.setOnClickListener(view -> {
|
||||||
AlertDialog.Builder builderInner = new AlertDialog.Builder(ProfileActivity.this, Helper.dialogStyle());
|
AlertDialog.Builder builderInner = new AlertDialog.Builder(ProfileActivity.this);
|
||||||
builderInner.setTitle(R.string.note_for_account);
|
builderInner.setTitle(R.string.note_for_account);
|
||||||
EditText input = new EditText(ProfileActivity.this);
|
EditText input = new EditText(ProfileActivity.this);
|
||||||
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
|
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
|
||||||
|
@ -778,7 +773,7 @@ public class ProfileActivity extends BaseActivity {
|
||||||
});
|
});
|
||||||
return true;
|
return true;
|
||||||
} else if (itemId == R.id.action_filter) {
|
} else if (itemId == R.id.action_filter) {
|
||||||
AlertDialog.Builder filterTagDialog = new AlertDialog.Builder(ProfileActivity.this, Helper.dialogStyle());
|
AlertDialog.Builder filterTagDialog = new AlertDialog.Builder(ProfileActivity.this);
|
||||||
Set<String> featuredTagsSet = sharedpreferences.getStringSet(getString(R.string.SET_FEATURED_TAGS), null);
|
Set<String> featuredTagsSet = sharedpreferences.getStringSet(getString(R.string.SET_FEATURED_TAGS), null);
|
||||||
List<String> tags = new ArrayList<>();
|
List<String> tags = new ArrayList<>();
|
||||||
if (featuredTagsSet != null) {
|
if (featuredTagsSet != null) {
|
||||||
|
@ -847,7 +842,7 @@ public class ProfileActivity extends BaseActivity {
|
||||||
}
|
}
|
||||||
accountsVM.getListContainingAccount(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, account.id)
|
accountsVM.getListContainingAccount(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, account.id)
|
||||||
.observe(ProfileActivity.this, mastodonListUserIs -> {
|
.observe(ProfileActivity.this, mastodonListUserIs -> {
|
||||||
AlertDialog.Builder builderSingle = new AlertDialog.Builder(ProfileActivity.this, Helper.dialogStyle());
|
AlertDialog.Builder builderSingle = new AlertDialog.Builder(ProfileActivity.this);
|
||||||
builderSingle.setTitle(getString(R.string.action_lists_add_to));
|
builderSingle.setTitle(getString(R.string.action_lists_add_to));
|
||||||
builderSingle.setPositiveButton(R.string.close, (dialog, which) -> dialog.dismiss());
|
builderSingle.setPositiveButton(R.string.close, (dialog, which) -> dialog.dismiss());
|
||||||
String[] listsId = new String[mastodonLists.size()];
|
String[] listsId = new String[mastodonLists.size()];
|
||||||
|
@ -935,7 +930,7 @@ public class ProfileActivity extends BaseActivity {
|
||||||
});
|
});
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
builderInner = new AlertDialog.Builder(ProfileActivity.this, Helper.dialogStyle());
|
builderInner = new AlertDialog.Builder(ProfileActivity.this);
|
||||||
builderInner.setTitle(stringArrayConf[0]);
|
builderInner.setTitle(stringArrayConf[0]);
|
||||||
|
|
||||||
builderInner.setNeutralButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
|
builderInner.setNeutralButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
|
||||||
|
@ -963,7 +958,7 @@ public class ProfileActivity extends BaseActivity {
|
||||||
});
|
});
|
||||||
return true;
|
return true;
|
||||||
} else if (itemId == R.id.action_report) {
|
} else if (itemId == R.id.action_report) {
|
||||||
AlertDialog.Builder builderInner = new AlertDialog.Builder(ProfileActivity.this, Helper.dialogStyle());
|
AlertDialog.Builder builderInner = new AlertDialog.Builder(ProfileActivity.this);
|
||||||
builderInner.setTitle(R.string.report_account);
|
builderInner.setTitle(R.string.report_account);
|
||||||
//Text for report
|
//Text for report
|
||||||
EditText input = new EditText(ProfileActivity.this);
|
EditText input = new EditText(ProfileActivity.this);
|
||||||
|
@ -983,7 +978,7 @@ public class ProfileActivity extends BaseActivity {
|
||||||
builderInner.show();
|
builderInner.show();
|
||||||
return true;
|
return true;
|
||||||
} else if (itemId == R.id.action_block) {
|
} else if (itemId == R.id.action_block) {
|
||||||
AlertDialog.Builder builderInner = new AlertDialog.Builder(ProfileActivity.this, Helper.dialogStyle());
|
AlertDialog.Builder builderInner = new AlertDialog.Builder(ProfileActivity.this);
|
||||||
if (relationship != null) {
|
if (relationship != null) {
|
||||||
if (relationship.blocking) {
|
if (relationship.blocking) {
|
||||||
builderInner.setTitle(stringArrayConf[5]);
|
builderInner.setTitle(stringArrayConf[5]);
|
||||||
|
@ -1023,7 +1018,7 @@ public class ProfileActivity extends BaseActivity {
|
||||||
});
|
});
|
||||||
builderInner.show();
|
builderInner.show();
|
||||||
} else if (itemId == R.id.action_block_instance) {
|
} else if (itemId == R.id.action_block_instance) {
|
||||||
AlertDialog.Builder builderInner = new AlertDialog.Builder(ProfileActivity.this, Helper.dialogStyle());
|
AlertDialog.Builder builderInner = new AlertDialog.Builder(ProfileActivity.this);
|
||||||
String domain = account.acct.split("@")[1];
|
String domain = account.acct.split("@")[1];
|
||||||
builderInner.setMessage(getString(R.string.block_domain_confirm_message, domain));
|
builderInner.setMessage(getString(R.string.block_domain_confirm_message, domain));
|
||||||
builderInner.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
|
builderInner.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
|
||||||
|
|
|
@ -20,7 +20,6 @@ import static app.fedilab.android.helper.PinnedTimelineHelper.sortPositionAsc;
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.graphics.drawable.ColorDrawable;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.text.Editable;
|
import android.text.Editable;
|
||||||
import android.text.TextWatcher;
|
import android.text.TextWatcher;
|
||||||
|
@ -34,7 +33,6 @@ import android.widget.Toast;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||||
import androidx.preference.PreferenceManager;
|
import androidx.preference.PreferenceManager;
|
||||||
|
@ -57,7 +55,6 @@ import app.fedilab.android.databinding.ActivityReorderTabsBinding;
|
||||||
import app.fedilab.android.databinding.PopupSearchInstanceBinding;
|
import app.fedilab.android.databinding.PopupSearchInstanceBinding;
|
||||||
import app.fedilab.android.exception.DBException;
|
import app.fedilab.android.exception.DBException;
|
||||||
import app.fedilab.android.helper.Helper;
|
import app.fedilab.android.helper.Helper;
|
||||||
import app.fedilab.android.helper.ThemeHelper;
|
|
||||||
import app.fedilab.android.helper.itemtouchhelper.OnStartDragListener;
|
import app.fedilab.android.helper.itemtouchhelper.OnStartDragListener;
|
||||||
import app.fedilab.android.helper.itemtouchhelper.SimpleItemTouchHelperCallback;
|
import app.fedilab.android.helper.itemtouchhelper.SimpleItemTouchHelperCallback;
|
||||||
import app.fedilab.android.ui.drawer.ReorderBottomMenuAdapter;
|
import app.fedilab.android.ui.drawer.ReorderBottomMenuAdapter;
|
||||||
|
@ -100,13 +97,12 @@ public class ReorderTimelinesActivity extends BaseActivity implements OnStartDra
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
ThemeHelper.applyThemeBar(this);
|
|
||||||
binding = ActivityReorderTabsBinding.inflate(getLayoutInflater());
|
binding = ActivityReorderTabsBinding.inflate(getLayoutInflater());
|
||||||
setContentView(binding.getRoot());
|
setContentView(binding.getRoot());
|
||||||
searchInstanceRunning = false;
|
searchInstanceRunning = false;
|
||||||
if (getSupportActionBar() != null) {
|
if (getSupportActionBar() != null) {
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(ReorderTimelinesActivity.this);
|
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(ReorderTimelinesActivity.this);
|
||||||
|
@ -174,7 +170,7 @@ public class ReorderTimelinesActivity extends BaseActivity implements OnStartDra
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addInstance() {
|
private void addInstance() {
|
||||||
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(ReorderTimelinesActivity.this, Helper.dialogStyle());
|
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(ReorderTimelinesActivity.this);
|
||||||
PopupSearchInstanceBinding popupSearchInstanceBinding = PopupSearchInstanceBinding.inflate(getLayoutInflater());
|
PopupSearchInstanceBinding popupSearchInstanceBinding = PopupSearchInstanceBinding.inflate(getLayoutInflater());
|
||||||
dialogBuilder.setView(popupSearchInstanceBinding.getRoot());
|
dialogBuilder.setView(popupSearchInstanceBinding.getRoot());
|
||||||
TextWatcher textWatcher = autoComplete(popupSearchInstanceBinding);
|
TextWatcher textWatcher = autoComplete(popupSearchInstanceBinding);
|
||||||
|
|
|
@ -14,7 +14,6 @@ package app.fedilab.android.activities;
|
||||||
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
|
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
|
||||||
* see <http://www.gnu.org/licenses>. */
|
* see <http://www.gnu.org/licenses>. */
|
||||||
|
|
||||||
import android.graphics.drawable.ColorDrawable;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
@ -22,7 +21,6 @@ import android.widget.RadioButton;
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.appcompat.widget.LinearLayoutCompat;
|
import androidx.appcompat.widget.LinearLayoutCompat;
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.fragment.app.FragmentManager;
|
import androidx.fragment.app.FragmentManager;
|
||||||
import androidx.fragment.app.FragmentTransaction;
|
import androidx.fragment.app.FragmentTransaction;
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
|
@ -39,7 +37,6 @@ import app.fedilab.android.client.entities.api.Status;
|
||||||
import app.fedilab.android.client.entities.app.Timeline;
|
import app.fedilab.android.client.entities.app.Timeline;
|
||||||
import app.fedilab.android.databinding.ActivityReportBinding;
|
import app.fedilab.android.databinding.ActivityReportBinding;
|
||||||
import app.fedilab.android.helper.Helper;
|
import app.fedilab.android.helper.Helper;
|
||||||
import app.fedilab.android.helper.ThemeHelper;
|
|
||||||
import app.fedilab.android.ui.drawer.RulesAdapter;
|
import app.fedilab.android.ui.drawer.RulesAdapter;
|
||||||
import app.fedilab.android.ui.fragment.timeline.FragmentMastodonTimeline;
|
import app.fedilab.android.ui.fragment.timeline.FragmentMastodonTimeline;
|
||||||
import app.fedilab.android.viewmodel.mastodon.AccountsVM;
|
import app.fedilab.android.viewmodel.mastodon.AccountsVM;
|
||||||
|
@ -64,14 +61,13 @@ public class ReportActivity extends BaseActivity {
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
ThemeHelper.applyThemeBar(this);
|
|
||||||
binding = ActivityReportBinding.inflate(getLayoutInflater());
|
binding = ActivityReportBinding.inflate(getLayoutInflater());
|
||||||
|
|
||||||
setContentView(binding.getRoot());
|
setContentView(binding.getRoot());
|
||||||
|
|
||||||
if (getSupportActionBar() != null) {
|
if (getSupportActionBar() != null) {
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Bundle b = getIntent().getExtras();
|
Bundle b = getIntent().getExtras();
|
||||||
|
|
|
@ -17,14 +17,12 @@ package app.fedilab.android.activities;
|
||||||
import static app.fedilab.android.BaseMainActivity.currentAccount;
|
import static app.fedilab.android.BaseMainActivity.currentAccount;
|
||||||
|
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.graphics.drawable.ColorDrawable;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.TypedValue;
|
import android.util.TypedValue;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.appcompat.app.ActionBar;
|
import androidx.appcompat.app.ActionBar;
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.preference.PreferenceManager;
|
import androidx.preference.PreferenceManager;
|
||||||
|
|
||||||
import com.google.android.material.tabs.TabLayout;
|
import com.google.android.material.tabs.TabLayout;
|
||||||
|
@ -32,7 +30,6 @@ import com.google.android.material.tabs.TabLayout;
|
||||||
import app.fedilab.android.R;
|
import app.fedilab.android.R;
|
||||||
import app.fedilab.android.databinding.ActivityScheduledBinding;
|
import app.fedilab.android.databinding.ActivityScheduledBinding;
|
||||||
import app.fedilab.android.helper.MastodonHelper;
|
import app.fedilab.android.helper.MastodonHelper;
|
||||||
import app.fedilab.android.helper.ThemeHelper;
|
|
||||||
import app.fedilab.android.ui.pageadapter.FedilabScheduledPageAdapter;
|
import app.fedilab.android.ui.pageadapter.FedilabScheduledPageAdapter;
|
||||||
|
|
||||||
public class ScheduledActivity extends BaseActivity {
|
public class ScheduledActivity extends BaseActivity {
|
||||||
|
@ -42,7 +39,7 @@ public class ScheduledActivity extends BaseActivity {
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
ThemeHelper.applyTheme(this);
|
|
||||||
binding = ActivityScheduledBinding.inflate(getLayoutInflater());
|
binding = ActivityScheduledBinding.inflate(getLayoutInflater());
|
||||||
setContentView(binding.getRoot());
|
setContentView(binding.getRoot());
|
||||||
setSupportActionBar(binding.toolbar);
|
setSupportActionBar(binding.toolbar);
|
||||||
|
@ -50,7 +47,6 @@ public class ScheduledActivity extends BaseActivity {
|
||||||
//Remove title
|
//Remove title
|
||||||
if (actionBar != null) {
|
if (actionBar != null) {
|
||||||
actionBar.setDisplayShowTitleEnabled(false);
|
actionBar.setDisplayShowTitleEnabled(false);
|
||||||
actionBar.setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
|
||||||
}
|
}
|
||||||
if (getSupportActionBar() != null) {
|
if (getSupportActionBar() != null) {
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
@ -68,8 +64,7 @@ public class ScheduledActivity extends BaseActivity {
|
||||||
binding.scheduleViewpager.setAdapter(new FedilabScheduledPageAdapter(getSupportFragmentManager()));
|
binding.scheduleViewpager.setAdapter(new FedilabScheduledPageAdapter(getSupportFragmentManager()));
|
||||||
binding.scheduleViewpager.setOffscreenPageLimit(3);
|
binding.scheduleViewpager.setOffscreenPageLimit(3);
|
||||||
binding.scheduleViewpager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(binding.scheduleTablayout));
|
binding.scheduleViewpager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(binding.scheduleTablayout));
|
||||||
binding.scheduleTablayout.setTabTextColors(ThemeHelper.getAttColor(ScheduledActivity.this, R.attr.mTextColor), ContextCompat.getColor(ScheduledActivity.this, R.color.cyanea_accent_dark_reference));
|
|
||||||
binding.scheduleTablayout.setTabIconTint(ThemeHelper.getColorStateList(ScheduledActivity.this));
|
|
||||||
|
|
||||||
binding.scheduleTablayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
|
binding.scheduleTablayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -16,7 +16,6 @@ package app.fedilab.android.activities;
|
||||||
|
|
||||||
import android.app.SearchManager;
|
import android.app.SearchManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.graphics.drawable.ColorDrawable;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuInflater;
|
import android.view.MenuInflater;
|
||||||
|
@ -27,7 +26,6 @@ import android.widget.Toast;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.appcompat.widget.SearchView;
|
import androidx.appcompat.widget.SearchView;
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.fragment.app.FragmentManager;
|
import androidx.fragment.app.FragmentManager;
|
||||||
import androidx.fragment.app.FragmentStatePagerAdapter;
|
import androidx.fragment.app.FragmentStatePagerAdapter;
|
||||||
|
@ -41,7 +39,6 @@ import org.jetbrains.annotations.NotNull;
|
||||||
import app.fedilab.android.R;
|
import app.fedilab.android.R;
|
||||||
import app.fedilab.android.databinding.ActivitySearchResultTabsBinding;
|
import app.fedilab.android.databinding.ActivitySearchResultTabsBinding;
|
||||||
import app.fedilab.android.helper.Helper;
|
import app.fedilab.android.helper.Helper;
|
||||||
import app.fedilab.android.helper.ThemeHelper;
|
|
||||||
import app.fedilab.android.ui.fragment.timeline.FragmentMastodonAccount;
|
import app.fedilab.android.ui.fragment.timeline.FragmentMastodonAccount;
|
||||||
import app.fedilab.android.ui.fragment.timeline.FragmentMastodonTag;
|
import app.fedilab.android.ui.fragment.timeline.FragmentMastodonTag;
|
||||||
import app.fedilab.android.ui.fragment.timeline.FragmentMastodonTimeline;
|
import app.fedilab.android.ui.fragment.timeline.FragmentMastodonTimeline;
|
||||||
|
@ -58,7 +55,7 @@ public class SearchResultTabActivity extends BaseActivity {
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
ThemeHelper.applyThemeBar(this);
|
|
||||||
binding = ActivitySearchResultTabsBinding.inflate(getLayoutInflater());
|
binding = ActivitySearchResultTabsBinding.inflate(getLayoutInflater());
|
||||||
setContentView(binding.getRoot());
|
setContentView(binding.getRoot());
|
||||||
|
|
||||||
|
@ -75,7 +72,6 @@ public class SearchResultTabActivity extends BaseActivity {
|
||||||
|
|
||||||
if (getSupportActionBar() != null) {
|
if (getSupportActionBar() != null) {
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
|
||||||
}
|
}
|
||||||
setTitle(search);
|
setTitle(search);
|
||||||
initial = binding.searchTabLayout.newTab();
|
initial = binding.searchTabLayout.newTab();
|
||||||
|
@ -83,8 +79,6 @@ public class SearchResultTabActivity extends BaseActivity {
|
||||||
binding.searchTabLayout.addTab(binding.searchTabLayout.newTab().setText(getString(R.string.accounts)));
|
binding.searchTabLayout.addTab(binding.searchTabLayout.newTab().setText(getString(R.string.accounts)));
|
||||||
binding.searchTabLayout.addTab(binding.searchTabLayout.newTab().setText(getString(R.string.toots)));
|
binding.searchTabLayout.addTab(binding.searchTabLayout.newTab().setText(getString(R.string.toots)));
|
||||||
binding.searchTabLayout.addTab(binding.searchTabLayout.newTab().setText(getString(R.string.action_cache)));
|
binding.searchTabLayout.addTab(binding.searchTabLayout.newTab().setText(getString(R.string.action_cache)));
|
||||||
binding.searchTabLayout.setTabTextColors(ThemeHelper.getAttColor(SearchResultTabActivity.this, R.attr.mTextColor), ContextCompat.getColor(SearchResultTabActivity.this, R.color.cyanea_accent_dark_reference));
|
|
||||||
binding.searchTabLayout.setTabIconTint(ThemeHelper.getColorStateList(SearchResultTabActivity.this));
|
|
||||||
binding.searchTabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
|
binding.searchTabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onTabSelected(TabLayout.Tab tab) {
|
public void onTabSelected(TabLayout.Tab tab) {
|
||||||
|
|
|
@ -16,24 +16,20 @@ package app.fedilab.android.activities
|
||||||
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.MenuItem
|
import android.view.MenuItem
|
||||||
import androidx.appcompat.app.AlertDialog
|
|
||||||
import androidx.navigation.findNavController
|
import androidx.navigation.findNavController
|
||||||
import androidx.navigation.ui.AppBarConfiguration
|
import androidx.navigation.ui.AppBarConfiguration
|
||||||
import androidx.navigation.ui.navigateUp
|
import androidx.navigation.ui.navigateUp
|
||||||
import androidx.navigation.ui.setupActionBarWithNavController
|
import androidx.navigation.ui.setupActionBarWithNavController
|
||||||
import app.fedilab.android.R
|
import app.fedilab.android.R
|
||||||
import app.fedilab.android.databinding.ActivitySettingsBinding
|
import app.fedilab.android.databinding.ActivitySettingsBinding
|
||||||
import app.fedilab.android.helper.Helper
|
|
||||||
import app.fedilab.android.helper.ThemeHelper
|
|
||||||
import app.fedilab.android.ui.fragment.settings.FragmentThemingSettings
|
|
||||||
|
|
||||||
class SettingsActivity : BaseActivity(), FragmentThemingSettings.ActionTheming {
|
class SettingsActivity : BaseActivity() {
|
||||||
private lateinit var binding: ActivitySettingsBinding
|
private lateinit var binding: ActivitySettingsBinding
|
||||||
private lateinit var appBarConfiguration: AppBarConfiguration
|
private lateinit var appBarConfiguration: AppBarConfiguration
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
ThemeHelper.applyThemeBar(this)
|
|
||||||
|
|
||||||
binding = ActivitySettingsBinding.inflate(layoutInflater)
|
binding = ActivitySettingsBinding.inflate(layoutInflater)
|
||||||
setContentView(binding.root)
|
setContentView(binding.root)
|
||||||
|
@ -56,15 +52,4 @@ class SettingsActivity : BaseActivity(), FragmentThemingSettings.ActionTheming {
|
||||||
return super.onOptionsItemSelected(item)
|
return super.onOptionsItemSelected(item)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun restart() {
|
|
||||||
val restartBuilder = AlertDialog.Builder(this, Helper.dialogStyle())
|
|
||||||
restartBuilder.setTitle(getString(R.string.restart_the_app))
|
|
||||||
restartBuilder.setMessage(getString(R.string.restart_the_app_theme))
|
|
||||||
restartBuilder.setNegativeButton(R.string.no) { dialog, which -> dialog.dismiss() }
|
|
||||||
restartBuilder.setPositiveButton(R.string.restart) { dialog, which ->
|
|
||||||
dialog.dismiss()
|
|
||||||
Helper.restart(this)
|
|
||||||
}
|
|
||||||
restartBuilder.create().show()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,18 +16,15 @@ package app.fedilab.android.activities;
|
||||||
|
|
||||||
|
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.graphics.drawable.ColorDrawable;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
|
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
|
||||||
import app.fedilab.android.R;
|
import app.fedilab.android.R;
|
||||||
import app.fedilab.android.databinding.ActivityStatusHistoryBinding;
|
import app.fedilab.android.databinding.ActivityStatusHistoryBinding;
|
||||||
import app.fedilab.android.helper.Helper;
|
import app.fedilab.android.helper.Helper;
|
||||||
import app.fedilab.android.helper.ThemeHelper;
|
|
||||||
import app.fedilab.android.ui.drawer.StatusHistoryAdapter;
|
import app.fedilab.android.ui.drawer.StatusHistoryAdapter;
|
||||||
import app.fedilab.android.viewmodel.mastodon.StatusesVM;
|
import app.fedilab.android.viewmodel.mastodon.StatusesVM;
|
||||||
import es.dmoral.toasty.Toasty;
|
import es.dmoral.toasty.Toasty;
|
||||||
|
@ -40,14 +37,13 @@ public class StatusHistoryActivity extends BaseActivity {
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
ThemeHelper.applyTheme(this);
|
|
||||||
ActivityStatusHistoryBinding binding = ActivityStatusHistoryBinding.inflate(getLayoutInflater());
|
ActivityStatusHistoryBinding binding = ActivityStatusHistoryBinding.inflate(getLayoutInflater());
|
||||||
setContentView(binding.getRoot());
|
setContentView(binding.getRoot());
|
||||||
|
|
||||||
|
|
||||||
if (getSupportActionBar() != null) {
|
if (getSupportActionBar() != null) {
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Bundle b = getIntent().getExtras();
|
Bundle b = getIntent().getExtras();
|
||||||
|
|
|
@ -15,13 +15,11 @@ package app.fedilab.android.activities;
|
||||||
* see <http://www.gnu.org/licenses>. */
|
* see <http://www.gnu.org/licenses>. */
|
||||||
|
|
||||||
|
|
||||||
import android.graphics.drawable.ColorDrawable;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
@ -37,7 +35,6 @@ import app.fedilab.android.client.entities.api.RelationShip;
|
||||||
import app.fedilab.android.client.entities.api.Status;
|
import app.fedilab.android.client.entities.api.Status;
|
||||||
import app.fedilab.android.databinding.ActivityStatusInfoBinding;
|
import app.fedilab.android.databinding.ActivityStatusInfoBinding;
|
||||||
import app.fedilab.android.helper.Helper;
|
import app.fedilab.android.helper.Helper;
|
||||||
import app.fedilab.android.helper.ThemeHelper;
|
|
||||||
import app.fedilab.android.ui.drawer.AccountAdapter;
|
import app.fedilab.android.ui.drawer.AccountAdapter;
|
||||||
import app.fedilab.android.viewmodel.mastodon.AccountsVM;
|
import app.fedilab.android.viewmodel.mastodon.AccountsVM;
|
||||||
import app.fedilab.android.viewmodel.mastodon.StatusesVM;
|
import app.fedilab.android.viewmodel.mastodon.StatusesVM;
|
||||||
|
@ -56,14 +53,13 @@ public class StatusInfoActivity extends BaseActivity {
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
ThemeHelper.applyTheme(this);
|
|
||||||
binding = ActivityStatusInfoBinding.inflate(getLayoutInflater());
|
binding = ActivityStatusInfoBinding.inflate(getLayoutInflater());
|
||||||
setContentView(binding.getRoot());
|
setContentView(binding.getRoot());
|
||||||
setSupportActionBar(binding.toolbar);
|
setSupportActionBar(binding.toolbar);
|
||||||
if (getSupportActionBar() != null) {
|
if (getSupportActionBar() != null) {
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
getSupportActionBar().setDisplayShowHomeEnabled(true);
|
getSupportActionBar().setDisplayShowHomeEnabled(true);
|
||||||
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
|
||||||
}
|
}
|
||||||
accountList = new ArrayList<>();
|
accountList = new ArrayList<>();
|
||||||
Bundle b = getIntent().getExtras();
|
Bundle b = getIntent().getExtras();
|
||||||
|
|
|
@ -14,18 +14,14 @@ package app.fedilab.android.activities;
|
||||||
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
|
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
|
||||||
* see <http://www.gnu.org/licenses>. */
|
* see <http://www.gnu.org/licenses>. */
|
||||||
|
|
||||||
import android.graphics.drawable.ColorDrawable;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
|
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import app.fedilab.android.R;
|
import app.fedilab.android.R;
|
||||||
import app.fedilab.android.databinding.ActivitySuggestionsBinding;
|
import app.fedilab.android.databinding.ActivitySuggestionsBinding;
|
||||||
import app.fedilab.android.helper.Helper;
|
import app.fedilab.android.helper.Helper;
|
||||||
import app.fedilab.android.helper.ThemeHelper;
|
|
||||||
import app.fedilab.android.ui.fragment.timeline.FragmentMastodonSuggestion;
|
import app.fedilab.android.ui.fragment.timeline.FragmentMastodonSuggestion;
|
||||||
|
|
||||||
|
|
||||||
|
@ -35,14 +31,13 @@ public class SuggestionActivity extends BaseActivity {
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
ThemeHelper.applyThemeBar(this);
|
|
||||||
ActivitySuggestionsBinding binding = ActivitySuggestionsBinding.inflate(getLayoutInflater());
|
ActivitySuggestionsBinding binding = ActivitySuggestionsBinding.inflate(getLayoutInflater());
|
||||||
setContentView(binding.getRoot());
|
setContentView(binding.getRoot());
|
||||||
|
|
||||||
|
|
||||||
if (getSupportActionBar() != null) {
|
if (getSupportActionBar() != null) {
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Helper.addFragment(getSupportFragmentManager(), R.id.nav_host_fragment_suggestions, new FragmentMastodonSuggestion(), null, null, null);
|
Helper.addFragment(getSupportFragmentManager(), R.id.nav_host_fragment_suggestions, new FragmentMastodonSuggestion(), null, null, null);
|
||||||
|
|
|
@ -14,13 +14,11 @@ package app.fedilab.android.activities;
|
||||||
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
|
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
|
||||||
* see <http://www.gnu.org/licenses>. */
|
* see <http://www.gnu.org/licenses>. */
|
||||||
|
|
||||||
import android.graphics.drawable.ColorDrawable;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.fragment.app.FragmentManager;
|
import androidx.fragment.app.FragmentManager;
|
||||||
import androidx.fragment.app.FragmentStatePagerAdapter;
|
import androidx.fragment.app.FragmentStatePagerAdapter;
|
||||||
|
@ -35,7 +33,6 @@ import app.fedilab.android.R;
|
||||||
import app.fedilab.android.client.entities.app.Timeline;
|
import app.fedilab.android.client.entities.app.Timeline;
|
||||||
import app.fedilab.android.databinding.ActivityTrendsBinding;
|
import app.fedilab.android.databinding.ActivityTrendsBinding;
|
||||||
import app.fedilab.android.helper.Helper;
|
import app.fedilab.android.helper.Helper;
|
||||||
import app.fedilab.android.helper.ThemeHelper;
|
|
||||||
import app.fedilab.android.ui.fragment.timeline.FragmentMastodonTag;
|
import app.fedilab.android.ui.fragment.timeline.FragmentMastodonTag;
|
||||||
import app.fedilab.android.ui.fragment.timeline.FragmentMastodonTimeline;
|
import app.fedilab.android.ui.fragment.timeline.FragmentMastodonTimeline;
|
||||||
|
|
||||||
|
@ -48,20 +45,17 @@ public class TrendsActivity extends BaseActivity {
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
ThemeHelper.applyThemeBar(this);
|
|
||||||
binding = ActivityTrendsBinding.inflate(getLayoutInflater());
|
binding = ActivityTrendsBinding.inflate(getLayoutInflater());
|
||||||
setContentView(binding.getRoot());
|
setContentView(binding.getRoot());
|
||||||
|
|
||||||
|
|
||||||
if (getSupportActionBar() != null) {
|
if (getSupportActionBar() != null) {
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.searchTabLayout.addTab(binding.searchTabLayout.newTab().setText(getString(R.string.tags)));
|
binding.searchTabLayout.addTab(binding.searchTabLayout.newTab().setText(getString(R.string.tags)));
|
||||||
binding.searchTabLayout.addTab(binding.searchTabLayout.newTab().setText(getString(R.string.toots)));
|
binding.searchTabLayout.addTab(binding.searchTabLayout.newTab().setText(getString(R.string.toots)));
|
||||||
binding.searchTabLayout.setTabTextColors(ThemeHelper.getAttColor(TrendsActivity.this, R.attr.mTextColor), ContextCompat.getColor(TrendsActivity.this, R.color.cyanea_accent_dark_reference));
|
|
||||||
binding.searchTabLayout.setTabIconTint(ThemeHelper.getColorStateList(TrendsActivity.this));
|
|
||||||
binding.searchTabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
|
binding.searchTabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onTabSelected(TabLayout.Tab tab) {
|
public void onTabSelected(TabLayout.Tab tab) {
|
||||||
|
|
|
@ -20,7 +20,6 @@ import android.annotation.SuppressLint;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.graphics.drawable.ColorDrawable;
|
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.graphics.drawable.LayerDrawable;
|
import android.graphics.drawable.LayerDrawable;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
|
@ -46,7 +45,6 @@ import app.fedilab.android.R;
|
||||||
import app.fedilab.android.databinding.ActivityWebviewBinding;
|
import app.fedilab.android.databinding.ActivityWebviewBinding;
|
||||||
import app.fedilab.android.helper.CountDrawable;
|
import app.fedilab.android.helper.CountDrawable;
|
||||||
import app.fedilab.android.helper.Helper;
|
import app.fedilab.android.helper.Helper;
|
||||||
import app.fedilab.android.helper.ThemeHelper;
|
|
||||||
import app.fedilab.android.webview.CustomWebview;
|
import app.fedilab.android.webview.CustomWebview;
|
||||||
import app.fedilab.android.webview.FedilabWebChromeClient;
|
import app.fedilab.android.webview.FedilabWebChromeClient;
|
||||||
import app.fedilab.android.webview.FedilabWebViewClient;
|
import app.fedilab.android.webview.FedilabWebViewClient;
|
||||||
|
@ -67,7 +65,7 @@ public class WebviewActivity extends BaseActivity {
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
ThemeHelper.applyTheme(this);
|
|
||||||
binding = ActivityWebviewBinding.inflate(getLayoutInflater());
|
binding = ActivityWebviewBinding.inflate(getLayoutInflater());
|
||||||
View view = binding.getRoot();
|
View view = binding.getRoot();
|
||||||
setContentView(view);
|
setContentView(view);
|
||||||
|
@ -80,7 +78,6 @@ public class WebviewActivity extends BaseActivity {
|
||||||
if (getSupportActionBar() != null) {
|
if (getSupportActionBar() != null) {
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
getSupportActionBar().setDisplayShowHomeEnabled(true);
|
getSupportActionBar().setDisplayShowHomeEnabled(true);
|
||||||
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
|
||||||
}
|
}
|
||||||
Bundle b = getIntent().getExtras();
|
Bundle b = getIntent().getExtras();
|
||||||
if (b != null) {
|
if (b != null) {
|
||||||
|
@ -193,7 +190,7 @@ public class WebviewActivity extends BaseActivity {
|
||||||
final ArrayAdapter<String> arrayAdapter = new ArrayAdapter<>(WebviewActivity.this, R.layout.domains_blocked);
|
final ArrayAdapter<String> arrayAdapter = new ArrayAdapter<>(WebviewActivity.this, R.layout.domains_blocked);
|
||||||
arrayAdapter.addAll(domains);
|
arrayAdapter.addAll(domains);
|
||||||
|
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(WebviewActivity.this, Helper.dialogStyle());
|
AlertDialog.Builder builder = new AlertDialog.Builder(WebviewActivity.this);
|
||||||
builder.setTitle(R.string.list_of_blocked_domains);
|
builder.setTitle(R.string.list_of_blocked_domains);
|
||||||
|
|
||||||
builder.setNegativeButton(R.string.close, (dialog, which) -> dialog.dismiss());
|
builder.setNegativeButton(R.string.close, (dialog, which) -> dialog.dismiss());
|
||||||
|
|
|
@ -57,7 +57,6 @@ import app.fedilab.android.client.entities.app.Account;
|
||||||
import app.fedilab.android.databinding.ActivityWebviewConnectBinding;
|
import app.fedilab.android.databinding.ActivityWebviewConnectBinding;
|
||||||
import app.fedilab.android.exception.DBException;
|
import app.fedilab.android.exception.DBException;
|
||||||
import app.fedilab.android.helper.Helper;
|
import app.fedilab.android.helper.Helper;
|
||||||
import app.fedilab.android.helper.ThemeHelper;
|
|
||||||
import app.fedilab.android.viewmodel.mastodon.AccountsVM;
|
import app.fedilab.android.viewmodel.mastodon.AccountsVM;
|
||||||
import app.fedilab.android.viewmodel.mastodon.AdminVM;
|
import app.fedilab.android.viewmodel.mastodon.AdminVM;
|
||||||
import app.fedilab.android.viewmodel.mastodon.OauthVM;
|
import app.fedilab.android.viewmodel.mastodon.OauthVM;
|
||||||
|
@ -119,7 +118,7 @@ public class WebviewConnectActivity extends BaseActivity {
|
||||||
@SuppressLint("SetJavaScriptEnabled")
|
@SuppressLint("SetJavaScriptEnabled")
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
ThemeHelper.applyTheme(this);
|
|
||||||
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(WebviewConnectActivity.this);
|
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(WebviewConnectActivity.this);
|
||||||
|
|
||||||
binding = ActivityWebviewConnectBinding.inflate(getLayoutInflater());
|
binding = ActivityWebviewConnectBinding.inflate(getLayoutInflater());
|
||||||
|
|
|
@ -19,7 +19,6 @@ import android.content.ClipData;
|
||||||
import android.content.ClipboardManager;
|
import android.content.ClipboardManager;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.graphics.drawable.ColorDrawable;
|
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.text.SpannableString;
|
import android.text.SpannableString;
|
||||||
|
@ -65,7 +64,6 @@ import app.fedilab.android.databinding.ActivityAdminAccountBinding;
|
||||||
import app.fedilab.android.helper.Helper;
|
import app.fedilab.android.helper.Helper;
|
||||||
import app.fedilab.android.helper.MastodonHelper;
|
import app.fedilab.android.helper.MastodonHelper;
|
||||||
import app.fedilab.android.helper.SpannableHelper;
|
import app.fedilab.android.helper.SpannableHelper;
|
||||||
import app.fedilab.android.helper.ThemeHelper;
|
|
||||||
import app.fedilab.android.viewmodel.mastodon.AdminVM;
|
import app.fedilab.android.viewmodel.mastodon.AdminVM;
|
||||||
import app.fedilab.android.viewmodel.mastodon.NodeInfoVM;
|
import app.fedilab.android.viewmodel.mastodon.NodeInfoVM;
|
||||||
import es.dmoral.toasty.Toasty;
|
import es.dmoral.toasty.Toasty;
|
||||||
|
@ -83,7 +81,7 @@ public class AdminAccountActivity extends BaseActivity {
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
ThemeHelper.applyTheme(this);
|
|
||||||
binding = ActivityAdminAccountBinding.inflate(getLayoutInflater());
|
binding = ActivityAdminAccountBinding.inflate(getLayoutInflater());
|
||||||
setContentView(binding.getRoot());
|
setContentView(binding.getRoot());
|
||||||
setSupportActionBar(binding.toolbar);
|
setSupportActionBar(binding.toolbar);
|
||||||
|
@ -99,7 +97,6 @@ public class AdminAccountActivity extends BaseActivity {
|
||||||
//Remove title
|
//Remove title
|
||||||
if (actionBar != null) {
|
if (actionBar != null) {
|
||||||
actionBar.setDisplayShowTitleEnabled(false);
|
actionBar.setDisplayShowTitleEnabled(false);
|
||||||
actionBar.setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
|
||||||
}
|
}
|
||||||
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(this);
|
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
float scale = sharedpreferences.getFloat(getString(R.string.SET_FONT_SCALE), 1.1f);
|
float scale = sharedpreferences.getFloat(getString(R.string.SET_FONT_SCALE), 1.1f);
|
||||||
|
@ -108,7 +105,6 @@ public class AdminAccountActivity extends BaseActivity {
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
getSupportActionBar().setDisplayShowHomeEnabled(true);
|
getSupportActionBar().setDisplayShowHomeEnabled(true);
|
||||||
}
|
}
|
||||||
binding.toolbar.setPopupTheme(Helper.popupStyle());
|
|
||||||
adminVM = new ViewModelProvider(AdminAccountActivity.this).get(AdminVM.class);
|
adminVM = new ViewModelProvider(AdminAccountActivity.this).get(AdminVM.class);
|
||||||
if (account_id != null) {
|
if (account_id != null) {
|
||||||
adminVM.getAccount(MainActivity.currentInstance, MainActivity.currentToken, account_id).observe(this, this::initializeView);
|
adminVM.getAccount(MainActivity.currentInstance, MainActivity.currentToken, account_id).observe(this, this::initializeView);
|
||||||
|
@ -295,7 +291,7 @@ public class AdminAccountActivity extends BaseActivity {
|
||||||
|
|
||||||
final SpannableString content = new SpannableString(getString(R.string.disclaimer_full));
|
final SpannableString content = new SpannableString(getString(R.string.disclaimer_full));
|
||||||
content.setSpan(new UnderlineSpan(), 0, content.length(), 0);
|
content.setSpan(new UnderlineSpan(), 0, content.length(), 0);
|
||||||
content.setSpan(new ForegroundColorSpan(ContextCompat.getColor(AdminAccountActivity.this, R.color.cyanea_accent_reference)), 0, content.length(),
|
content.setSpan(new ForegroundColorSpan(ContextCompat.getColor(AdminAccountActivity.this, R.color.colorAccent)), 0, content.length(),
|
||||||
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||||
|
|
||||||
//This account was moved to another one
|
//This account was moved to another one
|
||||||
|
|
|
@ -22,7 +22,6 @@ import android.content.BroadcastReceiver;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.IntentFilter;
|
import android.content.IntentFilter;
|
||||||
import android.graphics.drawable.ColorDrawable;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
|
@ -30,7 +29,6 @@ import android.view.MenuItem;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.fragment.app.FragmentManager;
|
import androidx.fragment.app.FragmentManager;
|
||||||
import androidx.fragment.app.FragmentTransaction;
|
import androidx.fragment.app.FragmentTransaction;
|
||||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||||
|
@ -81,13 +79,12 @@ public class AdminActionActivity extends BaseActivity {
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
ThemeHelper.applyThemeBar(this);
|
|
||||||
binding = ActivityAdminActionsBinding.inflate(getLayoutInflater());
|
binding = ActivityAdminActionsBinding.inflate(getLayoutInflater());
|
||||||
setContentView(binding.getRoot());
|
setContentView(binding.getRoot());
|
||||||
LocalBroadcastManager.getInstance(this).registerReceiver(mReceiver, new IntentFilter(Helper.BROADCAST_DATA));
|
LocalBroadcastManager.getInstance(this).registerReceiver(mReceiver, new IntentFilter(Helper.BROADCAST_DATA));
|
||||||
if (getSupportActionBar() != null) {
|
if (getSupportActionBar() != null) {
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
|
||||||
}
|
}
|
||||||
canGoBack = false;
|
canGoBack = false;
|
||||||
binding.reports.setOnClickListener(v -> displayTimeline(REPORT));
|
binding.reports.setOnClickListener(v -> displayTimeline(REPORT));
|
||||||
|
@ -167,7 +164,7 @@ public class AdminActionActivity extends BaseActivity {
|
||||||
return true;
|
return true;
|
||||||
} else if (item.getItemId() == R.id.action_filter) {
|
} else if (item.getItemId() == R.id.action_filter) {
|
||||||
if (getTitle().toString().equalsIgnoreCase(getString(R.string.accounts))) {
|
if (getTitle().toString().equalsIgnoreCase(getString(R.string.accounts))) {
|
||||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(AdminActionActivity.this, Helper.dialogStyle());
|
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(AdminActionActivity.this);
|
||||||
PopupAdminFilterAccountsBinding binding = PopupAdminFilterAccountsBinding.inflate(getLayoutInflater());
|
PopupAdminFilterAccountsBinding binding = PopupAdminFilterAccountsBinding.inflate(getLayoutInflater());
|
||||||
alertDialogBuilder.setView(binding.getRoot());
|
alertDialogBuilder.setView(binding.getRoot());
|
||||||
if (local != null && remote == null) {
|
if (local != null && remote == null) {
|
||||||
|
@ -261,7 +258,7 @@ public class AdminActionActivity extends BaseActivity {
|
||||||
AlertDialog alert = alertDialogBuilder.create();
|
AlertDialog alert = alertDialogBuilder.create();
|
||||||
alert.show();
|
alert.show();
|
||||||
} else {
|
} else {
|
||||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(AdminActionActivity.this, Helper.dialogStyle());
|
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(AdminActionActivity.this);
|
||||||
PopupAdminFilterReportsBinding binding = PopupAdminFilterReportsBinding.inflate(getLayoutInflater());
|
PopupAdminFilterReportsBinding binding = PopupAdminFilterReportsBinding.inflate(getLayoutInflater());
|
||||||
alertDialogBuilder.setView(binding.getRoot());
|
alertDialogBuilder.setView(binding.getRoot());
|
||||||
if (resolved == null) {
|
if (resolved == null) {
|
||||||
|
|
|
@ -18,7 +18,6 @@ package app.fedilab.android.activities.admin;
|
||||||
import static app.fedilab.android.helper.Helper.BROADCAST_DATA;
|
import static app.fedilab.android.helper.Helper.BROADCAST_DATA;
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.graphics.drawable.ColorDrawable;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
|
@ -28,7 +27,6 @@ import android.widget.ArrayAdapter;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||||
|
|
||||||
|
@ -38,7 +36,6 @@ import app.fedilab.android.activities.MainActivity;
|
||||||
import app.fedilab.android.client.entities.api.admin.AdminDomainBlock;
|
import app.fedilab.android.client.entities.api.admin.AdminDomainBlock;
|
||||||
import app.fedilab.android.databinding.ActivityAdminDomainblockBinding;
|
import app.fedilab.android.databinding.ActivityAdminDomainblockBinding;
|
||||||
import app.fedilab.android.helper.Helper;
|
import app.fedilab.android.helper.Helper;
|
||||||
import app.fedilab.android.helper.ThemeHelper;
|
|
||||||
import app.fedilab.android.viewmodel.mastodon.AdminVM;
|
import app.fedilab.android.viewmodel.mastodon.AdminVM;
|
||||||
import es.dmoral.toasty.Toasty;
|
import es.dmoral.toasty.Toasty;
|
||||||
|
|
||||||
|
@ -52,12 +49,11 @@ public class AdminDomainBlockActivity extends BaseActivity {
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
ThemeHelper.applyThemeBar(this);
|
|
||||||
ActivityAdminDomainblockBinding binding = ActivityAdminDomainblockBinding.inflate(getLayoutInflater());
|
ActivityAdminDomainblockBinding binding = ActivityAdminDomainblockBinding.inflate(getLayoutInflater());
|
||||||
setContentView(binding.getRoot());
|
setContentView(binding.getRoot());
|
||||||
if (getSupportActionBar() != null) {
|
if (getSupportActionBar() != null) {
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
|
||||||
}
|
}
|
||||||
Bundle b = getIntent().getExtras();
|
Bundle b = getIntent().getExtras();
|
||||||
if (b != null) {
|
if (b != null) {
|
||||||
|
@ -133,7 +129,7 @@ public class AdminDomainBlockActivity extends BaseActivity {
|
||||||
return true;
|
return true;
|
||||||
} else if (itemId == R.id.action_delete) {
|
} else if (itemId == R.id.action_delete) {
|
||||||
if (adminDomainBlock.id != null) {
|
if (adminDomainBlock.id != null) {
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(AdminDomainBlockActivity.this, Helper.dialogStyle());
|
AlertDialog.Builder builder = new AlertDialog.Builder(AdminDomainBlockActivity.this);
|
||||||
builder.setMessage(getString(R.string.unblock_domain_confirm, adminDomainBlock.domain));
|
builder.setMessage(getString(R.string.unblock_domain_confirm, adminDomainBlock.domain));
|
||||||
builder
|
builder
|
||||||
.setPositiveButton(R.string.unblock_domain, (dialog, which) -> {
|
.setPositiveButton(R.string.unblock_domain, (dialog, which) -> {
|
||||||
|
|
|
@ -19,7 +19,6 @@ import android.content.ClipData;
|
||||||
import android.content.ClipboardManager;
|
import android.content.ClipboardManager;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.graphics.drawable.ColorDrawable;
|
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.text.SpannableString;
|
import android.text.SpannableString;
|
||||||
|
@ -66,7 +65,6 @@ import app.fedilab.android.databinding.ActivityAdminAccountBinding;
|
||||||
import app.fedilab.android.helper.Helper;
|
import app.fedilab.android.helper.Helper;
|
||||||
import app.fedilab.android.helper.MastodonHelper;
|
import app.fedilab.android.helper.MastodonHelper;
|
||||||
import app.fedilab.android.helper.SpannableHelper;
|
import app.fedilab.android.helper.SpannableHelper;
|
||||||
import app.fedilab.android.helper.ThemeHelper;
|
|
||||||
import app.fedilab.android.viewmodel.mastodon.AdminVM;
|
import app.fedilab.android.viewmodel.mastodon.AdminVM;
|
||||||
import app.fedilab.android.viewmodel.mastodon.NodeInfoVM;
|
import app.fedilab.android.viewmodel.mastodon.NodeInfoVM;
|
||||||
import es.dmoral.toasty.Toasty;
|
import es.dmoral.toasty.Toasty;
|
||||||
|
@ -83,7 +81,7 @@ public class AdminReportActivity extends BaseActivity {
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
ThemeHelper.applyTheme(this);
|
|
||||||
binding = ActivityAdminAccountBinding.inflate(getLayoutInflater());
|
binding = ActivityAdminAccountBinding.inflate(getLayoutInflater());
|
||||||
setContentView(binding.getRoot());
|
setContentView(binding.getRoot());
|
||||||
setSupportActionBar(binding.toolbar);
|
setSupportActionBar(binding.toolbar);
|
||||||
|
@ -100,7 +98,6 @@ public class AdminReportActivity extends BaseActivity {
|
||||||
//Remove title
|
//Remove title
|
||||||
if (actionBar != null) {
|
if (actionBar != null) {
|
||||||
actionBar.setDisplayShowTitleEnabled(false);
|
actionBar.setDisplayShowTitleEnabled(false);
|
||||||
actionBar.setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
|
||||||
}
|
}
|
||||||
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(this);
|
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
float scale = sharedpreferences.getFloat(getString(R.string.SET_FONT_SCALE), 1.1f);
|
float scale = sharedpreferences.getFloat(getString(R.string.SET_FONT_SCALE), 1.1f);
|
||||||
|
@ -109,7 +106,6 @@ public class AdminReportActivity extends BaseActivity {
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
getSupportActionBar().setDisplayShowHomeEnabled(true);
|
getSupportActionBar().setDisplayShowHomeEnabled(true);
|
||||||
}
|
}
|
||||||
binding.toolbar.setPopupTheme(Helper.popupStyle());
|
|
||||||
if (account != null) {
|
if (account != null) {
|
||||||
initializeView(account);
|
initializeView(account);
|
||||||
} else {
|
} else {
|
||||||
|
@ -314,7 +310,7 @@ public class AdminReportActivity extends BaseActivity {
|
||||||
|
|
||||||
final SpannableString content = new SpannableString(getString(R.string.disclaimer_full));
|
final SpannableString content = new SpannableString(getString(R.string.disclaimer_full));
|
||||||
content.setSpan(new UnderlineSpan(), 0, content.length(), 0);
|
content.setSpan(new UnderlineSpan(), 0, content.length(), 0);
|
||||||
content.setSpan(new ForegroundColorSpan(ContextCompat.getColor(AdminReportActivity.this, R.color.cyanea_accent_reference)), 0, content.length(),
|
content.setSpan(new ForegroundColorSpan(ContextCompat.getColor(AdminReportActivity.this, R.color.colorAccent)), 0, content.length(),
|
||||||
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||||
|
|
||||||
//This account was moved to another one
|
//This account was moved to another one
|
||||||
|
|
|
@ -63,7 +63,7 @@ public class CirclesDrawingView extends View {
|
||||||
// Generate bitmap used for background
|
// Generate bitmap used for background
|
||||||
mCirclePaint = new Paint();
|
mCirclePaint = new Paint();
|
||||||
|
|
||||||
mCirclePaint.setColor(ResourcesCompat.getColor(getContext().getResources(), R.color.cyanea_accent, getContext().getTheme()));
|
mCirclePaint.setColor(ResourcesCompat.getColor(getContext().getResources(), R.color.colorAccent, getContext().getTheme()));
|
||||||
mCirclePaint.setStrokeWidth(10);
|
mCirclePaint.setStrokeWidth(10);
|
||||||
mCirclePaint.setStyle(Paint.Style.STROKE);
|
mCirclePaint.setStyle(Paint.Style.STROKE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,7 +81,7 @@ public class CrossActionHelper {
|
||||||
}
|
}
|
||||||
Handler mainHandler = new Handler(Looper.getMainLooper());
|
Handler mainHandler = new Handler(Looper.getMainLooper());
|
||||||
Runnable myRunnable = () -> {
|
Runnable myRunnable = () -> {
|
||||||
AlertDialog.Builder builderSingle = new AlertDialog.Builder(context, Helper.dialogStyle());
|
AlertDialog.Builder builderSingle = new AlertDialog.Builder(context);
|
||||||
builderSingle.setTitle(context.getString(R.string.choose_accounts));
|
builderSingle.setTitle(context.getString(R.string.choose_accounts));
|
||||||
final AccountsSearchAdapter accountsSearchAdapter = new AccountsSearchAdapter(context, accountList);
|
final AccountsSearchAdapter accountsSearchAdapter = new AccountsSearchAdapter(context, accountList);
|
||||||
final BaseAccount[] accountArray = new BaseAccount[accounts.size()];
|
final BaseAccount[] accountArray = new BaseAccount[accounts.size()];
|
||||||
|
@ -96,7 +96,7 @@ public class CrossActionHelper {
|
||||||
boolean confirmBoost = sharedpreferences.getBoolean(context.getString(R.string.SET_NOTIF_VALIDATION), true);
|
boolean confirmBoost = sharedpreferences.getBoolean(context.getString(R.string.SET_NOTIF_VALIDATION), true);
|
||||||
BaseAccount selectedAccount = accountArray[which];
|
BaseAccount selectedAccount = accountArray[which];
|
||||||
if ((actionType == TypeOfCrossAction.REBLOG_ACTION && confirmBoost) || (actionType == TypeOfCrossAction.FAVOURITE_ACTION && confirmFav)) {
|
if ((actionType == TypeOfCrossAction.REBLOG_ACTION && confirmBoost) || (actionType == TypeOfCrossAction.FAVOURITE_ACTION && confirmFav)) {
|
||||||
AlertDialog.Builder alt_bld = new AlertDialog.Builder(context, Helper.dialogStyle());
|
AlertDialog.Builder alt_bld = new AlertDialog.Builder(context);
|
||||||
if (actionType == TypeOfCrossAction.REBLOG_ACTION) {
|
if (actionType == TypeOfCrossAction.REBLOG_ACTION) {
|
||||||
alt_bld.setMessage(context.getString(R.string.reblog_add));
|
alt_bld.setMessage(context.getString(R.string.reblog_add));
|
||||||
} else {
|
} else {
|
||||||
|
@ -409,7 +409,7 @@ public class CrossActionHelper {
|
||||||
context.startActivity(intentToot);
|
context.startActivity(intentToot);
|
||||||
((BaseActivity) context).finish();
|
((BaseActivity) context).finish();
|
||||||
} else {
|
} else {
|
||||||
AlertDialog.Builder builderSingle = new AlertDialog.Builder(context, Helper.dialogStyle());
|
AlertDialog.Builder builderSingle = new AlertDialog.Builder(context);
|
||||||
builderSingle.setTitle(context.getString(R.string.choose_accounts));
|
builderSingle.setTitle(context.getString(R.string.choose_accounts));
|
||||||
final AccountsSearchAdapter accountsSearchAdapter = new AccountsSearchAdapter(context, accountList);
|
final AccountsSearchAdapter accountsSearchAdapter = new AccountsSearchAdapter(context, accountList);
|
||||||
final BaseAccount[] accountArray = new BaseAccount[accounts.size()];
|
final BaseAccount[] accountArray = new BaseAccount[accounts.size()];
|
||||||
|
|
|
@ -107,7 +107,6 @@ import com.google.gson.reflect.TypeToken;
|
||||||
import com.google.gson.stream.JsonReader;
|
import com.google.gson.stream.JsonReader;
|
||||||
import com.google.gson.stream.JsonToken;
|
import com.google.gson.stream.JsonToken;
|
||||||
import com.google.gson.stream.JsonWriter;
|
import com.google.gson.stream.JsonWriter;
|
||||||
import com.jaredrummler.cyanea.Cyanea;
|
|
||||||
|
|
||||||
import org.conscrypt.Conscrypt;
|
import org.conscrypt.Conscrypt;
|
||||||
|
|
||||||
|
@ -473,7 +472,7 @@ public class Helper {
|
||||||
* @param url String download url
|
* @param url String download url
|
||||||
*/
|
*/
|
||||||
public static void manageDownloads(final Context context, final String url) {
|
public static void manageDownloads(final Context context, final String url) {
|
||||||
final AlertDialog.Builder builder = new AlertDialog.Builder(context, Helper.dialogStyle());
|
final AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||||
final DownloadManager.Request request;
|
final DownloadManager.Request request;
|
||||||
try {
|
try {
|
||||||
request = new DownloadManager.Request(Uri.parse(url.trim()));
|
request = new DownloadManager.Request(Uri.parse(url.trim()));
|
||||||
|
@ -941,13 +940,6 @@ public class Helper {
|
||||||
return fragment;
|
return fragment;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int dialogStyle() {
|
|
||||||
return Cyanea.getInstance().isDark() ? R.style.DialogDark : R.style.Dialog;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int popupStyle() {
|
|
||||||
return Cyanea.getInstance().isDark() ? R.style.PopupDark : R.style.Popup;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load a media into a view
|
* Load a media into a view
|
||||||
|
@ -1832,7 +1824,7 @@ public class Helper {
|
||||||
is.close();
|
is.close();
|
||||||
String json = new String(buffer, StandardCharsets.UTF_8);
|
String json = new String(buffer, StandardCharsets.UTF_8);
|
||||||
Gson gson = new Gson();
|
Gson gson = new Gson();
|
||||||
AlertDialog.Builder dialogBuilderOptin = new AlertDialog.Builder(activity, Helper.dialogStyle());
|
AlertDialog.Builder dialogBuilderOptin = new AlertDialog.Builder(activity);
|
||||||
PopupReleaseNotesBinding binding = PopupReleaseNotesBinding.inflate(activity.getLayoutInflater());
|
PopupReleaseNotesBinding binding = PopupReleaseNotesBinding.inflate(activity.getLayoutInflater());
|
||||||
dialogBuilderOptin.setView(binding.getRoot());
|
dialogBuilderOptin.setView(binding.getRoot());
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -357,7 +357,7 @@ public class MastodonHelper {
|
||||||
* @param status {@link Status}
|
* @param status {@link Status}
|
||||||
*/
|
*/
|
||||||
public static void scheduleBoost(Context context, ScheduleType scheduleType, Status status, Account account, TimedMuted listener) {
|
public static void scheduleBoost(Context context, ScheduleType scheduleType, Status status, Account account, TimedMuted listener) {
|
||||||
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(context, Helper.dialogStyle());
|
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(context);
|
||||||
DatetimePickerBinding binding = DatetimePickerBinding.inflate(((Activity) context).getLayoutInflater());
|
DatetimePickerBinding binding = DatetimePickerBinding.inflate(((Activity) context).getLayoutInflater());
|
||||||
dialogBuilder.setView(binding.getRoot());
|
dialogBuilder.setView(binding.getRoot());
|
||||||
final AlertDialog alertDialogBoost = dialogBuilder.create();
|
final AlertDialog alertDialogBoost = dialogBuilder.create();
|
||||||
|
|
|
@ -293,7 +293,7 @@ public class MediaHelper {
|
||||||
AudioRecorder mAudioRecorder = AudioRecorder.getInstance();
|
AudioRecorder mAudioRecorder = AudioRecorder.getInstance();
|
||||||
File mAudioFile = new File(filePath);
|
File mAudioFile = new File(filePath);
|
||||||
PopupRecordBinding binding = PopupRecordBinding.inflate(activity.getLayoutInflater());
|
PopupRecordBinding binding = PopupRecordBinding.inflate(activity.getLayoutInflater());
|
||||||
AlertDialog.Builder audioPopup = new AlertDialog.Builder(activity, Helper.dialogStyle());
|
AlertDialog.Builder audioPopup = new AlertDialog.Builder(activity);
|
||||||
audioPopup.setView(binding.getRoot());
|
audioPopup.setView(binding.getRoot());
|
||||||
AlertDialog alert = audioPopup.create();
|
AlertDialog alert = audioPopup.create();
|
||||||
alert.show();
|
alert.show();
|
||||||
|
@ -341,7 +341,7 @@ public class MediaHelper {
|
||||||
* @param listener - OnSchedule
|
* @param listener - OnSchedule
|
||||||
*/
|
*/
|
||||||
public static void scheduleMessage(Activity activity, OnSchedule listener) {
|
public static void scheduleMessage(Activity activity, OnSchedule listener) {
|
||||||
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(activity, Helper.dialogStyle());
|
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(activity);
|
||||||
DatetimePickerBinding binding = DatetimePickerBinding.inflate(activity.getLayoutInflater());
|
DatetimePickerBinding binding = DatetimePickerBinding.inflate(activity.getLayoutInflater());
|
||||||
|
|
||||||
dialogBuilder.setView(binding.getRoot());
|
dialogBuilder.setView(binding.getRoot());
|
||||||
|
|
|
@ -28,7 +28,6 @@ import android.os.Bundle;
|
||||||
import android.text.Editable;
|
import android.text.Editable;
|
||||||
import android.text.TextWatcher;
|
import android.text.TextWatcher;
|
||||||
import android.util.TypedValue;
|
import android.util.TypedValue;
|
||||||
import android.view.ContextThemeWrapper;
|
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
|
@ -423,7 +422,7 @@ public class PinnedTimelineHelper {
|
||||||
Pinned finalPinned = pinned;
|
Pinned finalPinned = pinned;
|
||||||
int finalToRemove1 = toRemove;
|
int finalToRemove1 = toRemove;
|
||||||
activityMainBinding.moreTimelines.setOnClickListener(v -> {
|
activityMainBinding.moreTimelines.setOnClickListener(v -> {
|
||||||
PopupMenu popup = new PopupMenu(new ContextThemeWrapper(activity, Helper.popupStyle()), v);
|
PopupMenu popup = new PopupMenu(activity, v);
|
||||||
try {
|
try {
|
||||||
@SuppressLint("PrivateApi")
|
@SuppressLint("PrivateApi")
|
||||||
Method method = popup.getMenu().getClass().getDeclaredMethod("setOptionalIconsVisible", boolean.class);
|
Method method = popup.getMenu().getClass().getDeclaredMethod("setOptionalIconsVisible", boolean.class);
|
||||||
|
@ -615,7 +614,7 @@ public class PinnedTimelineHelper {
|
||||||
*/
|
*/
|
||||||
public static void defaultClick(BaseMainActivity activity, Timeline.TimeLineEnum timeLineEnum, View view, ActivityMainBinding activityMainBinding, int position) {
|
public static void defaultClick(BaseMainActivity activity, Timeline.TimeLineEnum timeLineEnum, View view, ActivityMainBinding activityMainBinding, int position) {
|
||||||
boolean showExtendedFilter = timeLineEnum == Timeline.TimeLineEnum.HOME;
|
boolean showExtendedFilter = timeLineEnum == Timeline.TimeLineEnum.HOME;
|
||||||
PopupMenu popup = new PopupMenu(new ContextThemeWrapper(activity, Helper.popupStyle()), view);
|
PopupMenu popup = new PopupMenu(activity, view);
|
||||||
popup.getMenuInflater()
|
popup.getMenuInflater()
|
||||||
.inflate(R.menu.option_filter_toots, popup.getMenu());
|
.inflate(R.menu.option_filter_toots, popup.getMenu());
|
||||||
Menu menu = popup.getMenu();
|
Menu menu = popup.getMenu();
|
||||||
|
@ -681,7 +680,7 @@ public class PinnedTimelineHelper {
|
||||||
itemShowReplies.setChecked(show_replies);
|
itemShowReplies.setChecked(show_replies);
|
||||||
editor.apply();
|
editor.apply();
|
||||||
} else if (itemId == R.id.action_filter) {
|
} else if (itemId == R.id.action_filter) {
|
||||||
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(activity, Helper.dialogStyle());
|
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(activity);
|
||||||
LayoutInflater inflater = activity.getLayoutInflater();
|
LayoutInflater inflater = activity.getLayoutInflater();
|
||||||
View dialogView = inflater.inflate(R.layout.popup_filter_regex, new LinearLayout(activity), false);
|
View dialogView = inflater.inflate(R.layout.popup_filter_regex, new LinearLayout(activity), false);
|
||||||
dialogBuilder.setView(dialogView);
|
dialogBuilder.setView(dialogView);
|
||||||
|
@ -770,7 +769,7 @@ public class PinnedTimelineHelper {
|
||||||
*/
|
*/
|
||||||
public static void tagClick(BaseMainActivity activity, Pinned pinned, View view, ActivityMainBinding activityMainBinding, int position, String slug) {
|
public static void tagClick(BaseMainActivity activity, Pinned pinned, View view, ActivityMainBinding activityMainBinding, int position, String slug) {
|
||||||
int toRemove = itemToRemoveInBottomMenu(activity);
|
int toRemove = itemToRemoveInBottomMenu(activity);
|
||||||
PopupMenu popup = new PopupMenu(new ContextThemeWrapper(activity, Helper.popupStyle()), view);
|
PopupMenu popup = new PopupMenu(activity, view);
|
||||||
int offSetPosition = position - (BOTTOM_TIMELINE_COUNT - toRemove);
|
int offSetPosition = position - (BOTTOM_TIMELINE_COUNT - toRemove);
|
||||||
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(activity);
|
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(activity);
|
||||||
boolean singleBar = sharedpreferences.getBoolean(activity.getString(R.string.SET_USE_SINGLE_TOPBAR), false);
|
boolean singleBar = sharedpreferences.getBoolean(activity.getString(R.string.SET_USE_SINGLE_TOPBAR), false);
|
||||||
|
@ -870,7 +869,7 @@ public class PinnedTimelineHelper {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
} else if (itemId == R.id.action_any) {
|
} else if (itemId == R.id.action_any) {
|
||||||
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(activity, Helper.dialogStyle());
|
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(activity);
|
||||||
LayoutInflater inflater = activity.getLayoutInflater();
|
LayoutInflater inflater = activity.getLayoutInflater();
|
||||||
View dialogView = inflater.inflate(R.layout.tags_any, new LinearLayout(activity), false);
|
View dialogView = inflater.inflate(R.layout.tags_any, new LinearLayout(activity), false);
|
||||||
dialogBuilder.setView(dialogView);
|
dialogBuilder.setView(dialogView);
|
||||||
|
@ -899,7 +898,7 @@ public class PinnedTimelineHelper {
|
||||||
LayoutInflater inflater;
|
LayoutInflater inflater;
|
||||||
View dialogView;
|
View dialogView;
|
||||||
AlertDialog alertDialog;
|
AlertDialog alertDialog;
|
||||||
dialogBuilder = new AlertDialog.Builder(activity, Helper.dialogStyle());
|
dialogBuilder = new AlertDialog.Builder(activity);
|
||||||
inflater = activity.getLayoutInflater();
|
inflater = activity.getLayoutInflater();
|
||||||
dialogView = inflater.inflate(R.layout.tags_all, new LinearLayout(activity), false);
|
dialogView = inflater.inflate(R.layout.tags_all, new LinearLayout(activity), false);
|
||||||
dialogBuilder.setView(dialogView);
|
dialogBuilder.setView(dialogView);
|
||||||
|
@ -928,7 +927,7 @@ public class PinnedTimelineHelper {
|
||||||
LayoutInflater inflater;
|
LayoutInflater inflater;
|
||||||
View dialogView;
|
View dialogView;
|
||||||
AlertDialog alertDialog;
|
AlertDialog alertDialog;
|
||||||
dialogBuilder = new AlertDialog.Builder(activity, Helper.dialogStyle());
|
dialogBuilder = new AlertDialog.Builder(activity);
|
||||||
inflater = activity.getLayoutInflater();
|
inflater = activity.getLayoutInflater();
|
||||||
dialogView = inflater.inflate(R.layout.tags_all, new LinearLayout(activity), false);
|
dialogView = inflater.inflate(R.layout.tags_all, new LinearLayout(activity), false);
|
||||||
dialogBuilder.setView(dialogView);
|
dialogBuilder.setView(dialogView);
|
||||||
|
@ -957,7 +956,7 @@ public class PinnedTimelineHelper {
|
||||||
LayoutInflater inflater;
|
LayoutInflater inflater;
|
||||||
View dialogView;
|
View dialogView;
|
||||||
AlertDialog alertDialog;
|
AlertDialog alertDialog;
|
||||||
dialogBuilder = new AlertDialog.Builder(activity, Helper.dialogStyle());
|
dialogBuilder = new AlertDialog.Builder(activity);
|
||||||
inflater = activity.getLayoutInflater();
|
inflater = activity.getLayoutInflater();
|
||||||
dialogView = inflater.inflate(R.layout.tags_name, new LinearLayout(activity), false);
|
dialogView = inflater.inflate(R.layout.tags_name, new LinearLayout(activity), false);
|
||||||
dialogBuilder.setView(dialogView);
|
dialogBuilder.setView(dialogView);
|
||||||
|
@ -997,7 +996,7 @@ public class PinnedTimelineHelper {
|
||||||
*/
|
*/
|
||||||
public static void instanceClick(BaseMainActivity activity, Pinned pinned, View view, ActivityMainBinding activityMainBinding, int position, String slug) {
|
public static void instanceClick(BaseMainActivity activity, Pinned pinned, View view, ActivityMainBinding activityMainBinding, int position, String slug) {
|
||||||
|
|
||||||
PopupMenu popup = new PopupMenu(new ContextThemeWrapper(activity, Helper.popupStyle()), view);
|
PopupMenu popup = new PopupMenu(activity, view);
|
||||||
int toRemove = itemToRemoveInBottomMenu(activity);
|
int toRemove = itemToRemoveInBottomMenu(activity);
|
||||||
int offSetPosition = position - (BOTTOM_TIMELINE_COUNT - toRemove);
|
int offSetPosition = position - (BOTTOM_TIMELINE_COUNT - toRemove);
|
||||||
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(activity);
|
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(activity);
|
||||||
|
@ -1145,7 +1144,7 @@ public class PinnedTimelineHelper {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
changes[0] = true;
|
changes[0] = true;
|
||||||
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(activity, Helper.dialogStyle());
|
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(activity);
|
||||||
LayoutInflater inflater = activity.getLayoutInflater();
|
LayoutInflater inflater = activity.getLayoutInflater();
|
||||||
View dialogView = inflater.inflate(R.layout.tags_instance, new LinearLayout(activity), false);
|
View dialogView = inflater.inflate(R.layout.tags_instance, new LinearLayout(activity), false);
|
||||||
dialogBuilder.setView(dialogView);
|
dialogBuilder.setView(dialogView);
|
||||||
|
@ -1229,7 +1228,7 @@ public class PinnedTimelineHelper {
|
||||||
if (remoteInstance == null)
|
if (remoteInstance == null)
|
||||||
return;
|
return;
|
||||||
String accounts = remoteInstance.host;
|
String accounts = remoteInstance.host;
|
||||||
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(activity, Helper.dialogStyle());
|
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(activity);
|
||||||
LayoutInflater inflater = activity.getLayoutInflater();
|
LayoutInflater inflater = activity.getLayoutInflater();
|
||||||
View dialogView = inflater.inflate(R.layout.tags_any, new LinearLayout(activity), false);
|
View dialogView = inflater.inflate(R.layout.tags_any, new LinearLayout(activity), false);
|
||||||
dialogBuilder.setView(dialogView);
|
dialogBuilder.setView(dialogView);
|
||||||
|
|
|
@ -57,7 +57,7 @@ public class PushHelper {
|
||||||
Runnable myRunnable = () -> {
|
Runnable myRunnable = () -> {
|
||||||
List<String> distributors = UnifiedPush.getDistributors(context, new ArrayList<>());
|
List<String> distributors = UnifiedPush.getDistributors(context, new ArrayList<>());
|
||||||
if (distributors.size() == 0) {
|
if (distributors.size() == 0) {
|
||||||
AlertDialog.Builder alert = new AlertDialog.Builder(context, Helper.dialogStyle());
|
AlertDialog.Builder alert = new AlertDialog.Builder(context);
|
||||||
alert.setTitle(R.string.no_distributors_found);
|
alert.setTitle(R.string.no_distributors_found);
|
||||||
final TextView message = new TextView(context);
|
final TextView message = new TextView(context);
|
||||||
String link = "https://fedilab.app/wiki/features/push-notifications/";
|
String link = "https://fedilab.app/wiki/features/push-notifications/";
|
||||||
|
@ -134,7 +134,7 @@ public class PushHelper {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
AlertDialog.Builder alert = new AlertDialog.Builder(context, Helper.dialogStyle());
|
AlertDialog.Builder alert = new AlertDialog.Builder(context);
|
||||||
alert.setTitle(R.string.select_distributors);
|
alert.setTitle(R.string.select_distributors);
|
||||||
String[] distributorsStr = distributors.toArray(new String[0]);
|
String[] distributorsStr = distributors.toArray(new String[0]);
|
||||||
alert.setSingleChoiceItems(distributorsStr, -1, (dialog, item) -> {
|
alert.setSingleChoiceItems(distributorsStr, -1, (dialog, item) -> {
|
||||||
|
|
|
@ -252,7 +252,7 @@ public class SpannableHelper {
|
||||||
@Override
|
@Override
|
||||||
public void onLongClick(View view) {
|
public void onLongClick(View view) {
|
||||||
Context mContext = view.getContext();
|
Context mContext = view.getContext();
|
||||||
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(mContext, Helper.dialogStyle());
|
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(mContext);
|
||||||
PopupLinksBinding popupLinksBinding = PopupLinksBinding.inflate(LayoutInflater.from(context));
|
PopupLinksBinding popupLinksBinding = PopupLinksBinding.inflate(LayoutInflater.from(context));
|
||||||
dialogBuilder.setView(popupLinksBinding.getRoot());
|
dialogBuilder.setView(popupLinksBinding.getRoot());
|
||||||
AlertDialog alertDialog = dialogBuilder.create();
|
AlertDialog alertDialog = dialogBuilder.create();
|
||||||
|
@ -270,7 +270,7 @@ public class SpannableHelper {
|
||||||
}
|
}
|
||||||
String finalURl1 = finalURl;
|
String finalURl1 = finalURl;
|
||||||
popupLinksBinding.displayFullLink.setOnClickListener(v -> {
|
popupLinksBinding.displayFullLink.setOnClickListener(v -> {
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(mContext, Helper.dialogStyle());
|
AlertDialog.Builder builder = new AlertDialog.Builder(mContext);
|
||||||
builder.setMessage(finalURl1);
|
builder.setMessage(finalURl1);
|
||||||
builder.setTitle(context.getString(R.string.display_full_link));
|
builder.setTitle(context.getString(R.string.display_full_link));
|
||||||
builder.setPositiveButton(R.string.close, (dialog, which) -> dialog.dismiss())
|
builder.setPositiveButton(R.string.close, (dialog, which) -> dialog.dismiss())
|
||||||
|
@ -347,7 +347,7 @@ public class SpannableHelper {
|
||||||
Handler mainHandler = new Handler(context.getMainLooper());
|
Handler mainHandler = new Handler(context.getMainLooper());
|
||||||
String finalRedirect = redirect;
|
String finalRedirect = redirect;
|
||||||
Runnable myRunnable = () -> {
|
Runnable myRunnable = () -> {
|
||||||
AlertDialog.Builder builder1 = new AlertDialog.Builder(view.getContext(), Helper.dialogStyle());
|
AlertDialog.Builder builder1 = new AlertDialog.Builder(view.getContext());
|
||||||
if (finalRedirect != null) {
|
if (finalRedirect != null) {
|
||||||
builder1.setMessage(context.getString(R.string.redirect_detected, finalURl1, finalRedirect));
|
builder1.setMessage(context.getString(R.string.redirect_detected, finalURl1, finalRedirect));
|
||||||
builder1.setNegativeButton(R.string.copy_link, (dialog, which) -> {
|
builder1.setNegativeButton(R.string.copy_link, (dialog, which) -> {
|
||||||
|
@ -488,7 +488,7 @@ public class SpannableHelper {
|
||||||
@Override
|
@Override
|
||||||
public void onLongClick(View view) {
|
public void onLongClick(View view) {
|
||||||
Context mContext = view.getContext();
|
Context mContext = view.getContext();
|
||||||
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(mContext, Helper.dialogStyle());
|
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(mContext);
|
||||||
PopupLinksBinding popupLinksBinding = PopupLinksBinding.inflate(LayoutInflater.from(context));
|
PopupLinksBinding popupLinksBinding = PopupLinksBinding.inflate(LayoutInflater.from(context));
|
||||||
dialogBuilder.setView(popupLinksBinding.getRoot());
|
dialogBuilder.setView(popupLinksBinding.getRoot());
|
||||||
AlertDialog alertDialog = dialogBuilder.create();
|
AlertDialog alertDialog = dialogBuilder.create();
|
||||||
|
@ -499,7 +499,7 @@ public class SpannableHelper {
|
||||||
}
|
}
|
||||||
String finalURl1 = finalURl;
|
String finalURl1 = finalURl;
|
||||||
popupLinksBinding.displayFullLink.setOnClickListener(v -> {
|
popupLinksBinding.displayFullLink.setOnClickListener(v -> {
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(mContext, Helper.dialogStyle());
|
AlertDialog.Builder builder = new AlertDialog.Builder(mContext);
|
||||||
builder.setMessage(finalURl1);
|
builder.setMessage(finalURl1);
|
||||||
builder.setTitle(context.getString(R.string.display_full_link));
|
builder.setTitle(context.getString(R.string.display_full_link));
|
||||||
builder.setPositiveButton(R.string.close, (dialog, which) -> dialog.dismiss())
|
builder.setPositiveButton(R.string.close, (dialog, which) -> dialog.dismiss())
|
||||||
|
@ -576,7 +576,7 @@ public class SpannableHelper {
|
||||||
Handler mainHandler = new Handler(context.getMainLooper());
|
Handler mainHandler = new Handler(context.getMainLooper());
|
||||||
String finalRedirect = redirect;
|
String finalRedirect = redirect;
|
||||||
Runnable myRunnable = () -> {
|
Runnable myRunnable = () -> {
|
||||||
AlertDialog.Builder builder1 = new AlertDialog.Builder(view.getContext(), Helper.dialogStyle());
|
AlertDialog.Builder builder1 = new AlertDialog.Builder(view.getContext());
|
||||||
if (finalRedirect != null) {
|
if (finalRedirect != null) {
|
||||||
builder1.setMessage(context.getString(R.string.redirect_detected, finalURl1, finalRedirect));
|
builder1.setMessage(context.getString(R.string.redirect_detected, finalURl1, finalRedirect));
|
||||||
builder1.setNegativeButton(R.string.copy_link, (dialog, which) -> {
|
builder1.setNegativeButton(R.string.copy_link, (dialog, which) -> {
|
||||||
|
@ -908,7 +908,7 @@ public class SpannableHelper {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(context, Helper.dialogStyle());
|
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||||
builder.setMessage(context.getString(R.string.mute_tag, tag));
|
builder.setMessage(context.getString(R.string.mute_tag, tag));
|
||||||
builder
|
builder
|
||||||
.setPositiveButton(R.string.yes, (dialog, which) -> {
|
.setPositiveButton(R.string.yes, (dialog, which) -> {
|
||||||
|
@ -977,7 +977,7 @@ public class SpannableHelper {
|
||||||
int end = spannable.getSpanEnd(quoteSpan);
|
int end = spannable.getSpanEnd(quoteSpan);
|
||||||
int flags = spannable.getSpanFlags(quoteSpan);
|
int flags = spannable.getSpanFlags(quoteSpan);
|
||||||
spannable.removeSpan(quoteSpan);
|
spannable.removeSpan(quoteSpan);
|
||||||
int colord = ContextCompat.getColor(context, R.color.cyanea_accent_reference);
|
int colord = ContextCompat.getColor(context, R.color.colorAccent);
|
||||||
spannable.setSpan(new CustomQuoteSpan(
|
spannable.setSpan(new CustomQuoteSpan(
|
||||||
ContextCompat.getColor(context, R.color.transparent),
|
ContextCompat.getColor(context, R.color.transparent),
|
||||||
colord,
|
colord,
|
||||||
|
|
|
@ -36,9 +36,6 @@ import androidx.core.content.ContextCompat;
|
||||||
import androidx.core.graphics.ColorUtils;
|
import androidx.core.graphics.ColorUtils;
|
||||||
import androidx.preference.PreferenceManager;
|
import androidx.preference.PreferenceManager;
|
||||||
|
|
||||||
import com.google.android.material.button.MaterialButton;
|
|
||||||
import com.jaredrummler.cyanea.Cyanea;
|
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
@ -49,7 +46,7 @@ import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import app.fedilab.android.R;
|
import app.fedilab.android.R;
|
||||||
import app.fedilab.android.activities.BaseActivity;
|
|
||||||
|
|
||||||
public class ThemeHelper {
|
public class ThemeHelper {
|
||||||
|
|
||||||
|
@ -72,6 +69,25 @@ public class ThemeHelper {
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static ColorStateList getButtonActionColorStateList(Context context) {
|
||||||
|
int[][] states = new int[][]{
|
||||||
|
new int[]{android.R.attr.state_enabled}, // enabled
|
||||||
|
new int[]{-android.R.attr.state_enabled}, // disabled
|
||||||
|
new int[]{-android.R.attr.state_checked}, // unchecked
|
||||||
|
new int[]{android.R.attr.state_pressed} // pressed
|
||||||
|
};
|
||||||
|
int alphaColor = ColorUtils.setAlphaComponent(ContextCompat.getColor(context, R.color.colorAccent), 0x33);
|
||||||
|
int color = ContextCompat.getColor(context, R.color.colorAccent);
|
||||||
|
int[] colors = new int[]{
|
||||||
|
color,
|
||||||
|
alphaColor,
|
||||||
|
color,
|
||||||
|
color
|
||||||
|
};
|
||||||
|
return new ColorStateList(states, colors);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize colors in a static variable
|
* Initialize colors in a static variable
|
||||||
* Currently link_color cannot be retrieved with getAttColor in ViewModel due to application and theme
|
* Currently link_color cannot be retrieved with getAttColor in ViewModel due to application and theme
|
||||||
|
@ -92,37 +108,7 @@ public class ThemeHelper {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void applyTheme(BaseActivity activity) {
|
|
||||||
if (Cyanea.getInstance().isDark()) {
|
|
||||||
activity.setTheme(R.style.AppThemeDark);
|
|
||||||
} else {
|
|
||||||
activity.setTheme(R.style.AppTheme);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void applyThemeDialog(BaseActivity activity) {
|
|
||||||
if (Cyanea.getInstance().isDark()) {
|
|
||||||
activity.setTheme(R.style.DialogDark);
|
|
||||||
} else {
|
|
||||||
activity.setTheme(R.style.Dialog);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int getBackgroundColor(Context context) {
|
|
||||||
if (Cyanea.getInstance().isDark()) {
|
|
||||||
return ContextCompat.getColor(context, R.color.cyanea_background_dark);
|
|
||||||
} else {
|
|
||||||
return ContextCompat.getColor(context, R.color.cyanea_background_light);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void applyThemeBar(BaseActivity activity) {
|
|
||||||
if (Cyanea.getInstance().isDark()) {
|
|
||||||
activity.setTheme(R.style.AppThemeBarDark);
|
|
||||||
} else {
|
|
||||||
activity.setTheme(R.style.AppThemeBar);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Animate two views, the current view will be hidden to left
|
* Animate two views, the current view will be hidden to left
|
||||||
|
@ -282,23 +268,6 @@ public class ThemeHelper {
|
||||||
return new ColorStateList(states, colors);
|
return new ColorStateList(states, colors);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ColorStateList getButtonActionColorStateList(Context context) {
|
|
||||||
int[][] states = new int[][]{
|
|
||||||
new int[]{android.R.attr.state_enabled}, // enabled
|
|
||||||
new int[]{-android.R.attr.state_enabled}, // disabled
|
|
||||||
new int[]{-android.R.attr.state_checked}, // unchecked
|
|
||||||
new int[]{android.R.attr.state_pressed} // pressed
|
|
||||||
};
|
|
||||||
int alphaColor = ColorUtils.setAlphaComponent(ContextCompat.getColor(context, R.color.cyanea_accent_dark_reference), 0x33);
|
|
||||||
int color = ContextCompat.getColor(context, R.color.cyanea_accent_dark_reference);
|
|
||||||
int[] colors = new int[]{
|
|
||||||
color,
|
|
||||||
alphaColor,
|
|
||||||
color,
|
|
||||||
color
|
|
||||||
};
|
|
||||||
return new ColorStateList(states, colors);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -319,144 +288,6 @@ public class ThemeHelper {
|
||||||
return new ColorStateList(states, colors);
|
return new ColorStateList(states, colors);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Allow to set colors for tablayout
|
|
||||||
*
|
|
||||||
* @param context - Context
|
|
||||||
* @return - ColorStateList
|
|
||||||
*/
|
|
||||||
public static ColorStateList getColorStateList(Context context) {
|
|
||||||
int[][] states = new int[][]{
|
|
||||||
new int[]{android.R.attr.state_selected},
|
|
||||||
new int[]{-android.R.attr.state_selected},
|
|
||||||
};
|
|
||||||
int[] colors = new int[]{
|
|
||||||
ContextCompat.getColor(context, R.color.cyanea_accent_dark_reference),
|
|
||||||
getAttColor(context, R.attr.mTextColor)
|
|
||||||
};
|
|
||||||
return new ColorStateList(states, colors);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Change all color for a Material button
|
|
||||||
*
|
|
||||||
* @param context - Context
|
|
||||||
* @param materialButton - MaterialButton
|
|
||||||
*/
|
|
||||||
public static void changeButtonColor(Context context, MaterialButton materialButton) {
|
|
||||||
materialButton.setRippleColor(ThemeHelper.getButtonColorStateList(context));
|
|
||||||
materialButton.setStrokeColor(ThemeHelper.getButtonColorStateList(context));
|
|
||||||
materialButton.setTextColor(ThemeHelper.getButtonColorStateList(context));
|
|
||||||
materialButton.setIconTint(ThemeHelper.getButtonColorStateList(context));
|
|
||||||
materialButton.setBackgroundTintList(ThemeHelper.getBackgroundButtonColorStateList(context));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Allow to set ThumbDrawable colors for SwitchCompat
|
|
||||||
*
|
|
||||||
* @param context - Context
|
|
||||||
* @return - ColorStateList
|
|
||||||
*/
|
|
||||||
public static ColorStateList getSwitchCompatThumbDrawable(Context context) {
|
|
||||||
int[][] states = new int[][]{
|
|
||||||
new int[]{android.R.attr.state_checked},
|
|
||||||
new int[]{-android.R.attr.state_checked},
|
|
||||||
};
|
|
||||||
int alphaColor = ColorUtils.setAlphaComponent(ContextCompat.getColor(context, R.color.cyanea_accent_dark_reference), 0xee);
|
|
||||||
int alphaColorUnchecked = ColorUtils.setAlphaComponent(getAttColor(context, R.attr.mTextColor), 0xee);
|
|
||||||
int[] colors = new int[]{
|
|
||||||
alphaColor,
|
|
||||||
alphaColorUnchecked
|
|
||||||
};
|
|
||||||
return new ColorStateList(states, colors);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Allow to set TrackDrawable colors for SwitchCompat
|
|
||||||
*
|
|
||||||
* @param context - Context
|
|
||||||
* @return - ColorStateList
|
|
||||||
*/
|
|
||||||
public static ColorStateList getSwitchCompatTrackDrawable(Context context) {
|
|
||||||
int[][] states = new int[][]{
|
|
||||||
new int[]{android.R.attr.state_checked},
|
|
||||||
new int[]{-android.R.attr.state_checked},
|
|
||||||
};
|
|
||||||
int alphaColor = ColorUtils.setAlphaComponent(ContextCompat.getColor(context, R.color.cyanea_accent_dark_reference), 0x33);
|
|
||||||
int alphaColorUnchecked = ColorUtils.setAlphaComponent(getAttColor(context, R.attr.mTextColor), 0x33);
|
|
||||||
int[] colors = new int[]{
|
|
||||||
alphaColor,
|
|
||||||
alphaColorUnchecked
|
|
||||||
};
|
|
||||||
return new ColorStateList(states, colors);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Allow to set colors for Material buttons inside a toggle group
|
|
||||||
*
|
|
||||||
* @param context - Context
|
|
||||||
* @return - ColorStateList
|
|
||||||
*/
|
|
||||||
public static ColorStateList getButtonColorStateList(Context context) {
|
|
||||||
int[][] states = new int[][]{
|
|
||||||
new int[]{android.R.attr.state_checked},
|
|
||||||
new int[]{-android.R.attr.state_checked},
|
|
||||||
};
|
|
||||||
int[] colors = new int[]{
|
|
||||||
ContextCompat.getColor(context, R.color.cyanea_accent_dark_reference),
|
|
||||||
getAttColor(context, R.attr.mTextColor)
|
|
||||||
};
|
|
||||||
return new ColorStateList(states, colors);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static void changeColorOutlineButton(Context context, MaterialButton materialButton) {
|
|
||||||
if (materialButton != null) {
|
|
||||||
materialButton.setStrokeColor(ThemeHelper.getButtonOutlineColorStateList(context));
|
|
||||||
materialButton.setRippleColor(ThemeHelper.getButtonOutlineColorStateList(context));
|
|
||||||
materialButton.setIconTint(ThemeHelper.getButtonOutlineColorStateList(context));
|
|
||||||
materialButton.setTextColor(ThemeHelper.getButtonOutlineColorStateList(context));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Allow to set colors for Material buttons inside a toggle group
|
|
||||||
*
|
|
||||||
* @param context - Context
|
|
||||||
* @return - ColorStateList
|
|
||||||
*/
|
|
||||||
public static ColorStateList getButtonOutlineColorStateList(Context context) {
|
|
||||||
int[][] states = new int[][]{
|
|
||||||
new int[]{android.R.attr.state_checked},
|
|
||||||
new int[]{-android.R.attr.state_checked},
|
|
||||||
};
|
|
||||||
int alphaColorUnchecked = ColorUtils.setAlphaComponent(getAttColor(context, R.attr.mTextColor), 0xaa);
|
|
||||||
int[] colors = new int[]{
|
|
||||||
ContextCompat.getColor(context, R.color.cyanea_accent_dark_reference),
|
|
||||||
alphaColorUnchecked
|
|
||||||
};
|
|
||||||
return new ColorStateList(states, colors);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Allow to set background colors for Material buttons inside a toggle group
|
|
||||||
*
|
|
||||||
* @param context - Context
|
|
||||||
* @return - ColorStateList
|
|
||||||
*/
|
|
||||||
private static ColorStateList getBackgroundButtonColorStateList(Context context) {
|
|
||||||
int[][] states = new int[][]{
|
|
||||||
new int[]{android.R.attr.state_checked},
|
|
||||||
new int[]{-android.R.attr.state_checked},
|
|
||||||
};
|
|
||||||
int alphaColor = ColorUtils.setAlphaComponent(ContextCompat.getColor(context, R.color.cyanea_accent_dark_reference), 0x33);
|
|
||||||
int[] colors = new int[]{
|
|
||||||
alphaColor,
|
|
||||||
ContextCompat.getColor(context, R.color.transparent)
|
|
||||||
};
|
|
||||||
return new ColorStateList(states, colors);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allow to change font scale in activities
|
* Allow to change font scale in activities
|
||||||
|
|
|
@ -48,7 +48,6 @@ import app.fedilab.android.client.entities.api.Account;
|
||||||
import app.fedilab.android.databinding.DrawerAccountBinding;
|
import app.fedilab.android.databinding.DrawerAccountBinding;
|
||||||
import app.fedilab.android.helper.Helper;
|
import app.fedilab.android.helper.Helper;
|
||||||
import app.fedilab.android.helper.MastodonHelper;
|
import app.fedilab.android.helper.MastodonHelper;
|
||||||
import app.fedilab.android.helper.ThemeHelper;
|
|
||||||
import app.fedilab.android.viewmodel.mastodon.AccountsVM;
|
import app.fedilab.android.viewmodel.mastodon.AccountsVM;
|
||||||
import es.dmoral.toasty.Toasty;
|
import es.dmoral.toasty.Toasty;
|
||||||
|
|
||||||
|
@ -79,12 +78,7 @@ public class AccountAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
||||||
// start the new activity
|
// start the new activity
|
||||||
context.startActivity(intent, options.toBundle());
|
context.startActivity(intent, options.toBundle());
|
||||||
});
|
});
|
||||||
ThemeHelper.changeColorOutlineButton(context, accountViewHolder.binding.block);
|
|
||||||
ThemeHelper.changeColorOutlineButton(context, accountViewHolder.binding.mute);
|
|
||||||
ThemeHelper.changeColorOutlineButton(context, accountViewHolder.binding.muteNotification);
|
|
||||||
ThemeHelper.changeColorOutlineButton(context, accountViewHolder.binding.muteTimed);
|
|
||||||
accountViewHolder.binding.followAction.setIconResource(R.drawable.ic_baseline_person_add_24);
|
accountViewHolder.binding.followAction.setIconResource(R.drawable.ic_baseline_person_add_24);
|
||||||
accountViewHolder.binding.followAction.setBackgroundTintList(ColorStateList.valueOf(ContextCompat.getColor(context, R.color.cyanea_accent_dark_reference)));
|
|
||||||
if (account.relationShip != null) {
|
if (account.relationShip != null) {
|
||||||
|
|
||||||
ProfileActivity.action doAction = ProfileActivity.action.FOLLOW;
|
ProfileActivity.action doAction = ProfileActivity.action.FOLLOW;
|
||||||
|
@ -114,7 +108,6 @@ public class AccountAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
||||||
accountViewHolder.binding.followAction.setIconResource(R.drawable.ic_baseline_hourglass_full_24);
|
accountViewHolder.binding.followAction.setIconResource(R.drawable.ic_baseline_hourglass_full_24);
|
||||||
} else {
|
} else {
|
||||||
accountViewHolder.binding.followAction.setIconResource(R.drawable.ic_baseline_person_add_24);
|
accountViewHolder.binding.followAction.setIconResource(R.drawable.ic_baseline_person_add_24);
|
||||||
accountViewHolder.binding.followAction.setBackgroundTintList(ColorStateList.valueOf(ContextCompat.getColor(context, R.color.cyanea_accent_dark_reference)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -207,7 +200,7 @@ public class AccountAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
||||||
} else if (finalDoAction == ProfileActivity.action.UNFOLLOW) {
|
} else if (finalDoAction == ProfileActivity.action.UNFOLLOW) {
|
||||||
boolean confirm_unfollow = sharedpreferences.getBoolean(context.getString(R.string.SET_UNFOLLOW_VALIDATION), true);
|
boolean confirm_unfollow = sharedpreferences.getBoolean(context.getString(R.string.SET_UNFOLLOW_VALIDATION), true);
|
||||||
if (confirm_unfollow) {
|
if (confirm_unfollow) {
|
||||||
AlertDialog.Builder unfollowConfirm = new AlertDialog.Builder(context, Helper.dialogStyle());
|
AlertDialog.Builder unfollowConfirm = new AlertDialog.Builder(context);
|
||||||
unfollowConfirm.setTitle(context.getString(R.string.unfollow_confirm));
|
unfollowConfirm.setTitle(context.getString(R.string.unfollow_confirm));
|
||||||
unfollowConfirm.setMessage(account.acct);
|
unfollowConfirm.setMessage(account.acct);
|
||||||
unfollowConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
|
unfollowConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
|
||||||
|
|
|
@ -97,7 +97,6 @@ public class AccountListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
|
||||||
notifyItemChanged(position);
|
notifyItemChanged(position);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
holder.binding.listAction.setBackgroundTintList(ColorStateList.valueOf(ContextCompat.getColor(context, R.color.cyanea_accent_reference)));
|
|
||||||
holder.binding.listAction.setIconResource(R.drawable.ic_baseline_person_add_alt_1_24);
|
holder.binding.listAction.setIconResource(R.drawable.ic_baseline_person_add_alt_1_24);
|
||||||
holder.binding.listAction.setOnClickListener(v -> {
|
holder.binding.listAction.setOnClickListener(v -> {
|
||||||
accountList.add(0, account);
|
accountList.add(0, account);
|
||||||
|
|
|
@ -147,7 +147,7 @@ public class AnnouncementAdapter extends RecyclerView.Adapter<AnnouncementAdapte
|
||||||
emojiPopup.toggle();
|
emojiPopup.toggle();
|
||||||
});
|
});
|
||||||
holder.binding.statusAddCustomEmoji.setOnClickListener(v -> {
|
holder.binding.statusAddCustomEmoji.setOnClickListener(v -> {
|
||||||
final AlertDialog.Builder builder = new AlertDialog.Builder(context, Helper.dialogStyle());
|
final AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||||
int paddingPixel = 15;
|
int paddingPixel = 15;
|
||||||
float density = context.getResources().getDisplayMetrics().density;
|
float density = context.getResources().getDisplayMetrics().density;
|
||||||
int paddingDp = (int) (paddingPixel * density);
|
int paddingDp = (int) (paddingPixel * density);
|
||||||
|
|
|
@ -28,7 +28,6 @@ import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.content.res.ColorStateList;
|
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
|
@ -61,7 +60,6 @@ import androidx.appcompat.widget.AppCompatEditText;
|
||||||
import androidx.appcompat.widget.LinearLayoutCompat;
|
import androidx.appcompat.widget.LinearLayoutCompat;
|
||||||
import androidx.core.app.ActivityCompat;
|
import androidx.core.app.ActivityCompat;
|
||||||
import androidx.core.content.ContextCompat;
|
import androidx.core.content.ContextCompat;
|
||||||
import androidx.core.widget.ImageViewCompat;
|
|
||||||
import androidx.lifecycle.LifecycleOwner;
|
import androidx.lifecycle.LifecycleOwner;
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
import androidx.lifecycle.ViewModelStoreOwner;
|
import androidx.lifecycle.ViewModelStoreOwner;
|
||||||
|
@ -954,7 +952,7 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
||||||
context.startActivity(intent);
|
context.startActivity(intent);
|
||||||
});
|
});
|
||||||
composeAttachmentItemBinding.buttonDescription.setOnClickListener(v -> {
|
composeAttachmentItemBinding.buttonDescription.setOnClickListener(v -> {
|
||||||
AlertDialog.Builder builderInner = new AlertDialog.Builder(context, Helper.dialogStyle());
|
AlertDialog.Builder builderInner = new AlertDialog.Builder(context);
|
||||||
builderInner.setTitle(R.string.upload_form_description);
|
builderInner.setTitle(R.string.upload_form_description);
|
||||||
PopupMediaDescriptionBinding popupMediaDescriptionBinding = PopupMediaDescriptionBinding.inflate(LayoutInflater.from(context), null, false);
|
PopupMediaDescriptionBinding popupMediaDescriptionBinding = PopupMediaDescriptionBinding.inflate(LayoutInflater.from(context), null, false);
|
||||||
builderInner.setView(popupMediaDescriptionBinding.getRoot());
|
builderInner.setView(popupMediaDescriptionBinding.getRoot());
|
||||||
|
@ -1011,7 +1009,7 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
composeAttachmentItemBinding.buttonRemove.setOnClickListener(v -> {
|
composeAttachmentItemBinding.buttonRemove.setOnClickListener(v -> {
|
||||||
AlertDialog.Builder builderInner = new AlertDialog.Builder(context, Helper.dialogStyle());
|
AlertDialog.Builder builderInner = new AlertDialog.Builder(context);
|
||||||
builderInner.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
|
builderInner.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
|
||||||
builderInner.setPositiveButton(R.string.delete, (dialog, which) -> {
|
builderInner.setPositiveButton(R.string.delete, (dialog, which) -> {
|
||||||
attachmentList.remove(attachment);
|
attachmentList.remove(attachment);
|
||||||
|
@ -1142,8 +1140,6 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
||||||
|
|
||||||
if (theme_statuses_color != -1) {
|
if (theme_statuses_color != -1) {
|
||||||
holder.binding.cardviewContainer.setBackgroundColor(theme_statuses_color);
|
holder.binding.cardviewContainer.setBackgroundColor(theme_statuses_color);
|
||||||
} else {
|
|
||||||
holder.binding.cardviewContainer.setBackgroundColor(ContextCompat.getColor(context, R.color.cyanea_primary_dark_reference));
|
|
||||||
}
|
}
|
||||||
if (theme_text_header_2_line != -1) {
|
if (theme_text_header_2_line != -1) {
|
||||||
holder.binding.username.setTextColor(theme_text_header_2_line);
|
holder.binding.username.setTextColor(theme_text_header_2_line);
|
||||||
|
@ -1176,8 +1172,6 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
||||||
} else {
|
} else {
|
||||||
holder.binding.buttonEmojiOne.setVisibility(View.GONE);
|
holder.binding.buttonEmojiOne.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
holder.binding.visibilityPanel.setBackgroundColor(ContextCompat.getColor(context, R.color.cyanea_primary_dark_reference));
|
|
||||||
holder.binding.attachmentChoicesPanel.setBackgroundColor(ContextCompat.getColor(context, R.color.cyanea_primary_dark_reference));
|
|
||||||
|
|
||||||
int newInputType = holder.binding.content.getInputType() & (holder.binding.content.getInputType() ^ InputType.TYPE_TEXT_FLAG_AUTO_COMPLETE);
|
int newInputType = holder.binding.content.getInputType() & (holder.binding.content.getInputType() ^ InputType.TYPE_TEXT_FLAG_AUTO_COMPLETE);
|
||||||
holder.binding.content.setInputType(newInputType);
|
holder.binding.content.setInputType(newInputType);
|
||||||
|
@ -1186,8 +1180,6 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
||||||
holder.binding.contentSpoiler.setInputType(newInputTypeSpoiler);
|
holder.binding.contentSpoiler.setInputType(newInputTypeSpoiler);
|
||||||
if (theme_statuses_color != -1) {
|
if (theme_statuses_color != -1) {
|
||||||
holder.binding.cardviewContainer.setBackgroundColor(theme_statuses_color);
|
holder.binding.cardviewContainer.setBackgroundColor(theme_statuses_color);
|
||||||
} else {
|
|
||||||
holder.binding.cardviewContainer.setBackgroundColor(ContextCompat.getColor(context, R.color.cyanea_primary_dark_reference));
|
|
||||||
}
|
}
|
||||||
holder.binding.buttonAttach.setOnClickListener(v -> {
|
holder.binding.buttonAttach.setOnClickListener(v -> {
|
||||||
if (instanceInfo.configuration.media_attachments.supported_mime_types != null) {
|
if (instanceInfo.configuration.media_attachments.supported_mime_types != null) {
|
||||||
|
@ -1395,11 +1387,7 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
||||||
updateCharacterCount(holder);
|
updateCharacterCount(holder);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (statusDraft.poll != null) {
|
|
||||||
ImageViewCompat.setImageTintList(holder.binding.buttonPoll, ColorStateList.valueOf(ContextCompat.getColor(context, R.color.cyanea_accent)));
|
|
||||||
} else {
|
|
||||||
ImageViewCompat.setImageTintList(holder.binding.buttonPoll, null);
|
|
||||||
}
|
|
||||||
holder.binding.buttonPost.setEnabled(!statusDraft.submitted);
|
holder.binding.buttonPost.setEnabled(!statusDraft.submitted);
|
||||||
|
|
||||||
holder.binding.buttonPost.setOnClickListener(v -> {
|
holder.binding.buttonPost.setOnClickListener(v -> {
|
||||||
|
@ -1456,7 +1444,7 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
||||||
}
|
}
|
||||||
|
|
||||||
SharedPreferences.Editor editor = sharedpreferences.edit();
|
SharedPreferences.Editor editor = sharedpreferences.edit();
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(context, Helper.dialogStyle());
|
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||||
builder.setTitle(context.getString(R.string.message_language));
|
builder.setTitle(context.getString(R.string.message_language));
|
||||||
|
|
||||||
builder.setSingleChoiceItems(languagesArr, selection, null);
|
builder.setSingleChoiceItems(languagesArr, selection, null);
|
||||||
|
@ -1490,7 +1478,7 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
||||||
* @param position - int position
|
* @param position - int position
|
||||||
*/
|
*/
|
||||||
private void displayPollPopup(ComposeViewHolder holder, Status statusDraft, int position) {
|
private void displayPollPopup(ComposeViewHolder holder, Status statusDraft, int position) {
|
||||||
AlertDialog.Builder alertPoll = new AlertDialog.Builder(context, Helper.dialogStyle());
|
AlertDialog.Builder alertPoll = new AlertDialog.Builder(context);
|
||||||
alertPoll.setTitle(R.string.create_poll);
|
alertPoll.setTitle(R.string.create_poll);
|
||||||
ComposePollBinding composePollBinding = ComposePollBinding.inflate(LayoutInflater.from(context), new LinearLayout(context), false);
|
ComposePollBinding composePollBinding = ComposePollBinding.inflate(LayoutInflater.from(context), new LinearLayout(context), false);
|
||||||
alertPoll.setView(composePollBinding.getRoot());
|
alertPoll.setView(composePollBinding.getRoot());
|
||||||
|
@ -1708,7 +1696,7 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
||||||
*/
|
*/
|
||||||
private void displayEmojiPicker(ComposeViewHolder holder) throws DBException {
|
private void displayEmojiPicker(ComposeViewHolder holder) throws DBException {
|
||||||
|
|
||||||
final AlertDialog.Builder builder = new AlertDialog.Builder(context, Helper.dialogStyle());
|
final AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||||
int paddingPixel = 15;
|
int paddingPixel = 15;
|
||||||
float density = context.getResources().getDisplayMetrics().density;
|
float density = context.getResources().getDisplayMetrics().density;
|
||||||
int paddingDp = (int) (paddingPixel * density);
|
int paddingDp = (int) (paddingPixel * density);
|
||||||
|
|
|
@ -29,7 +29,6 @@ import java.util.List;
|
||||||
import app.fedilab.android.R;
|
import app.fedilab.android.R;
|
||||||
import app.fedilab.android.activities.MainActivity;
|
import app.fedilab.android.activities.MainActivity;
|
||||||
import app.fedilab.android.databinding.DrawerDomainBlockBinding;
|
import app.fedilab.android.databinding.DrawerDomainBlockBinding;
|
||||||
import app.fedilab.android.helper.Helper;
|
|
||||||
import app.fedilab.android.viewmodel.mastodon.AccountsVM;
|
import app.fedilab.android.viewmodel.mastodon.AccountsVM;
|
||||||
|
|
||||||
|
|
||||||
|
@ -64,7 +63,7 @@ public class DomainBlockAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
|
||||||
holder.binding.domainName.setText(domain);
|
holder.binding.domainName.setText(domain);
|
||||||
AccountsVM accountsVM = new ViewModelProvider((ViewModelStoreOwner) context).get(AccountsVM.class);
|
AccountsVM accountsVM = new ViewModelProvider((ViewModelStoreOwner) context).get(AccountsVM.class);
|
||||||
holder.binding.unblockDomain.setOnClickListener(v -> {
|
holder.binding.unblockDomain.setOnClickListener(v -> {
|
||||||
AlertDialog.Builder alt_bld = new AlertDialog.Builder(context, Helper.dialogStyle());
|
AlertDialog.Builder alt_bld = new AlertDialog.Builder(context);
|
||||||
alt_bld.setMessage(context.getString(R.string.unblock_domain_confirm, domain));
|
alt_bld.setMessage(context.getString(R.string.unblock_domain_confirm, domain));
|
||||||
alt_bld.setPositiveButton(R.string.yes, (dialog, id) -> {
|
alt_bld.setPositiveButton(R.string.yes, (dialog, id) -> {
|
||||||
accountsVM.removeDomainBlocks(MainActivity.currentInstance, MainActivity.currentToken, domain);
|
accountsVM.removeDomainBlocks(MainActivity.currentInstance, MainActivity.currentToken, domain);
|
||||||
|
|
|
@ -32,7 +32,6 @@ import app.fedilab.android.R;
|
||||||
import app.fedilab.android.activities.FilterActivity;
|
import app.fedilab.android.activities.FilterActivity;
|
||||||
import app.fedilab.android.client.entities.api.Filter;
|
import app.fedilab.android.client.entities.api.Filter;
|
||||||
import app.fedilab.android.databinding.DrawerFilterBinding;
|
import app.fedilab.android.databinding.DrawerFilterBinding;
|
||||||
import app.fedilab.android.helper.Helper;
|
|
||||||
import app.fedilab.android.viewmodel.mastodon.FiltersVM;
|
import app.fedilab.android.viewmodel.mastodon.FiltersVM;
|
||||||
|
|
||||||
|
|
||||||
|
@ -88,7 +87,7 @@ public class FilterAdapter extends RecyclerView.Adapter<FilterAdapter.FilterView
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
holder.binding.deleteFilter.setOnClickListener(v -> {
|
holder.binding.deleteFilter.setOnClickListener(v -> {
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(context, Helper.dialogStyle());
|
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||||
builder.setTitle(R.string.action_filter_delete);
|
builder.setTitle(R.string.action_filter_delete);
|
||||||
builder.setMessage(R.string.action_lists_confirm_delete);
|
builder.setMessage(R.string.action_lists_confirm_delete);
|
||||||
builder.setIcon(android.R.drawable.ic_dialog_alert)
|
builder.setIcon(android.R.drawable.ic_dialog_alert)
|
||||||
|
|
|
@ -39,7 +39,6 @@ import app.fedilab.android.client.entities.app.PinnedTimeline;
|
||||||
import app.fedilab.android.client.entities.app.Timeline;
|
import app.fedilab.android.client.entities.app.Timeline;
|
||||||
import app.fedilab.android.databinding.DrawerReorderBinding;
|
import app.fedilab.android.databinding.DrawerReorderBinding;
|
||||||
import app.fedilab.android.exception.DBException;
|
import app.fedilab.android.exception.DBException;
|
||||||
import app.fedilab.android.helper.Helper;
|
|
||||||
import app.fedilab.android.helper.itemtouchhelper.ItemTouchHelperAdapter;
|
import app.fedilab.android.helper.itemtouchhelper.ItemTouchHelperAdapter;
|
||||||
import app.fedilab.android.helper.itemtouchhelper.ItemTouchHelperViewHolder;
|
import app.fedilab.android.helper.itemtouchhelper.ItemTouchHelperViewHolder;
|
||||||
import app.fedilab.android.helper.itemtouchhelper.OnStartDragListener;
|
import app.fedilab.android.helper.itemtouchhelper.OnStartDragListener;
|
||||||
|
@ -170,7 +169,7 @@ public class ReorderTabAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
|
||||||
}
|
}
|
||||||
holder.binding.delete.setOnClickListener(v -> {
|
holder.binding.delete.setOnClickListener(v -> {
|
||||||
if (item.type == Timeline.TimeLineEnum.TAG || item.type == Timeline.TimeLineEnum.REMOTE || item.type == Timeline.TimeLineEnum.LIST) {
|
if (item.type == Timeline.TimeLineEnum.TAG || item.type == Timeline.TimeLineEnum.REMOTE || item.type == Timeline.TimeLineEnum.LIST) {
|
||||||
AlertDialog.Builder alt_bld = new AlertDialog.Builder(context, Helper.dialogStyle());
|
AlertDialog.Builder alt_bld = new AlertDialog.Builder(context);
|
||||||
String title = "";
|
String title = "";
|
||||||
String message = "";
|
String message = "";
|
||||||
alt_bld.setTitle(R.string.action_lists_delete);
|
alt_bld.setTitle(R.string.action_lists_delete);
|
||||||
|
|
|
@ -50,7 +50,6 @@ import android.text.Spanned;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.text.style.ForegroundColorSpan;
|
import android.text.style.ForegroundColorSpan;
|
||||||
import android.util.TypedValue;
|
import android.util.TypedValue;
|
||||||
import android.view.ContextThemeWrapper;
|
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
@ -439,7 +438,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||||
});
|
});
|
||||||
holder.binding.statusAddCustomEmoji.setOnClickListener(v -> {
|
holder.binding.statusAddCustomEmoji.setOnClickListener(v -> {
|
||||||
|
|
||||||
final AlertDialog.Builder builder = new AlertDialog.Builder(context, Helper.dialogStyle());
|
final AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||||
int paddingPixel = 15;
|
int paddingPixel = 15;
|
||||||
float density = context.getResources().getDisplayMetrics().density;
|
float density = context.getResources().getDisplayMetrics().density;
|
||||||
int paddingDp = (int) (paddingPixel * density);
|
int paddingDp = (int) (paddingPixel * density);
|
||||||
|
@ -526,7 +525,6 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||||
holder.binding.statusEmoji.setVisibility(View.VISIBLE);
|
holder.binding.statusEmoji.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
Helper.changeDrawableColor(context, R.drawable.ic_baseline_mode_edit_message_24, R.color.cyanea_accent_reference);
|
|
||||||
if (theme_icons_color != -1) {
|
if (theme_icons_color != -1) {
|
||||||
Helper.changeDrawableColor(context, holder.binding.actionButtonReply, theme_icons_color);
|
Helper.changeDrawableColor(context, holder.binding.actionButtonReply, theme_icons_color);
|
||||||
Helper.changeDrawableColor(context, holder.binding.cacheIndicator, theme_icons_color);
|
Helper.changeDrawableColor(context, holder.binding.cacheIndicator, theme_icons_color);
|
||||||
|
@ -600,9 +598,6 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||||
if (theme_statuses_color != -1) {
|
if (theme_statuses_color != -1) {
|
||||||
holder.binding.cardviewContainer.setBackgroundColor(theme_statuses_color);
|
holder.binding.cardviewContainer.setBackgroundColor(theme_statuses_color);
|
||||||
holder.binding.translationLabel.setBackgroundColor(theme_statuses_color);
|
holder.binding.translationLabel.setBackgroundColor(theme_statuses_color);
|
||||||
} else {
|
|
||||||
holder.binding.cardviewContainer.setBackgroundColor(ThemeHelper.getBackgroundColor(context));
|
|
||||||
holder.binding.translationLabel.setBackgroundColor(ThemeHelper.getBackgroundColor(context));
|
|
||||||
}
|
}
|
||||||
if (theme_boost_header_color != -1 && status.reblog != null) {
|
if (theme_boost_header_color != -1 && status.reblog != null) {
|
||||||
holder.binding.statusBoosterInfo.setBackgroundColor(theme_boost_header_color);
|
holder.binding.statusBoosterInfo.setBackgroundColor(theme_boost_header_color);
|
||||||
|
@ -818,7 +813,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||||
});
|
});
|
||||||
holder.binding.actionButtonBoost.setOnClickListener(v -> {
|
holder.binding.actionButtonBoost.setOnClickListener(v -> {
|
||||||
if (confirmBoost) {
|
if (confirmBoost) {
|
||||||
AlertDialog.Builder alt_bld = new AlertDialog.Builder(context, Helper.dialogStyle());
|
AlertDialog.Builder alt_bld = new AlertDialog.Builder(context);
|
||||||
if (statusToDeal.reblogged) {
|
if (statusToDeal.reblogged) {
|
||||||
alt_bld.setMessage(context.getString(R.string.reblog_remove));
|
alt_bld.setMessage(context.getString(R.string.reblog_remove));
|
||||||
} else {
|
} else {
|
||||||
|
@ -888,7 +883,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||||
});
|
});
|
||||||
holder.binding.actionButtonFavorite.setOnClickListener(v -> {
|
holder.binding.actionButtonFavorite.setOnClickListener(v -> {
|
||||||
if (confirmFav) {
|
if (confirmFav) {
|
||||||
AlertDialog.Builder alt_bld = new AlertDialog.Builder(context, Helper.dialogStyle());
|
AlertDialog.Builder alt_bld = new AlertDialog.Builder(context);
|
||||||
if (status.favourited) {
|
if (status.favourited) {
|
||||||
alt_bld.setMessage(context.getString(R.string.favourite_remove));
|
alt_bld.setMessage(context.getString(R.string.favourite_remove));
|
||||||
} else {
|
} else {
|
||||||
|
@ -1534,7 +1529,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||||
if (ownvotes != null && ownvotes.contains(j)) {
|
if (ownvotes != null && ownvotes.contains(j)) {
|
||||||
Drawable img = ContextCompat.getDrawable(context, R.drawable.ic_baseline_check_24);
|
Drawable img = ContextCompat.getDrawable(context, R.drawable.ic_baseline_check_24);
|
||||||
assert img != null;
|
assert img != null;
|
||||||
img.setColorFilter(ContextCompat.getColor(context, R.color.cyanea_accent_reference), PorterDuff.Mode.SRC_IN);
|
img.setColorFilter(ContextCompat.getColor(context, R.color.colorAccent), PorterDuff.Mode.SRC_IN);
|
||||||
img.setBounds(0, 0, (int) (20 * scale + 0.5f), (int) (20 * scale + 0.5f));
|
img.setBounds(0, 0, (int) (20 * scale + 0.5f), (int) (20 * scale + 0.5f));
|
||||||
pollItemBinding.pollItemText.setCompoundDrawables(null, null, img, null);
|
pollItemBinding.pollItemText.setCompoundDrawables(null, null, img, null);
|
||||||
}
|
}
|
||||||
|
@ -1551,7 +1546,6 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||||
(holder.binding.poll.multipleChoice).removeAllViews();
|
(holder.binding.poll.multipleChoice).removeAllViews();
|
||||||
for (Poll.PollItem pollOption : statusToDeal.poll.options) {
|
for (Poll.PollItem pollOption : statusToDeal.poll.options) {
|
||||||
CheckBox cb = new CheckBox(context);
|
CheckBox cb = new CheckBox(context);
|
||||||
cb.setButtonTintList(ThemeHelper.getButtonColorStateList(context));
|
|
||||||
cb.setText(
|
cb.setText(
|
||||||
pollOption.getSpanTitle(context, statusToDeal,
|
pollOption.getSpanTitle(context, statusToDeal,
|
||||||
new WeakReference<>(cb)),
|
new WeakReference<>(cb)),
|
||||||
|
@ -1565,7 +1559,6 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||||
(holder.binding.poll.singleChoiceRadioGroup).removeAllViews();
|
(holder.binding.poll.singleChoiceRadioGroup).removeAllViews();
|
||||||
for (Poll.PollItem pollOption : statusToDeal.poll.options) {
|
for (Poll.PollItem pollOption : statusToDeal.poll.options) {
|
||||||
RadioButton rb = new RadioButton(context);
|
RadioButton rb = new RadioButton(context);
|
||||||
rb.setButtonTintList(ThemeHelper.getButtonColorStateList(context));
|
|
||||||
rb.setText(
|
rb.setText(
|
||||||
pollOption.getSpanTitle(context, statusToDeal,
|
pollOption.getSpanTitle(context, statusToDeal,
|
||||||
new WeakReference<>(rb)),
|
new WeakReference<>(rb)),
|
||||||
|
@ -1739,7 +1732,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||||
}
|
}
|
||||||
holder.binding.actionButtonMore.setOnClickListener(v -> {
|
holder.binding.actionButtonMore.setOnClickListener(v -> {
|
||||||
boolean isOwner = statusToDeal.account.id.compareTo(BaseMainActivity.currentUserID) == 0;
|
boolean isOwner = statusToDeal.account.id.compareTo(BaseMainActivity.currentUserID) == 0;
|
||||||
PopupMenu popup = new PopupMenu(new ContextThemeWrapper(context, Helper.popupStyle()), holder.binding.actionButtonMore);
|
PopupMenu popup = new PopupMenu(context, holder.binding.actionButtonMore);
|
||||||
popup.getMenuInflater()
|
popup.getMenuInflater()
|
||||||
.inflate(R.menu.option_toot, popup.getMenu());
|
.inflate(R.menu.option_toot, popup.getMenu());
|
||||||
if (statusToDeal.visibility.equals("private") || status.visibility.equals("direct")) {
|
if (statusToDeal.visibility.equals("private") || status.visibility.equals("direct")) {
|
||||||
|
@ -1786,7 +1779,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||||
popup.setOnMenuItemClickListener(item -> {
|
popup.setOnMenuItemClickListener(item -> {
|
||||||
int itemId = item.getItemId();
|
int itemId = item.getItemId();
|
||||||
if (itemId == R.id.action_redraft) {
|
if (itemId == R.id.action_redraft) {
|
||||||
AlertDialog.Builder builderInner = new AlertDialog.Builder(context, Helper.dialogStyle());
|
AlertDialog.Builder builderInner = new AlertDialog.Builder(context);
|
||||||
builderInner.setTitle(stringArrayConf[1]);
|
builderInner.setTitle(stringArrayConf[1]);
|
||||||
builderInner.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
|
builderInner.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
|
||||||
builderInner.setPositiveButton(R.string.yes, (dialog, which) -> {
|
builderInner.setPositiveButton(R.string.yes, (dialog, which) -> {
|
||||||
|
@ -1842,7 +1835,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||||
} else if (itemId == R.id.action_open_browser) {
|
} else if (itemId == R.id.action_open_browser) {
|
||||||
Helper.openBrowser(context, statusToDeal.url);
|
Helper.openBrowser(context, statusToDeal.url);
|
||||||
} else if (itemId == R.id.action_remove) {
|
} else if (itemId == R.id.action_remove) {
|
||||||
AlertDialog.Builder builderInner = new AlertDialog.Builder(context, Helper.dialogStyle());
|
AlertDialog.Builder builderInner = new AlertDialog.Builder(context);
|
||||||
builderInner.setTitle(stringArrayConf[0]);
|
builderInner.setTitle(stringArrayConf[0]);
|
||||||
builderInner.setMessage(statusToDeal.content);
|
builderInner.setMessage(statusToDeal.content);
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
||||||
|
@ -1859,7 +1852,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||||
}));
|
}));
|
||||||
builderInner.show();
|
builderInner.show();
|
||||||
} else if (itemId == R.id.action_block_domain) {
|
} else if (itemId == R.id.action_block_domain) {
|
||||||
AlertDialog.Builder builderInner = new AlertDialog.Builder(context, Helper.dialogStyle());
|
AlertDialog.Builder builderInner = new AlertDialog.Builder(context);
|
||||||
builderInner.setTitle(stringArrayConf[3]);
|
builderInner.setTitle(stringArrayConf[3]);
|
||||||
String domain = statusToDeal.account.acct.split("@")[1];
|
String domain = statusToDeal.account.acct.split("@")[1];
|
||||||
builderInner.setMessage(context.getString(R.string.block_domain_confirm_message, domain));
|
builderInner.setMessage(context.getString(R.string.block_domain_confirm_message, domain));
|
||||||
|
@ -1870,7 +1863,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||||
});
|
});
|
||||||
builderInner.show();
|
builderInner.show();
|
||||||
} else if (itemId == R.id.action_mute) {
|
} else if (itemId == R.id.action_mute) {
|
||||||
AlertDialog.Builder builderInner = new AlertDialog.Builder(context, Helper.dialogStyle());
|
AlertDialog.Builder builderInner = new AlertDialog.Builder(context);
|
||||||
builderInner.setTitle(stringArrayConf[0]);
|
builderInner.setTitle(stringArrayConf[0]);
|
||||||
builderInner.setMessage(statusToDeal.account.acct);
|
builderInner.setMessage(statusToDeal.account.acct);
|
||||||
builderInner.setNeutralButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
|
builderInner.setNeutralButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
|
||||||
|
@ -1909,7 +1902,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||||
MastodonHelper.scheduleBoost(context, MastodonHelper.ScheduleType.TIMED_MUTED, statusToDeal, null, null);
|
MastodonHelper.scheduleBoost(context, MastodonHelper.ScheduleType.TIMED_MUTED, statusToDeal, null, null);
|
||||||
return true;
|
return true;
|
||||||
} else if (itemId == R.id.action_block) {
|
} else if (itemId == R.id.action_block) {
|
||||||
AlertDialog.Builder builderInner = new AlertDialog.Builder(context, Helper.dialogStyle());
|
AlertDialog.Builder builderInner = new AlertDialog.Builder(context);
|
||||||
builderInner.setTitle(stringArrayConf[1]);
|
builderInner.setTitle(stringArrayConf[1]);
|
||||||
builderInner.setMessage(statusToDeal.account.acct);
|
builderInner.setMessage(statusToDeal.account.acct);
|
||||||
builderInner.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
|
builderInner.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
|
||||||
|
@ -2032,7 +2025,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||||
}
|
}
|
||||||
Handler mainHandler = new Handler(Looper.getMainLooper());
|
Handler mainHandler = new Handler(Looper.getMainLooper());
|
||||||
Runnable myRunnable = () -> {
|
Runnable myRunnable = () -> {
|
||||||
AlertDialog.Builder builderSingle = new AlertDialog.Builder(context, Helper.dialogStyle());
|
AlertDialog.Builder builderSingle = new AlertDialog.Builder(context);
|
||||||
builderSingle.setTitle(context.getString(R.string.choose_accounts));
|
builderSingle.setTitle(context.getString(R.string.choose_accounts));
|
||||||
final AccountsSearchAdapter accountsSearchAdapter = new AccountsSearchAdapter(context, accountList);
|
final AccountsSearchAdapter accountsSearchAdapter = new AccountsSearchAdapter(context, accountList);
|
||||||
final BaseAccount[] accountArray = new BaseAccount[accounts.size()];
|
final BaseAccount[] accountArray = new BaseAccount[accounts.size()];
|
||||||
|
|
|
@ -95,7 +95,7 @@ public class StatusDraftAdapter extends RecyclerView.Adapter<StatusDraftAdapter.
|
||||||
|
|
||||||
|
|
||||||
holder.binding.delete.setOnClickListener(v -> {
|
holder.binding.delete.setOnClickListener(v -> {
|
||||||
AlertDialog.Builder unfollowConfirm = new AlertDialog.Builder(context, Helper.dialogStyle());
|
AlertDialog.Builder unfollowConfirm = new AlertDialog.Builder(context);
|
||||||
unfollowConfirm.setMessage(context.getString(R.string.remove_draft));
|
unfollowConfirm.setMessage(context.getString(R.string.remove_draft));
|
||||||
unfollowConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
|
unfollowConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
|
||||||
unfollowConfirm.setPositiveButton(R.string.delete, (dialog, which) -> {
|
unfollowConfirm.setPositiveButton(R.string.delete, (dialog, which) -> {
|
||||||
|
|
|
@ -22,7 +22,6 @@ import android.view.ViewGroup;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.preference.PreferenceManager;
|
import androidx.preference.PreferenceManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
@ -93,8 +92,6 @@ public class StatusHistoryAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||||
}
|
}
|
||||||
if (theme_statuses_color != -1) {
|
if (theme_statuses_color != -1) {
|
||||||
holder.binding.cardviewContainer.setBackgroundColor(theme_statuses_color);
|
holder.binding.cardviewContainer.setBackgroundColor(theme_statuses_color);
|
||||||
} else {
|
|
||||||
holder.binding.cardviewContainer.setBackgroundColor(ContextCompat.getColor(context, R.color.cyanea_primary_dark_reference));
|
|
||||||
}
|
}
|
||||||
if (theme_text_header_2_line != -1) {
|
if (theme_text_header_2_line != -1) {
|
||||||
holder.binding.username.setTextColor(theme_text_header_2_line);
|
holder.binding.username.setTextColor(theme_text_header_2_line);
|
||||||
|
|
|
@ -130,7 +130,7 @@ public class StatusScheduledAdapter extends RecyclerView.Adapter<StatusScheduled
|
||||||
|
|
||||||
});
|
});
|
||||||
holder.binding.delete.setOnClickListener(v -> {
|
holder.binding.delete.setOnClickListener(v -> {
|
||||||
AlertDialog.Builder unfollowConfirm = new AlertDialog.Builder(context, Helper.dialogStyle());
|
AlertDialog.Builder unfollowConfirm = new AlertDialog.Builder(context);
|
||||||
unfollowConfirm.setMessage(context.getString(R.string.remove_scheduled));
|
unfollowConfirm.setMessage(context.getString(R.string.remove_scheduled));
|
||||||
unfollowConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
|
unfollowConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
|
||||||
unfollowConfirm.setPositiveButton(R.string.delete, (dialog, which) -> {
|
unfollowConfirm.setPositiveButton(R.string.delete, (dialog, which) -> {
|
||||||
|
|
|
@ -18,7 +18,6 @@ package app.fedilab.android.ui.drawer;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.res.ColorStateList;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
@ -27,7 +26,6 @@ import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.core.app.ActivityOptionsCompat;
|
import androidx.core.app.ActivityOptionsCompat;
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
import androidx.lifecycle.ViewModelStoreOwner;
|
import androidx.lifecycle.ViewModelStoreOwner;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
@ -92,7 +90,6 @@ public class SuggestionAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
|
||||||
context.startActivity(intent, options.toBundle());
|
context.startActivity(intent, options.toBundle());
|
||||||
});
|
});
|
||||||
holder.binding.followAction.setIconResource(R.drawable.ic_baseline_person_add_24);
|
holder.binding.followAction.setIconResource(R.drawable.ic_baseline_person_add_24);
|
||||||
holder.binding.followAction.setBackgroundTintList(ColorStateList.valueOf(ContextCompat.getColor(context, R.color.cyanea_accent_dark_reference)));
|
|
||||||
if (account == null) {
|
if (account == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,6 @@ import android.view.LayoutInflater;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import com.github.mikephil.charting.components.Description;
|
import com.github.mikephil.charting.components.Description;
|
||||||
|
@ -67,9 +66,6 @@ public class TagAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
||||||
}
|
}
|
||||||
tagViewHolder.binding.tagStats.setText(context.getString(R.string.talking_about, stat));
|
tagViewHolder.binding.tagStats.setText(context.getString(R.string.talking_about, stat));
|
||||||
LineDataSet dataTrending = new LineDataSet(trendsEntry, context.getString(R.string.trending));
|
LineDataSet dataTrending = new LineDataSet(trendsEntry, context.getString(R.string.trending));
|
||||||
dataTrending.setColor(ContextCompat.getColor(context, R.color.cyanea_accent_reference));
|
|
||||||
dataTrending.setValueTextColor(ContextCompat.getColor(context, R.color.cyanea_accent_reference));
|
|
||||||
dataTrending.setFillColor(ContextCompat.getColor(context, R.color.cyanea_accent_reference));
|
|
||||||
dataTrending.setDrawValues(false);
|
dataTrending.setDrawValues(false);
|
||||||
dataTrending.setDrawFilled(true);
|
dataTrending.setDrawFilled(true);
|
||||||
dataTrending.setDrawCircles(false);
|
dataTrending.setDrawCircles(false);
|
||||||
|
|
|
@ -83,7 +83,7 @@ public class TopMenuAdapter extends RecyclerView.Adapter<TopMenuAdapter.TopMenuH
|
||||||
//Manage item decoration below the text
|
//Manage item decoration below the text
|
||||||
if (pinnedTimeline.isSelected) {
|
if (pinnedTimeline.isSelected) {
|
||||||
holder.binding.underline.setVisibility(View.VISIBLE);
|
holder.binding.underline.setVisibility(View.VISIBLE);
|
||||||
holder.binding.name.setTextColor(ResourcesCompat.getColor(_mContext.getResources(), R.color.cyanea_accent, _mContext.getTheme()));
|
holder.binding.name.setTextColor(ResourcesCompat.getColor(_mContext.getResources(), R.color.colorAccent, _mContext.getTheme()));
|
||||||
} else {
|
} else {
|
||||||
holder.binding.underline.setVisibility(View.GONE);
|
holder.binding.underline.setVisibility(View.GONE);
|
||||||
int textColor = _mContext.getResources().getColor(android.R.color.primary_text_dark);
|
int textColor = _mContext.getResources().getColor(android.R.color.primary_text_dark);
|
||||||
|
|
|
@ -63,7 +63,6 @@ public class FragmentAdminAccount extends Fragment {
|
||||||
}
|
}
|
||||||
flagLoading = false;
|
flagLoading = false;
|
||||||
binding = FragmentPaginationBinding.inflate(inflater, container, false);
|
binding = FragmentPaginationBinding.inflate(inflater, container, false);
|
||||||
binding.getRoot().setBackgroundColor(ThemeHelper.getBackgroundColor(requireActivity()));
|
|
||||||
return binding.getRoot();
|
return binding.getRoot();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,8 +86,7 @@ public class FragmentAdminAccount extends Fragment {
|
||||||
@Override
|
@Override
|
||||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||||
super.onViewCreated(view, savedInstanceState);
|
super.onViewCreated(view, savedInstanceState);
|
||||||
int c1 = getResources().getColor(R.color.cyanea_accent_reference);
|
int c1 = ThemeHelper.getAttColor(requireActivity(), R.attr.colorAccent);
|
||||||
binding.swipeContainer.setProgressBackgroundColorSchemeColor(getResources().getColor(R.color.cyanea_primary_reference));
|
|
||||||
binding.swipeContainer.setColorSchemeColors(
|
binding.swipeContainer.setColorSchemeColors(
|
||||||
c1, c1, c1
|
c1, c1, c1
|
||||||
);
|
);
|
||||||
|
|
|
@ -112,10 +112,8 @@ public class FragmentAdminDomain extends Fragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
binding = FragmentPaginationBinding.inflate(inflater, container, false);
|
binding = FragmentPaginationBinding.inflate(inflater, container, false);
|
||||||
binding.getRoot().setBackgroundColor(ThemeHelper.getBackgroundColor(requireActivity()));
|
|
||||||
|
|
||||||
int c1 = getResources().getColor(R.color.cyanea_accent_reference);
|
int c1 = ThemeHelper.getAttColor(requireActivity(), R.attr.colorAccent);
|
||||||
binding.swipeContainer.setProgressBackgroundColorSchemeColor(getResources().getColor(R.color.cyanea_primary_reference));
|
|
||||||
binding.swipeContainer.setColorSchemeColors(
|
binding.swipeContainer.setColorSchemeColors(
|
||||||
c1, c1, c1
|
c1, c1, c1
|
||||||
);
|
);
|
||||||
|
|
|
@ -69,10 +69,8 @@ public class FragmentAdminReport extends Fragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
binding = FragmentPaginationBinding.inflate(inflater, container, false);
|
binding = FragmentPaginationBinding.inflate(inflater, container, false);
|
||||||
binding.getRoot().setBackgroundColor(ThemeHelper.getBackgroundColor(requireActivity()));
|
|
||||||
|
|
||||||
int c1 = getResources().getColor(R.color.cyanea_accent_reference);
|
int c1 = ThemeHelper.getAttColor(requireActivity(), R.attr.colorAccent);
|
||||||
binding.swipeContainer.setProgressBackgroundColorSchemeColor(getResources().getColor(R.color.cyanea_primary_reference));
|
|
||||||
binding.swipeContainer.setColorSchemeColors(
|
binding.swipeContainer.setColorSchemeColors(
|
||||||
c1, c1, c1
|
c1, c1, c1
|
||||||
);
|
);
|
||||||
|
|
|
@ -28,7 +28,6 @@ import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.text.Editable;
|
import android.text.Editable;
|
||||||
import android.text.TextWatcher;
|
import android.text.TextWatcher;
|
||||||
import android.view.ContextThemeWrapper;
|
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.MenuInflater;
|
import android.view.MenuInflater;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
|
@ -182,7 +181,7 @@ public class FragmentLoginMain extends Fragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showMenu(View v) {
|
private void showMenu(View v) {
|
||||||
PopupMenu popupMenu = new PopupMenu(new ContextThemeWrapper(requireActivity(), Helper.popupStyle()), binding.menuIcon);
|
PopupMenu popupMenu = new PopupMenu(requireActivity(), binding.menuIcon);
|
||||||
MenuInflater menuInflater = popupMenu.getMenuInflater();
|
MenuInflater menuInflater = popupMenu.getMenuInflater();
|
||||||
menuInflater.inflate(R.menu.main_login, popupMenu.getMenu());
|
menuInflater.inflate(R.menu.main_login, popupMenu.getMenu());
|
||||||
MenuItem customTabItem = popupMenu.getMenu().findItem(R.id.action_custom_tabs);
|
MenuItem customTabItem = popupMenu.getMenu().findItem(R.id.action_custom_tabs);
|
||||||
|
|
|
@ -165,7 +165,7 @@ public class FragmentLoginRegisterMastodon extends Fragment {
|
||||||
Locale.getDefault().getLanguage(), null
|
Locale.getDefault().getLanguage(), null
|
||||||
).observe(requireActivity(), token -> {
|
).observe(requireActivity(), token -> {
|
||||||
if (token != null) {
|
if (token != null) {
|
||||||
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(requireActivity(), Helper.dialogStyle());
|
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(requireActivity());
|
||||||
dialogBuilder.setCancelable(false);
|
dialogBuilder.setCancelable(false);
|
||||||
dialogBuilder.setPositiveButton(R.string.validate, (dialog, which) -> {
|
dialogBuilder.setPositiveButton(R.string.validate, (dialog, which) -> {
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
|
|
|
@ -25,7 +25,6 @@ import androidx.preference.SwitchPreferenceCompat;
|
||||||
|
|
||||||
import app.fedilab.android.BaseMainActivity;
|
import app.fedilab.android.BaseMainActivity;
|
||||||
import app.fedilab.android.R;
|
import app.fedilab.android.R;
|
||||||
import app.fedilab.android.helper.Helper;
|
|
||||||
|
|
||||||
public class FragmentComposeSettings extends PreferenceFragmentCompat implements SharedPreferences.OnSharedPreferenceChangeListener {
|
public class FragmentComposeSettings extends PreferenceFragmentCompat implements SharedPreferences.OnSharedPreferenceChangeListener {
|
||||||
|
|
||||||
|
@ -38,7 +37,6 @@ public class FragmentComposeSettings extends PreferenceFragmentCompat implements
|
||||||
private void createPref() {
|
private void createPref() {
|
||||||
SwitchPreferenceCompat SET_WATERMARK = findPreference(getString(R.string.SET_WATERMARK));
|
SwitchPreferenceCompat SET_WATERMARK = findPreference(getString(R.string.SET_WATERMARK));
|
||||||
if (SET_WATERMARK != null) {
|
if (SET_WATERMARK != null) {
|
||||||
SET_WATERMARK.getContext().setTheme(Helper.dialogStyle());
|
|
||||||
}
|
}
|
||||||
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity());
|
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity());
|
||||||
EditTextPreference SET_WATERMARK_TEXT = findPreference(getString(R.string.SET_WATERMARK_TEXT));
|
EditTextPreference SET_WATERMARK_TEXT = findPreference(getString(R.string.SET_WATERMARK_TEXT));
|
||||||
|
@ -47,10 +45,6 @@ public class FragmentComposeSettings extends PreferenceFragmentCompat implements
|
||||||
SET_WATERMARK_TEXT.setText(val);
|
SET_WATERMARK_TEXT.setText(val);
|
||||||
}
|
}
|
||||||
MultiSelectListPreference SET_SELECTED_LANGUAGE = findPreference(getString(R.string.SET_SELECTED_LANGUAGE));
|
MultiSelectListPreference SET_SELECTED_LANGUAGE = findPreference(getString(R.string.SET_SELECTED_LANGUAGE));
|
||||||
if (SET_SELECTED_LANGUAGE != null) {
|
|
||||||
SET_SELECTED_LANGUAGE.getContext().setTheme(Helper.dialogStyle());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -64,7 +64,6 @@ public class FragmentInterfaceSettings extends PreferenceFragmentCompat implemen
|
||||||
}
|
}
|
||||||
ListPreference SET_LOGO_LAUNCHER = findPreference(getString(R.string.SET_LOGO_LAUNCHER));
|
ListPreference SET_LOGO_LAUNCHER = findPreference(getString(R.string.SET_LOGO_LAUNCHER));
|
||||||
if (SET_LOGO_LAUNCHER != null) {
|
if (SET_LOGO_LAUNCHER != null) {
|
||||||
SET_LOGO_LAUNCHER.getContext().setTheme(Helper.dialogStyle());
|
|
||||||
SET_LOGO_LAUNCHER.setIcon(LogoHelper.getDrawable(SET_LOGO_LAUNCHER.getValue()));
|
SET_LOGO_LAUNCHER.setIcon(LogoHelper.getDrawable(SET_LOGO_LAUNCHER.getValue()));
|
||||||
}
|
}
|
||||||
recreate = false;
|
recreate = false;
|
||||||
|
|
|
@ -37,9 +37,6 @@ public class FragmentLanguageSettings extends PreferenceFragmentCompat implement
|
||||||
@SuppressLint("ApplySharedPref")
|
@SuppressLint("ApplySharedPref")
|
||||||
private void createPref() {
|
private void createPref() {
|
||||||
ListPreference SET_DEFAULT_LOCALE_NEW = findPreference(getString(R.string.SET_DEFAULT_LOCALE_NEW));
|
ListPreference SET_DEFAULT_LOCALE_NEW = findPreference(getString(R.string.SET_DEFAULT_LOCALE_NEW));
|
||||||
if (SET_DEFAULT_LOCALE_NEW != null) {
|
|
||||||
SET_DEFAULT_LOCALE_NEW.getContext().setTheme(Helper.dialogStyle());
|
|
||||||
}
|
|
||||||
|
|
||||||
Preference SET_TRANSLATE_VALUES_RESET = findPreference(getString(R.string.SET_TRANSLATE_VALUES_RESET));
|
Preference SET_TRANSLATE_VALUES_RESET = findPreference(getString(R.string.SET_TRANSLATE_VALUES_RESET));
|
||||||
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity());
|
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity());
|
||||||
|
|
|
@ -36,7 +36,6 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import app.fedilab.android.R;
|
import app.fedilab.android.R;
|
||||||
import app.fedilab.android.helper.Helper;
|
|
||||||
import app.fedilab.android.helper.PushHelper;
|
import app.fedilab.android.helper.PushHelper;
|
||||||
import app.fedilab.android.helper.settings.TimePreference;
|
import app.fedilab.android.helper.settings.TimePreference;
|
||||||
import app.fedilab.android.helper.settings.TimePreferenceDialogFragment;
|
import app.fedilab.android.helper.settings.TimePreferenceDialogFragment;
|
||||||
|
@ -80,9 +79,7 @@ public class FragmentNotificationsSettings extends PreferenceFragmentCompat impl
|
||||||
|
|
||||||
|
|
||||||
ListPreference SET_NOTIFICATION_TYPE = findPreference(getString(R.string.SET_NOTIFICATION_TYPE));
|
ListPreference SET_NOTIFICATION_TYPE = findPreference(getString(R.string.SET_NOTIFICATION_TYPE));
|
||||||
if (SET_NOTIFICATION_TYPE != null) {
|
|
||||||
SET_NOTIFICATION_TYPE.getContext().setTheme(Helper.dialogStyle());
|
|
||||||
}
|
|
||||||
String[] notificationValues = getResources().getStringArray(R.array.SET_NOTIFICATION_TYPE_VALUE);
|
String[] notificationValues = getResources().getStringArray(R.array.SET_NOTIFICATION_TYPE_VALUE);
|
||||||
if (SET_NOTIFICATION_TYPE != null && SET_NOTIFICATION_TYPE.getValue().equals(notificationValues[2])) {
|
if (SET_NOTIFICATION_TYPE != null && SET_NOTIFICATION_TYPE.getValue().equals(notificationValues[2])) {
|
||||||
PreferenceCategory notification_sounds = findPreference("notification_sounds");
|
PreferenceCategory notification_sounds = findPreference("notification_sounds");
|
||||||
|
@ -108,9 +105,7 @@ public class FragmentNotificationsSettings extends PreferenceFragmentCompat impl
|
||||||
return;
|
return;
|
||||||
} else if (SET_NOTIFICATION_TYPE != null && SET_NOTIFICATION_TYPE.getValue().equals(notificationValues[1])) {
|
} else if (SET_NOTIFICATION_TYPE != null && SET_NOTIFICATION_TYPE.getValue().equals(notificationValues[1])) {
|
||||||
ListPreference SET_NOTIFICATION_DELAY_VALUE = findPreference(getString(R.string.SET_NOTIFICATION_DELAY_VALUE));
|
ListPreference SET_NOTIFICATION_DELAY_VALUE = findPreference(getString(R.string.SET_NOTIFICATION_DELAY_VALUE));
|
||||||
if (SET_NOTIFICATION_DELAY_VALUE != null) {
|
|
||||||
SET_NOTIFICATION_DELAY_VALUE.getContext().setTheme(Helper.dialogStyle());
|
|
||||||
}
|
|
||||||
ListPreference SET_PUSH_DISTRIBUTOR = findPreference("SET_PUSH_DISTRIBUTOR");
|
ListPreference SET_PUSH_DISTRIBUTOR = findPreference("SET_PUSH_DISTRIBUTOR");
|
||||||
if (SET_PUSH_DISTRIBUTOR != null) {
|
if (SET_PUSH_DISTRIBUTOR != null) {
|
||||||
preferenceScreen.removePreferenceRecursively("SET_PUSH_DISTRIBUTOR");
|
preferenceScreen.removePreferenceRecursively("SET_PUSH_DISTRIBUTOR");
|
||||||
|
@ -122,7 +117,6 @@ public class FragmentNotificationsSettings extends PreferenceFragmentCompat impl
|
||||||
}
|
}
|
||||||
ListPreference SET_PUSH_DISTRIBUTOR = findPreference(getString(R.string.SET_PUSH_DISTRIBUTOR));
|
ListPreference SET_PUSH_DISTRIBUTOR = findPreference(getString(R.string.SET_PUSH_DISTRIBUTOR));
|
||||||
if (SET_PUSH_DISTRIBUTOR != null) {
|
if (SET_PUSH_DISTRIBUTOR != null) {
|
||||||
SET_PUSH_DISTRIBUTOR.getContext().setTheme(Helper.dialogStyle());
|
|
||||||
List<String> distributors = UnifiedPush.getDistributors(requireActivity(), new ArrayList<>());
|
List<String> distributors = UnifiedPush.getDistributors(requireActivity(), new ArrayList<>());
|
||||||
SET_PUSH_DISTRIBUTOR.setValue(UnifiedPush.getDistributor(requireActivity()));
|
SET_PUSH_DISTRIBUTOR.setValue(UnifiedPush.getDistributor(requireActivity()));
|
||||||
SET_PUSH_DISTRIBUTOR.setEntries(distributors.toArray(new String[0]));
|
SET_PUSH_DISTRIBUTOR.setEntries(distributors.toArray(new String[0]));
|
||||||
|
|
|
@ -22,7 +22,6 @@ import androidx.preference.EditTextPreference;
|
||||||
import androidx.preference.PreferenceFragmentCompat;
|
import androidx.preference.PreferenceFragmentCompat;
|
||||||
|
|
||||||
import app.fedilab.android.R;
|
import app.fedilab.android.R;
|
||||||
import app.fedilab.android.helper.Helper;
|
|
||||||
|
|
||||||
public class FragmentPrivacySettings extends PreferenceFragmentCompat implements SharedPreferences.OnSharedPreferenceChangeListener {
|
public class FragmentPrivacySettings extends PreferenceFragmentCompat implements SharedPreferences.OnSharedPreferenceChangeListener {
|
||||||
|
|
||||||
|
@ -34,9 +33,6 @@ public class FragmentPrivacySettings extends PreferenceFragmentCompat implements
|
||||||
|
|
||||||
private void createPref() {
|
private void createPref() {
|
||||||
EditTextPreference SET_INVIDIOUS_HOST = findPreference(getString(R.string.SET_INVIDIOUS_HOST));
|
EditTextPreference SET_INVIDIOUS_HOST = findPreference(getString(R.string.SET_INVIDIOUS_HOST));
|
||||||
if (SET_INVIDIOUS_HOST != null) {
|
|
||||||
SET_INVIDIOUS_HOST.getContext().setTheme(Helper.dialogStyle());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -44,9 +44,6 @@ import androidx.preference.PreferenceFragmentCompat;
|
||||||
import androidx.preference.PreferenceManager;
|
import androidx.preference.PreferenceManager;
|
||||||
|
|
||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
import com.jaredrummler.cyanea.Cyanea;
|
|
||||||
import com.jaredrummler.cyanea.prefs.CyaneaSettingsActivity;
|
|
||||||
import com.jaredrummler.cyanea.prefs.CyaneaTheme;
|
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
|
@ -63,7 +60,6 @@ import java.util.List;
|
||||||
|
|
||||||
import app.fedilab.android.R;
|
import app.fedilab.android.R;
|
||||||
import app.fedilab.android.activities.ComposeActivity;
|
import app.fedilab.android.activities.ComposeActivity;
|
||||||
import app.fedilab.android.activities.SettingsActivity;
|
|
||||||
import app.fedilab.android.databinding.PopupStatusThemeBinding;
|
import app.fedilab.android.databinding.PopupStatusThemeBinding;
|
||||||
import app.fedilab.android.helper.Helper;
|
import app.fedilab.android.helper.Helper;
|
||||||
import app.fedilab.android.helper.ThemeHelper;
|
import app.fedilab.android.helper.ThemeHelper;
|
||||||
|
@ -76,7 +72,6 @@ public class FragmentThemingSettings extends PreferenceFragmentCompat implements
|
||||||
private List<LinkedHashMap<String, String>> listOfThemes;
|
private List<LinkedHashMap<String, String>> listOfThemes;
|
||||||
private SharedPreferences appPref;
|
private SharedPreferences appPref;
|
||||||
private SharedPreferences cyneaPref;
|
private SharedPreferences cyneaPref;
|
||||||
public ActionTheming actionTheming;
|
|
||||||
private boolean shouldRestart;
|
private boolean shouldRestart;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -86,7 +81,6 @@ public class FragmentThemingSettings extends PreferenceFragmentCompat implements
|
||||||
createPref();
|
createPref();
|
||||||
listOfThemes = ThemeHelper.getContributorsTheme(requireActivity());
|
listOfThemes = ThemeHelper.getContributorsTheme(requireActivity());
|
||||||
shouldRestart = false;
|
shouldRestart = false;
|
||||||
actionTheming = (SettingsActivity) requireActivity();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -106,9 +100,7 @@ public class FragmentThemingSettings extends PreferenceFragmentCompat implements
|
||||||
getPreferenceScreen().getSharedPreferences()
|
getPreferenceScreen().getSharedPreferences()
|
||||||
.unregisterOnSharedPreferenceChangeListener(this);
|
.unregisterOnSharedPreferenceChangeListener(this);
|
||||||
}
|
}
|
||||||
if (shouldRestart && actionTheming != null) {
|
|
||||||
actionTheming.restart();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -121,9 +113,6 @@ public class FragmentThemingSettings extends PreferenceFragmentCompat implements
|
||||||
Helper.recreateMainActivity(requireActivity());
|
Helper.recreateMainActivity(requireActivity());
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface ActionTheming {
|
|
||||||
void restart();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
|
@ -264,7 +253,7 @@ public class FragmentThemingSettings extends PreferenceFragmentCompat implements
|
||||||
br = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8));
|
br = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8));
|
||||||
String sCurrentLine;
|
String sCurrentLine;
|
||||||
SharedPreferences.Editor appEditor = appPref.edit();
|
SharedPreferences.Editor appEditor = appPref.edit();
|
||||||
Cyanea.Editor cyaneaEditor = Cyanea.getInstance().edit();
|
|
||||||
appEditor.putBoolean("use_custom_theme", true);
|
appEditor.putBoolean("use_custom_theme", true);
|
||||||
while ((sCurrentLine = br.readLine()) != null) {
|
while ((sCurrentLine = br.readLine()) != null) {
|
||||||
String[] line = sCurrentLine.split(",");
|
String[] line = sCurrentLine.split(",");
|
||||||
|
@ -272,35 +261,15 @@ public class FragmentThemingSettings extends PreferenceFragmentCompat implements
|
||||||
String key = line[0];
|
String key = line[0];
|
||||||
String value = line[1];
|
String value = line[1];
|
||||||
if (key.compareTo("pref_color_navigation_bar") == 0) {
|
if (key.compareTo("pref_color_navigation_bar") == 0) {
|
||||||
cyaneaEditor.shouldTintNavBar(Boolean.parseBoolean(value));
|
|
||||||
} else if (key.compareTo("pref_color_background") == 0) {
|
} else if (key.compareTo("pref_color_background") == 0) {
|
||||||
cyaneaEditor.backgroundDarkLighter(Integer.parseInt(value));
|
|
||||||
cyaneaEditor.backgroundLightDarker(Integer.parseInt(value));
|
|
||||||
cyaneaEditor.backgroundDark(Integer.parseInt(value));
|
|
||||||
cyaneaEditor.backgroundLightLighter(Integer.parseInt(value));
|
|
||||||
cyaneaEditor.backgroundDarkDarker(Integer.parseInt(value));
|
|
||||||
cyaneaEditor.background(Integer.parseInt(value));
|
|
||||||
cyaneaEditor.backgroundDark(Integer.parseInt(value));
|
|
||||||
cyaneaEditor.backgroundLight(Integer.parseInt(value));
|
|
||||||
} else if (key.compareTo("base_theme") == 0) {
|
} else if (key.compareTo("base_theme") == 0) {
|
||||||
List<CyaneaTheme> list = CyaneaTheme.Companion.from(requireActivity().getAssets(), "themes/cyanea_themes.json");
|
|
||||||
CyaneaTheme theme = list.get(Integer.parseInt(value));
|
|
||||||
cyaneaEditor.baseTheme(theme.getBaseTheme());
|
|
||||||
if (Integer.parseInt(value) == 0 || Integer.parseInt(value) == 2) {
|
|
||||||
cyaneaEditor.menuIconColor(ContextCompat.getColor(requireActivity(), R.color.dark_text));
|
|
||||||
cyaneaEditor.subMenuIconColor(ContextCompat.getColor(requireActivity(), R.color.dark_text));
|
|
||||||
} else {
|
|
||||||
cyaneaEditor.menuIconColor(ContextCompat.getColor(requireActivity(), R.color.black));
|
|
||||||
cyaneaEditor.subMenuIconColor(ContextCompat.getColor(requireActivity(), R.color.black));
|
|
||||||
}
|
|
||||||
} else if (key.compareTo("theme_accent") == 0) {
|
} else if (key.compareTo("theme_accent") == 0) {
|
||||||
cyaneaEditor.accentLight(Integer.parseInt(value));
|
|
||||||
cyaneaEditor.accent(Integer.parseInt(value));
|
|
||||||
cyaneaEditor.accentDark(Integer.parseInt(value));
|
|
||||||
} else if (key.compareTo("theme_primary") == 0) {
|
} else if (key.compareTo("theme_primary") == 0) {
|
||||||
cyaneaEditor.primary(Integer.parseInt(value));
|
|
||||||
cyaneaEditor.primaryLight(Integer.parseInt(value));
|
|
||||||
cyaneaEditor.primaryDark(Integer.parseInt(value));
|
|
||||||
} else {
|
} else {
|
||||||
if (value != null && value.matches("-?\\d+")) {
|
if (value != null && value.matches("-?\\d+")) {
|
||||||
appEditor.putInt(key, Integer.parseInt(value));
|
appEditor.putInt(key, Integer.parseInt(value));
|
||||||
|
@ -311,7 +280,6 @@ public class FragmentThemingSettings extends PreferenceFragmentCompat implements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
appEditor.commit();
|
appEditor.commit();
|
||||||
cyaneaEditor.apply().recreate(requireActivity());
|
|
||||||
Helper.recreateMainActivity(requireActivity());
|
Helper.recreateMainActivity(requireActivity());
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
@ -337,7 +305,7 @@ public class FragmentThemingSettings extends PreferenceFragmentCompat implements
|
||||||
Preference launch_custom_theme = findPreference("launch_custom_theme");
|
Preference launch_custom_theme = findPreference("launch_custom_theme");
|
||||||
if (launch_custom_theme != null) {
|
if (launch_custom_theme != null) {
|
||||||
launch_custom_theme.setOnPreferenceClickListener(preference -> {
|
launch_custom_theme.setOnPreferenceClickListener(preference -> {
|
||||||
startActivity(new Intent(requireActivity(), CyaneaSettingsActivity.class));
|
|
||||||
shouldRestart = true;
|
shouldRestart = true;
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
@ -347,7 +315,7 @@ public class FragmentThemingSettings extends PreferenceFragmentCompat implements
|
||||||
if (contributors_themes != null) {
|
if (contributors_themes != null) {
|
||||||
contributors_themes.setOnPreferenceClickListener(preference -> {
|
contributors_themes.setOnPreferenceClickListener(preference -> {
|
||||||
final int[] currentPosition = {0};
|
final int[] currentPosition = {0};
|
||||||
AlertDialog.Builder builderSingle = new AlertDialog.Builder(requireActivity(), Helper.dialogStyle());
|
AlertDialog.Builder builderSingle = new AlertDialog.Builder(requireActivity());
|
||||||
builderSingle.setTitle(getString(R.string.select_a_theme));
|
builderSingle.setTitle(getString(R.string.select_a_theme));
|
||||||
PopupStatusThemeBinding binding = PopupStatusThemeBinding.inflate(getLayoutInflater(), new LinearLayout(requireActivity()), false);
|
PopupStatusThemeBinding binding = PopupStatusThemeBinding.inflate(getLayoutInflater(), new LinearLayout(requireActivity()), false);
|
||||||
binding.selectTheme.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
binding.selectTheme.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||||
|
@ -392,9 +360,7 @@ public class FragmentThemingSettings extends PreferenceFragmentCompat implements
|
||||||
}
|
}
|
||||||
|
|
||||||
ListPreference settings_theme = findPreference("settings_theme");
|
ListPreference settings_theme = findPreference("settings_theme");
|
||||||
if (settings_theme != null) {
|
|
||||||
settings_theme.getContext().setTheme(Helper.dialogStyle());
|
|
||||||
}
|
|
||||||
|
|
||||||
Preference theme_link_color = findPreference("theme_link_color");
|
Preference theme_link_color = findPreference("theme_link_color");
|
||||||
Preference theme_boost_header_color = findPreference("theme_boost_header_color");
|
Preference theme_boost_header_color = findPreference("theme_boost_header_color");
|
||||||
|
@ -469,7 +435,7 @@ public class FragmentThemingSettings extends PreferenceFragmentCompat implements
|
||||||
}
|
}
|
||||||
if (reset_pref != null) {
|
if (reset_pref != null) {
|
||||||
reset_pref.setOnPreferenceClickListener(preference -> {
|
reset_pref.setOnPreferenceClickListener(preference -> {
|
||||||
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(requireActivity(), Helper.dialogStyle());
|
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(requireActivity());
|
||||||
dialogBuilder.setMessage(R.string.reset_color);
|
dialogBuilder.setMessage(R.string.reset_color);
|
||||||
dialogBuilder.setPositiveButton(R.string.reset, (dialog, id) -> {
|
dialogBuilder.setPositiveButton(R.string.reset, (dialog, id) -> {
|
||||||
reset();
|
reset();
|
||||||
|
|
|
@ -22,7 +22,6 @@ import androidx.preference.PreferenceFragmentCompat;
|
||||||
import androidx.preference.PreferenceManager;
|
import androidx.preference.PreferenceManager;
|
||||||
|
|
||||||
import app.fedilab.android.R;
|
import app.fedilab.android.R;
|
||||||
import app.fedilab.android.helper.Helper;
|
|
||||||
|
|
||||||
public class FragmentTimelinesSettings extends PreferenceFragmentCompat implements SharedPreferences.OnSharedPreferenceChangeListener {
|
public class FragmentTimelinesSettings extends PreferenceFragmentCompat implements SharedPreferences.OnSharedPreferenceChangeListener {
|
||||||
|
|
||||||
|
@ -35,7 +34,6 @@ public class FragmentTimelinesSettings extends PreferenceFragmentCompat implemen
|
||||||
private void createPref() {
|
private void createPref() {
|
||||||
ListPreference SET_LOAD_MEDIA_TYPE = findPreference(getString(R.string.SET_LOAD_MEDIA_TYPE));
|
ListPreference SET_LOAD_MEDIA_TYPE = findPreference(getString(R.string.SET_LOAD_MEDIA_TYPE));
|
||||||
if (SET_LOAD_MEDIA_TYPE != null) {
|
if (SET_LOAD_MEDIA_TYPE != null) {
|
||||||
SET_LOAD_MEDIA_TYPE.getContext().setTheme(Helper.dialogStyle());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -74,15 +74,13 @@ public class FragmentMastodonAccount extends Fragment {
|
||||||
}
|
}
|
||||||
flagLoading = false;
|
flagLoading = false;
|
||||||
binding = FragmentPaginationBinding.inflate(inflater, container, false);
|
binding = FragmentPaginationBinding.inflate(inflater, container, false);
|
||||||
binding.getRoot().setBackgroundColor(ThemeHelper.getBackgroundColor(requireActivity()));
|
|
||||||
return binding.getRoot();
|
return binding.getRoot();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||||
super.onViewCreated(view, savedInstanceState);
|
super.onViewCreated(view, savedInstanceState);
|
||||||
int c1 = getResources().getColor(R.color.cyanea_accent_reference);
|
int c1 = ThemeHelper.getAttColor(requireActivity(), R.attr.colorAccent);
|
||||||
binding.swipeContainer.setProgressBackgroundColorSchemeColor(getResources().getColor(R.color.cyanea_primary_reference));
|
|
||||||
binding.swipeContainer.setColorSchemeColors(
|
binding.swipeContainer.setColorSchemeColors(
|
||||||
c1, c1, c1
|
c1, c1, c1
|
||||||
);
|
);
|
||||||
|
|
|
@ -47,9 +47,7 @@ public class FragmentMastodonAnnouncement extends Fragment {
|
||||||
|
|
||||||
binding = FragmentPaginationBinding.inflate(inflater, container, false);
|
binding = FragmentPaginationBinding.inflate(inflater, container, false);
|
||||||
View root = binding.getRoot();
|
View root = binding.getRoot();
|
||||||
binding.getRoot().setBackgroundColor(ThemeHelper.getBackgroundColor(requireActivity()));
|
int c1 = ThemeHelper.getAttColor(requireActivity(), R.attr.colorAccent);
|
||||||
int c1 = getResources().getColor(R.color.cyanea_accent_reference);
|
|
||||||
binding.swipeContainer.setProgressBackgroundColorSchemeColor(getResources().getColor(R.color.cyanea_primary_reference));
|
|
||||||
binding.swipeContainer.setColorSchemeColors(
|
binding.swipeContainer.setColorSchemeColors(
|
||||||
c1, c1, c1
|
c1, c1, c1
|
||||||
);
|
);
|
||||||
|
|
|
@ -151,12 +151,10 @@ public class FragmentMastodonContext extends Fragment {
|
||||||
getChildFragmentManager().beginTransaction().remove(this).commit();
|
getChildFragmentManager().beginTransaction().remove(this).commit();
|
||||||
}
|
}
|
||||||
binding = FragmentPaginationBinding.inflate(inflater, container, false);
|
binding = FragmentPaginationBinding.inflate(inflater, container, false);
|
||||||
int c1 = getResources().getColor(R.color.cyanea_accent_reference);
|
int c1 = ThemeHelper.getAttColor(requireActivity(), R.attr.colorAccent);
|
||||||
binding.swipeContainer.setProgressBackgroundColorSchemeColor(getResources().getColor(R.color.cyanea_primary_reference));
|
|
||||||
binding.swipeContainer.setColorSchemeColors(
|
binding.swipeContainer.setColorSchemeColors(
|
||||||
c1, c1, c1
|
c1, c1, c1
|
||||||
);
|
);
|
||||||
binding.getRoot().setBackgroundColor(ThemeHelper.getBackgroundColor(requireActivity()));
|
|
||||||
statusesVM = new ViewModelProvider(FragmentMastodonContext.this).get(StatusesVM.class);
|
statusesVM = new ViewModelProvider(FragmentMastodonContext.this).get(StatusesVM.class);
|
||||||
binding.recyclerView.setNestedScrollingEnabled(true);
|
binding.recyclerView.setNestedScrollingEnabled(true);
|
||||||
this.statuses = new ArrayList<>();
|
this.statuses = new ArrayList<>();
|
||||||
|
|
|
@ -81,7 +81,6 @@ public class FragmentMastodonConversation extends Fragment implements Conversati
|
||||||
ViewGroup container, Bundle savedInstanceState) {
|
ViewGroup container, Bundle savedInstanceState) {
|
||||||
flagLoading = false;
|
flagLoading = false;
|
||||||
binding = FragmentPaginationBinding.inflate(inflater, container, false);
|
binding = FragmentPaginationBinding.inflate(inflater, container, false);
|
||||||
binding.getRoot().setBackgroundColor(ThemeHelper.getBackgroundColor(requireActivity()));
|
|
||||||
isViewInitialized = false;
|
isViewInitialized = false;
|
||||||
return binding.getRoot();
|
return binding.getRoot();
|
||||||
}
|
}
|
||||||
|
@ -239,8 +238,7 @@ public class FragmentMastodonConversation extends Fragment implements Conversati
|
||||||
super.onViewCreated(view, savedInstanceState);
|
super.onViewCreated(view, savedInstanceState);
|
||||||
|
|
||||||
|
|
||||||
int c1 = getResources().getColor(R.color.cyanea_accent_reference);
|
int c1 = ThemeHelper.getAttColor(requireActivity(), R.attr.colorAccent);
|
||||||
binding.swipeContainer.setProgressBackgroundColorSchemeColor(getResources().getColor(R.color.cyanea_primary_reference));
|
|
||||||
binding.swipeContainer.setColorSchemeColors(
|
binding.swipeContainer.setColorSchemeColors(
|
||||||
c1, c1, c1
|
c1, c1, c1
|
||||||
);
|
);
|
||||||
|
|
|
@ -53,15 +53,13 @@ public class FragmentMastodonDomainBlock extends Fragment {
|
||||||
ViewGroup container, Bundle savedInstanceState) {
|
ViewGroup container, Bundle savedInstanceState) {
|
||||||
|
|
||||||
binding = FragmentPaginationBinding.inflate(inflater, container, false);
|
binding = FragmentPaginationBinding.inflate(inflater, container, false);
|
||||||
binding.getRoot().setBackgroundColor(ThemeHelper.getBackgroundColor(requireActivity()));
|
|
||||||
return binding.getRoot();
|
return binding.getRoot();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||||
super.onViewCreated(view, savedInstanceState);
|
super.onViewCreated(view, savedInstanceState);
|
||||||
int c1 = getResources().getColor(R.color.cyanea_accent_reference);
|
int c1 = ThemeHelper.getAttColor(requireActivity(), R.attr.colorAccent);
|
||||||
binding.swipeContainer.setProgressBackgroundColorSchemeColor(getResources().getColor(R.color.cyanea_primary_reference));
|
|
||||||
binding.swipeContainer.setColorSchemeColors(
|
binding.swipeContainer.setColorSchemeColors(
|
||||||
c1, c1, c1
|
c1, c1, c1
|
||||||
);
|
);
|
||||||
|
|
|
@ -190,9 +190,7 @@ public class FragmentMastodonNotification extends Fragment implements Notificati
|
||||||
notificationType = (NotificationTypeEnum) getArguments().get(Helper.ARG_NOTIFICATION_TYPE);
|
notificationType = (NotificationTypeEnum) getArguments().get(Helper.ARG_NOTIFICATION_TYPE);
|
||||||
}
|
}
|
||||||
aggregateNotification = false;
|
aggregateNotification = false;
|
||||||
binding.getRoot().setBackgroundColor(ThemeHelper.getBackgroundColor(requireActivity()));
|
int c1 = ThemeHelper.getAttColor(requireActivity(), R.attr.colorAccent);
|
||||||
int c1 = getResources().getColor(R.color.cyanea_accent_reference);
|
|
||||||
binding.swipeContainer.setProgressBackgroundColorSchemeColor(getResources().getColor(R.color.cyanea_primary_reference));
|
|
||||||
binding.swipeContainer.setColorSchemeColors(
|
binding.swipeContainer.setColorSchemeColors(
|
||||||
c1, c1, c1
|
c1, c1, c1
|
||||||
);
|
);
|
||||||
|
|
|
@ -52,15 +52,13 @@ public class FragmentMastodonSuggestion extends Fragment {
|
||||||
ViewGroup container, Bundle savedInstanceState) {
|
ViewGroup container, Bundle savedInstanceState) {
|
||||||
flagLoading = false;
|
flagLoading = false;
|
||||||
binding = FragmentPaginationBinding.inflate(inflater, container, false);
|
binding = FragmentPaginationBinding.inflate(inflater, container, false);
|
||||||
binding.getRoot().setBackgroundColor(ThemeHelper.getBackgroundColor(requireActivity()));
|
|
||||||
return binding.getRoot();
|
return binding.getRoot();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||||
super.onViewCreated(view, savedInstanceState);
|
super.onViewCreated(view, savedInstanceState);
|
||||||
int c1 = getResources().getColor(R.color.cyanea_accent_reference);
|
int c1 = ThemeHelper.getAttColor(requireActivity(), R.attr.colorAccent);
|
||||||
binding.swipeContainer.setProgressBackgroundColorSchemeColor(getResources().getColor(R.color.cyanea_primary_reference));
|
|
||||||
binding.swipeContainer.setColorSchemeColors(
|
binding.swipeContainer.setColorSchemeColors(
|
||||||
c1, c1, c1
|
c1, c1, c1
|
||||||
);
|
);
|
||||||
|
|
|
@ -59,15 +59,13 @@ public class FragmentMastodonTag extends Fragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
binding = FragmentPaginationBinding.inflate(inflater, container, false);
|
binding = FragmentPaginationBinding.inflate(inflater, container, false);
|
||||||
binding.getRoot().setBackgroundColor(ThemeHelper.getBackgroundColor(requireActivity()));
|
|
||||||
return binding.getRoot();
|
return binding.getRoot();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||||
super.onViewCreated(view, savedInstanceState);
|
super.onViewCreated(view, savedInstanceState);
|
||||||
int c1 = getResources().getColor(R.color.cyanea_accent_reference);
|
int c1 = ThemeHelper.getAttColor(requireActivity(), R.attr.colorAccent);
|
||||||
binding.swipeContainer.setProgressBackgroundColorSchemeColor(getResources().getColor(R.color.cyanea_primary_reference));
|
|
||||||
binding.swipeContainer.setColorSchemeColors(
|
binding.swipeContainer.setColorSchemeColors(
|
||||||
c1, c1, c1
|
c1, c1, c1
|
||||||
);
|
);
|
||||||
|
|
|
@ -364,10 +364,8 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter.
|
||||||
|
|
||||||
LocalBroadcastManager.getInstance(requireActivity()).registerReceiver(receive_action, new IntentFilter(Helper.RECEIVE_STATUS_ACTION));
|
LocalBroadcastManager.getInstance(requireActivity()).registerReceiver(receive_action, new IntentFilter(Helper.RECEIVE_STATUS_ACTION));
|
||||||
binding = FragmentPaginationBinding.inflate(inflater, container, false);
|
binding = FragmentPaginationBinding.inflate(inflater, container, false);
|
||||||
binding.getRoot().setBackgroundColor(ThemeHelper.getBackgroundColor(requireActivity()));
|
|
||||||
|
|
||||||
int c1 = getResources().getColor(R.color.cyanea_accent_reference);
|
int c1 = ThemeHelper.getAttColor(requireActivity(), R.attr.colorAccent);
|
||||||
binding.swipeContainer.setProgressBackgroundColorSchemeColor(getResources().getColor(R.color.cyanea_primary_reference));
|
|
||||||
binding.swipeContainer.setColorSchemeColors(
|
binding.swipeContainer.setColorSchemeColors(
|
||||||
c1, c1, c1
|
c1, c1, c1
|
||||||
);
|
);
|
||||||
|
|
|
@ -27,9 +27,7 @@ import android.view.ViewGroup;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.core.content.res.ResourcesCompat;
|
import androidx.core.content.res.ResourcesCompat;
|
||||||
import androidx.core.graphics.drawable.DrawableCompat;
|
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
import androidx.preference.PreferenceManager;
|
import androidx.preference.PreferenceManager;
|
||||||
|
@ -45,8 +43,6 @@ import app.fedilab.android.BaseMainActivity;
|
||||||
import app.fedilab.android.R;
|
import app.fedilab.android.R;
|
||||||
import app.fedilab.android.databinding.FragmentNotificationContainerBinding;
|
import app.fedilab.android.databinding.FragmentNotificationContainerBinding;
|
||||||
import app.fedilab.android.databinding.PopupNotificationSettingsBinding;
|
import app.fedilab.android.databinding.PopupNotificationSettingsBinding;
|
||||||
import app.fedilab.android.helper.Helper;
|
|
||||||
import app.fedilab.android.helper.ThemeHelper;
|
|
||||||
import app.fedilab.android.ui.pageadapter.FedilabNotificationPageAdapter;
|
import app.fedilab.android.ui.pageadapter.FedilabNotificationPageAdapter;
|
||||||
import app.fedilab.android.viewmodel.mastodon.NotificationsVM;
|
import app.fedilab.android.viewmodel.mastodon.NotificationsVM;
|
||||||
import es.dmoral.toasty.Toasty;
|
import es.dmoral.toasty.Toasty;
|
||||||
|
@ -89,24 +85,13 @@ public class FragmentNotificationContainer extends Fragment {
|
||||||
}
|
}
|
||||||
AtomicBoolean changes = new AtomicBoolean(false);
|
AtomicBoolean changes = new AtomicBoolean(false);
|
||||||
binding.settings.setOnClickListener(v -> {
|
binding.settings.setOnClickListener(v -> {
|
||||||
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(requireActivity(), Helper.dialogStyle());
|
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(requireActivity());
|
||||||
PopupNotificationSettingsBinding dialogView = PopupNotificationSettingsBinding.inflate(getLayoutInflater());
|
PopupNotificationSettingsBinding dialogView = PopupNotificationSettingsBinding.inflate(getLayoutInflater());
|
||||||
dialogBuilder.setView(dialogView.getRoot());
|
dialogBuilder.setView(dialogView.getRoot());
|
||||||
|
|
||||||
ThemeHelper.changeButtonColor(requireActivity(), dialogView.displayMentions);
|
|
||||||
ThemeHelper.changeButtonColor(requireActivity(), dialogView.displayFavourites);
|
|
||||||
ThemeHelper.changeButtonColor(requireActivity(), dialogView.displayReblogs);
|
|
||||||
ThemeHelper.changeButtonColor(requireActivity(), dialogView.displayPollResults);
|
|
||||||
ThemeHelper.changeButtonColor(requireActivity(), dialogView.displayUpdatesFromPeople);
|
|
||||||
ThemeHelper.changeButtonColor(requireActivity(), dialogView.displayFollows);
|
|
||||||
ThemeHelper.changeButtonColor(requireActivity(), dialogView.displayUpdates);
|
|
||||||
ThemeHelper.changeButtonColor(requireActivity(), dialogView.displaySignups);
|
|
||||||
ThemeHelper.changeButtonColor(requireActivity(), dialogView.displayReports);
|
|
||||||
|
|
||||||
DrawableCompat.setTintList(DrawableCompat.wrap(dialogView.displayAllCategories.getThumbDrawable()), ThemeHelper.getSwitchCompatThumbDrawable(requireActivity()));
|
|
||||||
DrawableCompat.setTintList(DrawableCompat.wrap(dialogView.displayAllCategories.getTrackDrawable()), ThemeHelper.getSwitchCompatTrackDrawable(requireActivity()));
|
|
||||||
dialogView.clearAllNotif.setOnClickListener(v1 -> {
|
dialogView.clearAllNotif.setOnClickListener(v1 -> {
|
||||||
AlertDialog.Builder db = new AlertDialog.Builder(requireActivity(), Helper.dialogStyle());
|
AlertDialog.Builder db = new AlertDialog.Builder(requireActivity());
|
||||||
db.setTitle(R.string.delete_notification_ask_all);
|
db.setTitle(R.string.delete_notification_ask_all);
|
||||||
db.setMessage(R.string.delete_notification_all_warning);
|
db.setMessage(R.string.delete_notification_all_warning);
|
||||||
db.setPositiveButton(R.string.delete_all, (dialog, id) -> {
|
db.setPositiveButton(R.string.delete_all, (dialog, id) -> {
|
||||||
|
@ -233,8 +218,6 @@ public class FragmentNotificationContainer extends Fragment {
|
||||||
alertDialog.show();
|
alertDialog.show();
|
||||||
});
|
});
|
||||||
|
|
||||||
binding.tabLayout.setTabTextColors(ThemeHelper.getAttColor(requireActivity(), R.attr.mTextColor), ContextCompat.getColor(requireActivity(), R.color.cyanea_accent_dark_reference));
|
|
||||||
binding.tabLayout.setTabIconTint(ThemeHelper.getColorStateList(requireActivity()));
|
|
||||||
binding.viewpagerNotificationContainer.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(binding.tabLayout));
|
binding.viewpagerNotificationContainer.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(binding.tabLayout));
|
||||||
binding.tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
|
binding.tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -21,7 +21,6 @@ import android.view.ViewGroup;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
|
|
||||||
import com.google.android.material.tabs.TabLayout;
|
import com.google.android.material.tabs.TabLayout;
|
||||||
|
@ -30,7 +29,6 @@ import app.fedilab.android.R;
|
||||||
import app.fedilab.android.client.entities.api.Account;
|
import app.fedilab.android.client.entities.api.Account;
|
||||||
import app.fedilab.android.databinding.FragmentProfileTimelinesBinding;
|
import app.fedilab.android.databinding.FragmentProfileTimelinesBinding;
|
||||||
import app.fedilab.android.helper.Helper;
|
import app.fedilab.android.helper.Helper;
|
||||||
import app.fedilab.android.helper.ThemeHelper;
|
|
||||||
import app.fedilab.android.ui.pageadapter.FedilabProfilePageAdapter;
|
import app.fedilab.android.ui.pageadapter.FedilabProfilePageAdapter;
|
||||||
|
|
||||||
public class FragmentProfileTimeline extends Fragment {
|
public class FragmentProfileTimeline extends Fragment {
|
||||||
|
@ -56,8 +54,6 @@ public class FragmentProfileTimeline extends Fragment {
|
||||||
binding.tabLayout.addTab(binding.tabLayout.newTab().setText(getString(R.string.toots)));
|
binding.tabLayout.addTab(binding.tabLayout.newTab().setText(getString(R.string.toots)));
|
||||||
binding.tabLayout.addTab(binding.tabLayout.newTab().setText(getString(R.string.replies)));
|
binding.tabLayout.addTab(binding.tabLayout.newTab().setText(getString(R.string.replies)));
|
||||||
binding.tabLayout.addTab(binding.tabLayout.newTab().setText(getString(R.string.media)));
|
binding.tabLayout.addTab(binding.tabLayout.newTab().setText(getString(R.string.media)));
|
||||||
binding.tabLayout.setTabTextColors(ThemeHelper.getAttColor(requireActivity(), R.attr.mTextColor), ContextCompat.getColor(requireActivity(), R.color.cyanea_accent_dark_reference));
|
|
||||||
binding.tabLayout.setTabIconTint(ThemeHelper.getColorStateList(requireActivity()));
|
|
||||||
binding.viewpager.setAdapter(new FedilabProfilePageAdapter(getChildFragmentManager(), account, checkRemotely));
|
binding.viewpager.setAdapter(new FedilabProfilePageAdapter(getChildFragmentManager(), account, checkRemotely));
|
||||||
binding.viewpager.setOffscreenPageLimit(3);
|
binding.viewpager.setOffscreenPageLimit(3);
|
||||||
binding.viewpager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(binding.tabLayout));
|
binding.viewpager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(binding.tabLayout));
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
android:viewportWidth="24"
|
android:viewportWidth="24"
|
||||||
android:viewportHeight="24">
|
android:viewportHeight="24">
|
||||||
<path
|
<path
|
||||||
android:fillColor="@color/cyanea_accent_dark_reference"
|
android:fillColor="?attr/colorAccent"
|
||||||
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2z" />
|
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2z" />
|
||||||
<path
|
<path
|
||||||
android:fillColor="?attr/backgroundColor"
|
android:fillColor="?attr/backgroundColor"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:width="24dp"
|
android:width="24dp"
|
||||||
android:height="24dp"
|
android:height="24dp"
|
||||||
android:tint="@color/cyanea_accent_reference"
|
android:tint="?colorAccent"
|
||||||
android:viewportWidth="24"
|
android:viewportWidth="24"
|
||||||
android:viewportHeight="24">
|
android:viewportHeight="24">
|
||||||
<path
|
<path
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:width="24dp"
|
android:width="24dp"
|
||||||
android:height="24dp"
|
android:height="24dp"
|
||||||
android:tint="@color/cyanea_accent_reference"
|
android:tint="?colorAccent"
|
||||||
android:viewportWidth="24"
|
android:viewportWidth="24"
|
||||||
android:viewportHeight="24">
|
android:viewportHeight="24">
|
||||||
<path
|
<path
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<item android:drawable="@color/cyanea_accent_light_reference" android:state_checked="true" />
|
<item android:drawable="?attr/colorAccent" android:state_checked="true" />
|
||||||
<item android:drawable="@color/cyanea_accent_light_reference" android:state_pressed="true" />
|
<item android:drawable="?attr/colorAccent" android:state_pressed="true" />
|
||||||
<item android:drawable="@color/cyanea_accent_light_reference" android:state_focused="true" />
|
<item android:drawable="?attr/colorAccent" android:state_focused="true" />
|
||||||
<item android:drawable="@color/transparent" />
|
<item android:drawable="@color/transparent" />
|
||||||
</selector>
|
</selector>
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<item android:drawable="@color/cyanea_accent_dark_reference" android:state_checked="true" />
|
<item android:drawable="?attr/colorAccent" android:state_checked="true" />
|
||||||
<item android:drawable="@color/cyanea_accent_dark_reference" android:state_pressed="true" />
|
<item android:drawable="?attr/colorAccent" android:state_pressed="true" />
|
||||||
<item android:drawable="@color/cyanea_accent_dark_reference" android:state_focused="true" />
|
<item android:drawable="?attr/colorAccent" android:state_focused="true" />
|
||||||
<item android:drawable="@color/transparent" />
|
<item android:drawable="@color/transparent" />
|
||||||
</selector>
|
</selector>
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:shape="rectangle">
|
android:shape="rectangle">
|
||||||
<solid android:color="@color/cyanea_accent_dark_reference" />
|
<solid android:color="?attr/colorAccent" />
|
||||||
<padding
|
<padding
|
||||||
android:left="2dp"
|
android:left="2dp"
|
||||||
android:right="2dp" />
|
android:right="2dp" />
|
||||||
|
|
|
@ -2,6 +2,6 @@
|
||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<stroke
|
<stroke
|
||||||
android:width="1dp"
|
android:width="1dp"
|
||||||
android:color="@color/cyanea_accent_dark_reference" />
|
android:color="?attr/colorAccent" />
|
||||||
<corners android:radius="4dp" />
|
<corners android:radius="4dp" />
|
||||||
</shape>
|
</shape>
|
||||||
|
|
|
@ -131,8 +131,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:text="@string/support_the_app_on_liberapay"
|
android:text="@string/support_the_app_on_liberapay"
|
||||||
android:textColor="@color/cyanea_accent_dark_reference"
|
/>
|
||||||
app:strokeColor="@color/cyanea_accent_dark_reference" />
|
|
||||||
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
|
@ -142,8 +141,6 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:text="PayPal"
|
android:text="PayPal"
|
||||||
android:textColor="@color/cyanea_accent_dark_reference"
|
|
||||||
app:strokeColor="@color/cyanea_accent_dark_reference"
|
|
||||||
tools:ignore="HardcodedText" />
|
tools:ignore="HardcodedText" />
|
||||||
|
|
||||||
|
|
||||||
|
@ -177,7 +174,6 @@
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/about_license"
|
android:id="@+id/about_license"
|
||||||
style="@style/MyOutlinedButton"
|
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="3"
|
android:layout_weight="3"
|
||||||
|
@ -202,7 +198,6 @@
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/about_code"
|
android:id="@+id/about_code"
|
||||||
style="@style/MyOutlinedButton"
|
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="3"
|
android:layout_weight="3"
|
||||||
|
@ -228,7 +223,6 @@
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/about_thekinrar"
|
android:id="@+id/about_thekinrar"
|
||||||
style="@style/MyOutlinedButton"
|
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="3"
|
android:layout_weight="3"
|
||||||
|
|
|
@ -20,11 +20,11 @@
|
||||||
android:paddingVertical="12dp"
|
android:paddingVertical="12dp"
|
||||||
android:text="@string/muted_menu"
|
android:text="@string/muted_menu"
|
||||||
android:textAlignment="textStart"
|
android:textAlignment="textStart"
|
||||||
android:textColor="@color/cyanea_accent_dark_reference"
|
android:textColor="?attr/colorAccent"
|
||||||
app:icon="@drawable/ic_baseline_navigate_next_24"
|
app:icon="@drawable/ic_baseline_navigate_next_24"
|
||||||
app:iconGravity="end"
|
app:iconGravity="end"
|
||||||
app:iconTint="@color/cyanea_accent_dark_reference"
|
app:iconTint="?attr/colorAccent"
|
||||||
app:strokeColor="@color/cyanea_accent_dark_reference" />
|
app:strokeColor="?attr/colorAccent" />
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/blocked"
|
android:id="@+id/blocked"
|
||||||
|
@ -35,11 +35,11 @@
|
||||||
android:paddingVertical="12dp"
|
android:paddingVertical="12dp"
|
||||||
android:text="@string/blocked_menu"
|
android:text="@string/blocked_menu"
|
||||||
android:textAlignment="textStart"
|
android:textAlignment="textStart"
|
||||||
android:textColor="@color/cyanea_accent_dark_reference"
|
android:textColor="?attr/colorAccent"
|
||||||
app:icon="@drawable/ic_baseline_navigate_next_24"
|
app:icon="@drawable/ic_baseline_navigate_next_24"
|
||||||
app:iconGravity="end"
|
app:iconGravity="end"
|
||||||
app:iconTint="@color/cyanea_accent_dark_reference"
|
app:iconTint="?attr/colorAccent"
|
||||||
app:strokeColor="@color/cyanea_accent_dark_reference" />
|
app:strokeColor="?attr/colorAccent" />
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/bookmarks"
|
android:id="@+id/bookmarks"
|
||||||
|
@ -50,11 +50,11 @@
|
||||||
android:paddingVertical="12dp"
|
android:paddingVertical="12dp"
|
||||||
android:text="@string/bookmarks"
|
android:text="@string/bookmarks"
|
||||||
android:textAlignment="textStart"
|
android:textAlignment="textStart"
|
||||||
android:textColor="@color/cyanea_accent_dark_reference"
|
android:textColor="?attr/colorAccent"
|
||||||
app:icon="@drawable/ic_baseline_navigate_next_24"
|
app:icon="@drawable/ic_baseline_navigate_next_24"
|
||||||
app:iconGravity="end"
|
app:iconGravity="end"
|
||||||
app:iconTint="@color/cyanea_accent_dark_reference"
|
app:iconTint="?attr/colorAccent"
|
||||||
app:strokeColor="@color/cyanea_accent_dark_reference" />
|
app:strokeColor="?attr/colorAccent" />
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/favourites"
|
android:id="@+id/favourites"
|
||||||
|
@ -65,11 +65,11 @@
|
||||||
android:paddingVertical="12dp"
|
android:paddingVertical="12dp"
|
||||||
android:text="@string/favourite"
|
android:text="@string/favourite"
|
||||||
android:textAlignment="textStart"
|
android:textAlignment="textStart"
|
||||||
android:textColor="@color/cyanea_accent_dark_reference"
|
android:textColor="?attr/colorAccent"
|
||||||
app:icon="@drawable/ic_baseline_navigate_next_24"
|
app:icon="@drawable/ic_baseline_navigate_next_24"
|
||||||
app:iconGravity="end"
|
app:iconGravity="end"
|
||||||
app:iconTint="@color/cyanea_accent_dark_reference"
|
app:iconTint="?attr/colorAccent"
|
||||||
app:strokeColor="@color/cyanea_accent_dark_reference" />
|
app:strokeColor="?attr/colorAccent" />
|
||||||
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
|
@ -81,11 +81,11 @@
|
||||||
android:paddingVertical="12dp"
|
android:paddingVertical="12dp"
|
||||||
android:text="@string/blocked_domains"
|
android:text="@string/blocked_domains"
|
||||||
android:textAlignment="textStart"
|
android:textAlignment="textStart"
|
||||||
android:textColor="@color/cyanea_accent_dark_reference"
|
android:textColor="?attr/colorAccent"
|
||||||
app:icon="@drawable/ic_baseline_navigate_next_24"
|
app:icon="@drawable/ic_baseline_navigate_next_24"
|
||||||
app:iconGravity="end"
|
app:iconGravity="end"
|
||||||
app:iconTint="@color/cyanea_accent_dark_reference"
|
app:iconTint="?attr/colorAccent"
|
||||||
app:strokeColor="@color/cyanea_accent_dark_reference" />
|
app:strokeColor="?attr/colorAccent" />
|
||||||
|
|
||||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
|
|
@ -26,13 +26,11 @@
|
||||||
android:id="@+id/appBar"
|
android:id="@+id/appBar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:backgroundTint="?backgroundColorLight"
|
|
||||||
android:fitsSystemWindows="true">
|
android:fitsSystemWindows="true">
|
||||||
|
|
||||||
<com.google.android.material.appbar.CollapsingToolbarLayout
|
<com.google.android.material.appbar.CollapsingToolbarLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:backgroundTint="?backgroundColorLight"
|
|
||||||
android:fitsSystemWindows="true"
|
android:fitsSystemWindows="true"
|
||||||
app:contentScrim="?colorPrimaryDark"
|
app:contentScrim="?colorPrimaryDark"
|
||||||
app:expandedTitleGravity="top"
|
app:expandedTitleGravity="top"
|
||||||
|
@ -394,9 +392,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="5dp"
|
android:layout_marginStart="5dp"
|
||||||
android:text="@string/approve"
|
android:text="@string/approve" />
|
||||||
android:textColor="@color/cyanea_accent_dark_reference"
|
|
||||||
app:strokeColor="@color/cyanea_accent_dark_reference" />
|
|
||||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
<androidx.appcompat.widget.LinearLayoutCompat
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
@ -424,9 +420,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="5dp"
|
android:layout_marginStart="5dp"
|
||||||
android:text="@string/disable"
|
android:text="@string/disable" />
|
||||||
android:textColor="@color/cyanea_accent_dark_reference"
|
|
||||||
app:strokeColor="@color/cyanea_accent_dark_reference" />
|
|
||||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
<androidx.appcompat.widget.LinearLayoutCompat
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
@ -454,9 +448,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="5dp"
|
android:layout_marginStart="5dp"
|
||||||
android:text="@string/silence"
|
android:text="@string/silence" />
|
||||||
android:textColor="@color/cyanea_accent_dark_reference"
|
|
||||||
app:strokeColor="@color/cyanea_accent_dark_reference" />
|
|
||||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
<androidx.appcompat.widget.LinearLayoutCompat
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
@ -484,9 +476,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="5dp"
|
android:layout_marginStart="5dp"
|
||||||
android:text="@string/suspend"
|
android:text="@string/suspend" />
|
||||||
android:textColor="@color/cyanea_accent_dark_reference"
|
|
||||||
app:strokeColor="@color/cyanea_accent_dark_reference" />
|
|
||||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|
|
@ -20,11 +20,8 @@
|
||||||
android:paddingVertical="12dp"
|
android:paddingVertical="12dp"
|
||||||
android:text="@string/reports"
|
android:text="@string/reports"
|
||||||
android:textAlignment="textStart"
|
android:textAlignment="textStart"
|
||||||
android:textColor="@color/cyanea_accent_dark_reference"
|
|
||||||
app:icon="@drawable/ic_baseline_navigate_next_24"
|
app:icon="@drawable/ic_baseline_navigate_next_24"
|
||||||
app:iconGravity="end"
|
app:iconGravity="end" />
|
||||||
app:iconTint="@color/cyanea_accent_dark_reference"
|
|
||||||
app:strokeColor="@color/cyanea_accent_dark_reference" />
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/accounts"
|
android:id="@+id/accounts"
|
||||||
|
@ -35,11 +32,8 @@
|
||||||
android:paddingVertical="12dp"
|
android:paddingVertical="12dp"
|
||||||
android:text="@string/accounts"
|
android:text="@string/accounts"
|
||||||
android:textAlignment="textStart"
|
android:textAlignment="textStart"
|
||||||
android:textColor="@color/cyanea_accent_dark_reference"
|
|
||||||
app:icon="@drawable/ic_baseline_navigate_next_24"
|
app:icon="@drawable/ic_baseline_navigate_next_24"
|
||||||
app:iconGravity="end"
|
app:iconGravity="end" />
|
||||||
app:iconTint="@color/cyanea_accent_dark_reference"
|
|
||||||
app:strokeColor="@color/cyanea_accent_dark_reference" />
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/domains"
|
android:id="@+id/domains"
|
||||||
|
@ -50,11 +44,8 @@
|
||||||
android:paddingVertical="12dp"
|
android:paddingVertical="12dp"
|
||||||
android:text="@string/blocked_domains"
|
android:text="@string/blocked_domains"
|
||||||
android:textAlignment="textStart"
|
android:textAlignment="textStart"
|
||||||
android:textColor="@color/cyanea_accent_dark_reference"
|
|
||||||
app:icon="@drawable/ic_baseline_navigate_next_24"
|
app:icon="@drawable/ic_baseline_navigate_next_24"
|
||||||
app:iconGravity="end"
|
app:iconGravity="end" />
|
||||||
app:iconTint="@color/cyanea_accent_dark_reference"
|
|
||||||
app:strokeColor="@color/cyanea_accent_dark_reference" />
|
|
||||||
|
|
||||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue