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.preference:preference:1.2.0'
|
||||
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.github.GrenderG:Toasty:1.5.2'
|
||||
implementation 'org.framagit.tom79:SparkButton:1.0.13'
|
||||
|
|
|
@ -287,15 +287,15 @@
|
|||
android:name=".activities.InstanceActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||
android:label="@string/action_about_instance"
|
||||
android:theme="@style/DialogDark" />
|
||||
android:theme="@style/MaterialAlertDialog.Material3" />
|
||||
<activity
|
||||
android:name=".activities.InstanceProfileActivity"
|
||||
android:excludeFromRecents="true"
|
||||
android:theme="@style/DialogDark" />
|
||||
android:theme="@style/MaterialAlertDialog.Material3" />
|
||||
<activity
|
||||
android:name=".activities.ProxyActivity"
|
||||
android:excludeFromRecents="true"
|
||||
android:theme="@style/DialogDark" />
|
||||
android:theme="@style/MaterialAlertDialog.Material3" />
|
||||
<activity
|
||||
android:name=".activities.HashTagActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||
|
@ -310,7 +310,7 @@
|
|||
<activity
|
||||
android:name=".activities.InstanceHealthActivity"
|
||||
android:excludeFromRecents="true"
|
||||
android:theme="@style/DialogDark" />
|
||||
android:theme="@style/MaterialAlertDialog.Material3" />
|
||||
|
||||
<activity
|
||||
android:name=".activities.ReportActivity"
|
||||
|
|
|
@ -28,7 +28,6 @@ import android.content.Intent;
|
|||
import android.content.IntentFilter;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
|
@ -39,7 +38,6 @@ import android.text.Editable;
|
|||
import android.text.Html;
|
||||
import android.text.TextWatcher;
|
||||
import android.util.Patterns;
|
||||
import android.view.ContextThemeWrapper;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
|
@ -59,7 +57,6 @@ import androidx.appcompat.app.AlertDialog;
|
|||
import androidx.appcompat.widget.PopupMenu;
|
||||
import androidx.appcompat.widget.SearchView;
|
||||
import androidx.core.app.ActivityOptionsCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.view.GravityCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
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.google.android.material.snackbar.Snackbar;
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
import com.jaredrummler.cyanea.Cyanea;
|
||||
|
||||
import org.jsoup.Jsoup;
|
||||
import org.jsoup.nodes.Document;
|
||||
|
@ -196,8 +192,6 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
|
|||
context.startActivity(intentCompose);
|
||||
})
|
||||
.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();
|
||||
}
|
||||
}
|
||||
|
@ -259,7 +253,7 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
|
|||
});
|
||||
}
|
||||
} 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)) {
|
||||
Status statusSent = (Status) b.getSerializable(Helper.RECEIVE_STATUS_ACTION);
|
||||
String statusEditId = b.getString(Helper.ARG_EDIT_STATUS_ID, null);
|
||||
|
@ -271,8 +265,6 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
|
|||
startActivity(intentContext);
|
||||
})
|
||||
.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();
|
||||
//The message was edited, we need to update the timeline
|
||||
if (statusEditId != null) {
|
||||
|
@ -303,7 +295,6 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
|
|||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(BaseMainActivity.this);
|
||||
ThemeHelper.applyTheme(this);
|
||||
if (!Helper.isLoggedIn(BaseMainActivity.this)) {
|
||||
//It is not, the user is redirected to the login page
|
||||
Intent myIntent = new Intent(BaseMainActivity.this, LoginActivity.class);
|
||||
|
@ -329,13 +320,10 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
|
|||
actionBar.setDisplayShowTitleEnabled(false);
|
||||
}
|
||||
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)));
|
||||
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
|
||||
|
@ -537,14 +525,14 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
|
|||
});
|
||||
|
||||
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()
|
||||
.inflate(R.menu.main, popup.getMenu());
|
||||
|
||||
popup.setOnMenuItemClickListener(item -> {
|
||||
int itemId = item.getItemId();
|
||||
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);
|
||||
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));
|
||||
|
@ -1123,7 +1111,7 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
|
|||
view = binding.bottomNavView.findViewById(R.id.nav_public);
|
||||
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()
|
||||
.inflate(R.menu.option_filter_toots, popup.getMenu());
|
||||
Menu menu = popup.getMenu();
|
||||
|
@ -1190,7 +1178,7 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
|
|||
itemShowReplies.setChecked(show_replies);
|
||||
editor.apply();
|
||||
} 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();
|
||||
View dialogView = inflater.inflate(R.layout.popup_filter_regex, new LinearLayout(BaseMainActivity.this), false);
|
||||
dialogBuilder.setView(dialogView);
|
||||
|
@ -1269,8 +1257,6 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
|
|||
if (!singleBar) {
|
||||
if (count > 0) {
|
||||
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 {
|
||||
binding.bottomNavView.removeBadge(R.id.nav_privates);
|
||||
}
|
||||
|
@ -1289,8 +1275,6 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
|
|||
if (!singleBar) {
|
||||
if (count > 0) {
|
||||
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 {
|
||||
binding.bottomNavView.removeBadge(R.id.nav_notifications);
|
||||
}
|
||||
|
@ -1355,8 +1339,6 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
|
|||
case HOME:
|
||||
if (count > 0) {
|
||||
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 {
|
||||
binding.bottomNavView.removeBadge(R.id.nav_home);
|
||||
}
|
||||
|
@ -1364,8 +1346,6 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
|
|||
case LOCAL:
|
||||
if (count > 0) {
|
||||
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 {
|
||||
binding.bottomNavView.removeBadge(R.id.nav_local);
|
||||
}
|
||||
|
@ -1373,8 +1353,6 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
|
|||
case PUBLIC:
|
||||
if (count > 0) {
|
||||
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 {
|
||||
binding.bottomNavView.removeBadge(R.id.nav_public);
|
||||
}
|
||||
|
@ -1382,8 +1360,6 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
|
|||
case NOTIFICATION:
|
||||
if (count > 0) {
|
||||
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 {
|
||||
binding.bottomNavView.removeBadge(R.id.nav_notifications);
|
||||
}
|
||||
|
@ -1391,8 +1367,6 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
|
|||
case DIRECT:
|
||||
if (count > 0) {
|
||||
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 {
|
||||
binding.bottomNavView.removeBadge(R.id.nav_privates);
|
||||
}
|
||||
|
@ -1525,7 +1499,7 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
|
|||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
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.setMessage(getString(R.string.logout_account_confirmation, account.mastodon_account.username, account.instance));
|
||||
alt_bld.setPositiveButton(R.string.action_logout, (dialog, id) -> {
|
||||
|
|
|
@ -23,9 +23,6 @@ import androidx.multidex.MultiDex;
|
|||
import androidx.multidex.MultiDexApplication;
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
||||
import com.jaredrummler.cyanea.Cyanea;
|
||||
import com.jaredrummler.cyanea.prefs.CyaneaTheme;
|
||||
|
||||
import org.acra.ACRA;
|
||||
import org.acra.ReportField;
|
||||
import org.acra.config.CoreConfigurationBuilder;
|
||||
|
@ -33,8 +30,6 @@ import org.acra.config.DialogConfigurationBuilder;
|
|||
import org.acra.config.MailSenderConfigurationBuilder;
|
||||
import org.acra.data.StringFormat;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import es.dmoral.toasty.Toasty;
|
||||
|
||||
|
||||
|
@ -54,12 +49,9 @@ public class MainApplication extends MultiDexApplication {
|
|||
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 no_theme_set = sharedpreferences.getBoolean("no_theme_set", true);
|
||||
if (no_theme_set && !custom_theme) {
|
||||
list.get(0).apply(Cyanea.getInstance());
|
||||
SharedPreferences.Editor editor = sharedpreferences.edit();
|
||||
editor.putBoolean("no_theme_set", false);
|
||||
editor.apply();
|
||||
|
@ -92,7 +84,6 @@ public class MainApplication extends MultiDexApplication {
|
|||
.withResIcon(R.mipmap.ic_launcher)
|
||||
.withText(getString(R.string.crash_title))
|
||||
.withCommentPrompt(getString(R.string.crash_message))
|
||||
.withResTheme(R.style.DialogDark)
|
||||
.withPositiveButtonText(getString(R.string.send_email))
|
||||
.withNegativeButtonText(getString(R.string.cancel))
|
||||
.build()
|
||||
|
|
|
@ -18,13 +18,11 @@ package app.fedilab.android.activities;
|
|||
import android.content.Intent;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.core.app.ActivityOptionsCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
|
||||
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.Helper;
|
||||
import app.fedilab.android.helper.MastodonHelper;
|
||||
import app.fedilab.android.helper.ThemeHelper;
|
||||
import app.fedilab.android.viewmodel.mastodon.AccountsVM;
|
||||
|
||||
|
||||
|
@ -52,13 +49,12 @@ public class AboutActivity extends BaseActivity {
|
|||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
ThemeHelper.applyThemeBar(this);
|
||||
|
||||
binding = ActivityAboutBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
|
||||
if (getSupportActionBar() != null) {
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
||||
}
|
||||
|
||||
try {
|
||||
|
@ -79,7 +75,6 @@ public class AboutActivity extends BaseActivity {
|
|||
}
|
||||
binding.aboutSupportPaypal.setOnClickListener(v -> Helper.openBrowser(AboutActivity.this, "https://www.paypal.me/Mastalab"));
|
||||
|
||||
binding.accountFollow.setBackgroundTintList(ThemeHelper.getButtonActionColorStateList(AboutActivity.this));
|
||||
if (BuildConfig.DONATIONS) {
|
||||
binding.aboutSupportPaypal.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
|
|
|
@ -17,7 +17,6 @@ package app.fedilab.android.activities;
|
|||
|
||||
import android.app.Activity;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.view.MenuItem;
|
||||
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.databinding.ActivityAdminReportBinding;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.helper.ThemeHelper;
|
||||
import app.fedilab.android.ui.drawer.StatusReportAdapter;
|
||||
import app.fedilab.android.viewmodel.mastodon.AdminVM;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
|
@ -52,13 +50,12 @@ public class AccountReportActivity extends BaseActivity {
|
|||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
ThemeHelper.applyThemeBar(this);
|
||||
|
||||
binding = ActivityAdminReportBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
|
||||
if (getSupportActionBar() != null) {
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
||||
}
|
||||
|
||||
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,
|
||||
* see <http://www.gnu.org/licenses>. */
|
||||
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.view.MenuItem;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
|
@ -43,13 +41,12 @@ public class ActionActivity extends BaseActivity {
|
|||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
ThemeHelper.applyThemeBar(this);
|
||||
|
||||
binding = ActivityActionsBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
|
||||
if (getSupportActionBar() != null) {
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
||||
}
|
||||
canGoBack = false;
|
||||
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 android.content.SharedPreferences;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.util.TypedValue;
|
||||
import android.view.MenuItem;
|
||||
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
||||
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.exception.DBException;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.helper.ThemeHelper;
|
||||
import app.fedilab.android.ui.fragment.timeline.FragmentMastodonAnnouncement;
|
||||
|
||||
|
||||
|
@ -43,7 +40,7 @@ public class AnnouncementActivity extends BaseActivity {
|
|||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
ThemeHelper.applyTheme(this);
|
||||
|
||||
ActivityAnnouncementBinding binding = ActivityAnnouncementBinding.inflate(getLayoutInflater());
|
||||
|
||||
setContentView(binding.getRoot());
|
||||
|
@ -53,7 +50,6 @@ public class AnnouncementActivity extends BaseActivity {
|
|||
//Remove title
|
||||
if (actionBar != null) {
|
||||
actionBar.setDisplayShowTitleEnabled(false);
|
||||
actionBar.setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
||||
}
|
||||
binding.title.setText(R.string.action_announcements);
|
||||
if (getSupportActionBar() != null) {
|
||||
|
|
|
@ -19,8 +19,8 @@ import android.annotation.SuppressLint;
|
|||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.jaredrummler.cyanea.app.CyaneaAppCompatActivity;
|
||||
import com.vanniktech.emoji.EmojiManager;
|
||||
import com.vanniktech.emoji.one.EmojiOneProvider;
|
||||
|
||||
|
@ -29,7 +29,7 @@ import app.fedilab.android.helper.ThemeHelper;
|
|||
|
||||
|
||||
@SuppressLint("Registered")
|
||||
public class BaseActivity extends CyaneaAppCompatActivity {
|
||||
public class BaseActivity extends AppCompatActivity {
|
||||
|
||||
static {
|
||||
Helper.installProvider();
|
||||
|
|
|
@ -16,7 +16,8 @@ package app.fedilab.android.activities;
|
|||
|
||||
import android.annotation.SuppressLint;
|
||||
|
||||
import com.jaredrummler.cyanea.app.CyaneaFragmentActivity;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import com.vanniktech.emoji.EmojiManager;
|
||||
import com.vanniktech.emoji.one.EmojiOneProvider;
|
||||
|
||||
|
@ -24,7 +25,7 @@ import app.fedilab.android.helper.Helper;
|
|||
|
||||
|
||||
@SuppressLint("Registered")
|
||||
public class BaseFragmentActivity extends CyaneaFragmentActivity {
|
||||
public class BaseFragmentActivity extends FragmentActivity {
|
||||
|
||||
|
||||
static {
|
||||
|
|
|
@ -15,7 +15,6 @@ package app.fedilab.android.activities;
|
|||
* see <http://www.gnu.org/licenses>. */
|
||||
|
||||
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
|
@ -25,7 +24,6 @@ import android.view.MenuItem;
|
|||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -42,7 +40,6 @@ import app.fedilab.android.databinding.ActivityCacheBinding;
|
|||
import app.fedilab.android.exception.DBException;
|
||||
import app.fedilab.android.helper.CacheHelper;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.helper.ThemeHelper;
|
||||
import app.fedilab.android.ui.drawer.CacheAdapter;
|
||||
|
||||
public class CacheActivity extends BaseActivity {
|
||||
|
@ -54,12 +51,11 @@ public class CacheActivity extends BaseActivity {
|
|||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
ThemeHelper.applyThemeBar(this);
|
||||
|
||||
binding = ActivityCacheBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
if (getSupportActionBar() != null) {
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
||||
}
|
||||
CacheHelper.getCacheValues(CacheActivity.this, size -> {
|
||||
if (size > 0) {
|
||||
|
@ -123,7 +119,7 @@ public class CacheActivity extends BaseActivity {
|
|||
finish();
|
||||
return true;
|
||||
} 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.setMessage(getString(R.string.delete_cache_message));
|
||||
deleteConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
|
||||
|
@ -133,7 +129,7 @@ public class CacheActivity extends BaseActivity {
|
|||
size = size / 1000000.0f;
|
||||
}
|
||||
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.setNegativeButton(R.string.no, (dialogRestart, whichRestart) -> {
|
||||
recreate();
|
||||
|
|
|
@ -28,7 +28,6 @@ import android.content.Intent;
|
|||
import android.content.IntentFilter;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
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.MastodonHelper;
|
||||
import app.fedilab.android.helper.MediaHelper;
|
||||
import app.fedilab.android.helper.ThemeHelper;
|
||||
import app.fedilab.android.interfaces.OnDownloadInterface;
|
||||
import app.fedilab.android.jobs.ComposeWorker;
|
||||
import app.fedilab.android.jobs.ScheduleThreadWorker;
|
||||
|
@ -216,7 +214,7 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana
|
|||
}
|
||||
if (canBeSent(statusDraft)) {
|
||||
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.setPositiveButton(R.string.save, (dialog, id) -> {
|
||||
dialog.dismiss();
|
||||
|
@ -317,7 +315,7 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana
|
|||
} else if (item.getItemId() == R.id.action_photo_camera) {
|
||||
photoFileUri = MediaHelper.dispatchTakePictureIntent(ComposeActivity.this);
|
||||
} 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));
|
||||
PopupContactBinding popupContactBinding = PopupContactBinding.inflate(getLayoutInflater(), new LinearLayout(ComposeActivity.this), false);
|
||||
|
@ -444,7 +442,7 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana
|
|||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
ThemeHelper.applyTheme(this);
|
||||
|
||||
binding = ActivityPaginationBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
setSupportActionBar(binding.toolbar);
|
||||
|
@ -454,7 +452,6 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana
|
|||
//Remove title
|
||||
if (actionBar != null) {
|
||||
actionBar.setDisplayShowTitleEnabled(false);
|
||||
actionBar.setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
||||
}
|
||||
if (getSupportActionBar() != null) {
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
@ -500,7 +497,6 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana
|
|||
if (sharedTitle != null && sharedSubject != null && sharedSubject.length() > sharedTitle.length()) {
|
||||
sharedTitle = sharedSubject;
|
||||
}
|
||||
binding.toolbar.setPopupTheme(Helper.popupStyle());
|
||||
//Edit a scheduled status from server
|
||||
if (scheduledStatus != null) {
|
||||
statusDraft = new StatusDraft();
|
||||
|
|
|
@ -20,7 +20,6 @@ import static app.fedilab.android.ui.drawer.StatusAdapter.sendAction;
|
|||
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
|
@ -30,7 +29,6 @@ import android.view.MenuItem;
|
|||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
@ -43,7 +41,6 @@ import app.fedilab.android.databinding.ActivityConversationBinding;
|
|||
import app.fedilab.android.exception.DBException;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.helper.MastodonHelper;
|
||||
import app.fedilab.android.helper.ThemeHelper;
|
||||
import app.fedilab.android.ui.fragment.timeline.FragmentMastodonContext;
|
||||
import app.fedilab.android.viewmodel.mastodon.StatusesVM;
|
||||
|
||||
|
@ -57,7 +54,7 @@ public class ContextActivity extends BaseActivity {
|
|||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
ThemeHelper.applyTheme(this);
|
||||
|
||||
app.fedilab.android.databinding.ActivityConversationBinding binding = ActivityConversationBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
setSupportActionBar(binding.toolbar);
|
||||
|
@ -65,7 +62,6 @@ public class ContextActivity extends BaseActivity {
|
|||
//Remove title
|
||||
if (actionBar != null) {
|
||||
actionBar.setDisplayShowTitleEnabled(false);
|
||||
actionBar.setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
||||
}
|
||||
binding.title.setText(R.string.context_conversation);
|
||||
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
|
@ -76,7 +72,6 @@ public class ContextActivity extends BaseActivity {
|
|||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
getSupportActionBar().setDisplayShowHomeEnabled(true);
|
||||
}
|
||||
binding.toolbar.setPopupTheme(Helper.popupStyle());
|
||||
Bundle b = getIntent().getExtras();
|
||||
displayCW = sharedpreferences.getBoolean(getString(R.string.SET_EXPAND_CW), false);
|
||||
Status focusedStatus = null; // or other values
|
||||
|
|
|
@ -17,7 +17,6 @@ package app.fedilab.android.activities;
|
|||
import static app.fedilab.android.BaseMainActivity.currentAccount;
|
||||
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
|
@ -26,7 +25,6 @@ import android.text.TextUtils;
|
|||
import android.view.MenuItem;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
||||
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.databinding.ActivityCustomSharingBinding;
|
||||
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.CustomSharingResponse;
|
||||
import app.fedilab.android.helper.customsharing.OnCustomSharingInterface;
|
||||
|
@ -66,14 +63,13 @@ public class CustomSharingActivity extends BaseActivity implements OnCustomShari
|
|||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
ThemeHelper.applyThemeBar(this);
|
||||
|
||||
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(CustomSharingActivity.this);
|
||||
binding = ActivityCustomSharingBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
if (getSupportActionBar() != null) {
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
getSupportActionBar().setDisplayShowHomeEnabled(true);
|
||||
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
||||
}
|
||||
Bundle b = getIntent().getExtras();
|
||||
status = null;
|
||||
|
|
|
@ -17,7 +17,6 @@ package app.fedilab.android.activities;
|
|||
import static app.fedilab.android.BaseMainActivity.currentAccount;
|
||||
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
|
@ -30,7 +29,6 @@ import androidx.annotation.NonNull;
|
|||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.preference.PreferenceManager;
|
||||
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.databinding.ActivityDraftsBinding;
|
||||
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.viewmodel.mastodon.TimelinesVM;
|
||||
|
||||
|
@ -62,20 +58,16 @@ public class DraftActivity extends BaseActivity implements StatusDraftAdapter.Dr
|
|||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
ThemeHelper.applyTheme(this);
|
||||
|
||||
binding = ActivityDraftsBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
setSupportActionBar(binding.toolbar);
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
if (actionBar != null) {
|
||||
actionBar.setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
||||
}
|
||||
|
||||
//Remove title
|
||||
if (actionBar != null) {
|
||||
actionBar.setDisplayShowTitleEnabled(false);
|
||||
}
|
||||
binding.toolbar.setPopupTheme(Helper.popupStyle());
|
||||
binding.title.setText(R.string.drafts);
|
||||
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
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();
|
||||
return true;
|
||||
} 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.setMessage(getString(R.string.remove_draft));
|
||||
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 android.content.Intent;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
|
@ -31,8 +30,6 @@ import android.view.View;
|
|||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.graphics.drawable.DrawableCompat;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
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.helper.Helper;
|
||||
import app.fedilab.android.helper.MastodonHelper;
|
||||
import app.fedilab.android.helper.ThemeHelper;
|
||||
import app.fedilab.android.viewmodel.mastodon.AccountsVM;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
|
||||
|
@ -66,12 +62,11 @@ public class EditProfileActivity extends BaseActivity {
|
|||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
ThemeHelper.applyThemeBar(this);
|
||||
|
||||
binding = ActivityEditProfileBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
if (getSupportActionBar() != null) {
|
||||
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)
|
||||
|
@ -140,7 +135,7 @@ public class EditProfileActivity extends BaseActivity {
|
|||
value = Html.fromHtml(field.value).toString();
|
||||
fieldItemBinding.value.setText(value);
|
||||
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.setMessage(getString(R.string.delete_field_confirm));
|
||||
deleteConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
|
||||
|
@ -162,7 +157,7 @@ public class EditProfileActivity extends BaseActivity {
|
|||
binding.addField.setOnClickListener(view -> {
|
||||
AccountFieldItemBinding fieldItemBinding = AccountFieldItemBinding.inflate(getLayoutInflater());
|
||||
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.setMessage(getString(R.string.delete_field_confirm));
|
||||
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
|
||||
accountsVM = new ViewModelProvider(EditProfileActivity.this).get(AccountsVM.class);
|
||||
|
|
|
@ -15,7 +15,6 @@ package app.fedilab.android.activities;
|
|||
* see <http://www.gnu.org/licenses>. */
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MenuItem;
|
||||
|
@ -28,7 +27,6 @@ import android.widget.Button;
|
|||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
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.databinding.ActivityFiltersBinding;
|
||||
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.KeywordAdapter;
|
||||
import app.fedilab.android.viewmodel.mastodon.FiltersVM;
|
||||
|
@ -63,7 +59,7 @@ public class FilterActivity extends BaseActivity implements FilterAdapter.Delete
|
|||
* @param listener - {@link FilterAdapter.FilterAction}
|
||||
*/
|
||||
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));
|
||||
FiltersVM filtersVM = new ViewModelProvider((ViewModelStoreOwner) context).get(FiltersVM.class);
|
||||
dialogBuilder.setView(popupAddFilterBinding.getRoot());
|
||||
|
@ -250,13 +246,12 @@ public class FilterActivity extends BaseActivity implements FilterAdapter.Delete
|
|||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
ThemeHelper.applyThemeBar(this);
|
||||
|
||||
binding = ActivityFiltersBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
filterList = new ArrayList<>();
|
||||
if (getSupportActionBar() != null) {
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
||||
}
|
||||
|
||||
FiltersVM filtersVM = new ViewModelProvider(FilterActivity.this).get(FiltersVM.class);
|
||||
|
|
|
@ -15,13 +15,11 @@ package app.fedilab.android.activities;
|
|||
* see <http://www.gnu.org/licenses>. */
|
||||
|
||||
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
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.databinding.ActivityStatusInfoBinding;
|
||||
import app.fedilab.android.helper.MastodonHelper;
|
||||
import app.fedilab.android.helper.ThemeHelper;
|
||||
import app.fedilab.android.ui.drawer.AccountFollowRequestAdapter;
|
||||
import app.fedilab.android.viewmodel.mastodon.AccountsVM;
|
||||
|
||||
|
@ -51,14 +48,13 @@ public class FollowRequestActivity extends BaseActivity {
|
|||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
ThemeHelper.applyTheme(this);
|
||||
|
||||
binding = ActivityStatusInfoBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
setSupportActionBar(binding.toolbar);
|
||||
if (getSupportActionBar() != null) {
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
getSupportActionBar().setDisplayShowHomeEnabled(true);
|
||||
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
||||
}
|
||||
accountList = new ArrayList<>();
|
||||
flagLoading = false;
|
||||
|
|
|
@ -15,7 +15,6 @@ package app.fedilab.android.activities;
|
|||
* see <http://www.gnu.org/licenses>. */
|
||||
|
||||
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.text.InputFilter;
|
||||
import android.view.Menu;
|
||||
|
@ -24,7 +23,6 @@ import android.view.View;
|
|||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
|
@ -60,14 +58,13 @@ public class FollowedTagActivity extends BaseActivity implements FollowedTagAdap
|
|||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
ThemeHelper.applyThemeBar(this);
|
||||
|
||||
binding = ActivityFollowedTagsBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
canGoBack = false;
|
||||
if (getSupportActionBar() != null) {
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
getSupportActionBar().setDisplayShowHomeEnabled(true);
|
||||
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
||||
}
|
||||
tagVM = new ViewModelProvider(FollowedTagActivity.this).get(TagVM.class);
|
||||
tagVM.followedTags(BaseMainActivity.currentInstance, BaseMainActivity.currentToken)
|
||||
|
@ -91,7 +88,7 @@ public class FollowedTagActivity extends BaseActivity implements FollowedTagAdap
|
|||
onBackPressed();
|
||||
return true;
|
||||
} 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.setMessage(R.string.action_unfollow_tag_confirm);
|
||||
alt_bld.setPositiveButton(R.string.unfollow, (dialog, id) -> {
|
||||
|
@ -123,7 +120,7 @@ public class FollowedTagActivity extends BaseActivity implements FollowedTagAdap
|
|||
AlertDialog alert = alt_bld.create();
|
||||
alert.show();
|
||||
} 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());
|
||||
dialogBuilder.setView(popupAddFollowedTagtBinding.getRoot());
|
||||
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 android.content.Intent;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
|
@ -27,7 +26,6 @@ import android.view.MenuItem;
|
|||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
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.exception.DBException;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.helper.ThemeHelper;
|
||||
import app.fedilab.android.ui.fragment.timeline.FragmentMastodonTimeline;
|
||||
import app.fedilab.android.viewmodel.mastodon.FiltersVM;
|
||||
import app.fedilab.android.viewmodel.mastodon.ReorderVM;
|
||||
|
@ -68,7 +65,7 @@ public class HashTagActivity extends BaseActivity {
|
|||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
ThemeHelper.applyTheme(this);
|
||||
|
||||
ActivityHashtagBinding binding = ActivityHashtagBinding.inflate(getLayoutInflater());
|
||||
|
||||
setContentView(binding.getRoot());
|
||||
|
@ -86,7 +83,6 @@ public class HashTagActivity extends BaseActivity {
|
|||
//Remove title
|
||||
if (actionBar != null) {
|
||||
actionBar.setDisplayShowTitleEnabled(false);
|
||||
actionBar.setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
||||
}
|
||||
binding.title.setText(tag);
|
||||
if (getSupportActionBar() != null) {
|
||||
|
@ -141,7 +137,6 @@ public class HashTagActivity extends BaseActivity {
|
|||
bundle.putSerializable(Helper.ARG_TIMELINE_TYPE, Timeline.TimeLineEnum.TAG);
|
||||
bundle.putString(Helper.ARG_SEARCH_KEYWORD, tag);
|
||||
Helper.addFragment(getSupportFragmentManager(), R.id.nav_host_fragment_tags, new FragmentMastodonTimeline(), bundle, null, null);
|
||||
binding.toolbar.setPopupTheme(Helper.popupStyle());
|
||||
binding.compose.setOnClickListener(v -> {
|
||||
Intent intentToot = new Intent(HashTagActivity.this, ComposeActivity.class);
|
||||
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.databinding.ActivityInstanceBinding;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.helper.ThemeHelper;
|
||||
import app.fedilab.android.viewmodel.mastodon.InstancesVM;
|
||||
|
||||
|
||||
|
@ -58,7 +57,6 @@ public class InstanceActivity extends BaseActivity {
|
|||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
ThemeHelper.applyThemeDialog(this);
|
||||
binding = ActivityInstanceBinding.inflate(getLayoutInflater());
|
||||
|
||||
setContentView(binding.getRoot());
|
||||
|
@ -71,13 +69,13 @@ public class InstanceActivity extends BaseActivity {
|
|||
|
||||
final SpannableString contentAbout = new SpannableString(getString(R.string.action_about_instance));
|
||||
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);
|
||||
binding.tos.setText(contentAbout);
|
||||
|
||||
final SpannableString contentPrivacy = new SpannableString(getString(R.string.action_privacy_policy));
|
||||
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);
|
||||
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.databinding.ActivityInstanceSocialBinding;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.helper.ThemeHelper;
|
||||
import app.fedilab.android.viewmodel.mastodon.InstanceSocialVM;
|
||||
|
||||
|
||||
|
@ -45,7 +44,6 @@ public class InstanceHealthActivity extends BaseActivity {
|
|||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
ThemeHelper.applyThemeDialog(this);
|
||||
binding = ActivityInstanceSocialBinding.inflate(getLayoutInflater());
|
||||
|
||||
setContentView(binding.getRoot());
|
||||
|
|
|
@ -28,7 +28,6 @@ import androidx.lifecycle.ViewModelProvider;
|
|||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.databinding.ActivityInstanceProfileBinding;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.helper.ThemeHelper;
|
||||
import app.fedilab.android.viewmodel.mastodon.NodeInfoVM;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
|
||||
|
@ -41,7 +40,7 @@ public class InstanceProfileActivity extends BaseActivity {
|
|||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
ThemeHelper.applyThemeDialog(this);
|
||||
|
||||
binding = ActivityInstanceProfileBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
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.client.entities.app.Account;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.helper.ThemeHelper;
|
||||
import app.fedilab.android.ui.fragment.login.FragmentLoginMain;
|
||||
import app.fedilab.android.viewmodel.mastodon.AccountsVM;
|
||||
import app.fedilab.android.viewmodel.mastodon.AdminVM;
|
||||
|
@ -109,7 +108,7 @@ public class LoginActivity extends BaseActivity {
|
|||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
ThemeHelper.applyTheme(this);
|
||||
|
||||
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(LoginActivity.this);
|
||||
setContentView(new FrameLayout(this));
|
||||
FragmentLoginMain fragmentLoginMain = new FragmentLoginMain();
|
||||
|
|
|
@ -16,7 +16,6 @@ package app.fedilab.android.activities;
|
|||
|
||||
|
||||
import android.content.Intent;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.text.Editable;
|
||||
import android.text.InputFilter;
|
||||
|
@ -28,7 +27,6 @@ import android.view.View;
|
|||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
|
@ -82,14 +80,13 @@ public class MastodonListActivity extends BaseActivity implements MastodonListAd
|
|||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
ThemeHelper.applyThemeBar(this);
|
||||
|
||||
binding = ActivityListBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
canGoBack = false;
|
||||
if (getSupportActionBar() != null) {
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
getSupportActionBar().setDisplayShowHomeEnabled(true);
|
||||
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
||||
}
|
||||
flagLoading = false;
|
||||
orderASC = true;
|
||||
|
@ -147,7 +144,7 @@ public class MastodonListActivity extends BaseActivity implements MastodonListAd
|
|||
onBackPressed();
|
||||
return true;
|
||||
} 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());
|
||||
dialogBuilder.setView(popupManageAccountsListBinding.getRoot());
|
||||
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.create().show();
|
||||
} 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.setMessage(R.string.action_lists_confirm_delete);
|
||||
alt_bld.setPositiveButton(R.string.delete, (dialog, id) -> {
|
||||
|
@ -282,7 +279,7 @@ public class MastodonListActivity extends BaseActivity implements MastodonListAd
|
|||
AlertDialog alert = alt_bld.create();
|
||||
alert.show();
|
||||
} 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());
|
||||
dialogBuilder.setView(popupAddListBinding.getRoot());
|
||||
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.create().show();
|
||||
} 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());
|
||||
dialogBuilder.setView(popupAddListBinding.getRoot());
|
||||
popupAddListBinding.addList.setFilters(new InputFilter[]{new InputFilter.LengthFilter(255)});
|
||||
|
|
|
@ -24,7 +24,6 @@ import android.content.IntentFilter;
|
|||
import android.content.SharedPreferences;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.Point;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
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.helper.Helper;
|
||||
import app.fedilab.android.helper.MediaHelper;
|
||||
import app.fedilab.android.helper.ThemeHelper;
|
||||
import app.fedilab.android.interfaces.OnDownloadInterface;
|
||||
import app.fedilab.android.ui.fragment.media.FragmentMedia;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
|
@ -114,7 +112,7 @@ public class MediaActivity extends BaseActivity implements OnDownloadInterface {
|
|||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
getWindow().requestFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
|
||||
ThemeHelper.applyThemeBar(this);
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
ActivityCompat.postponeEnterTransition(MediaActivity.this);
|
||||
binding = ActivityMediaPagerBinding.inflate(getLayoutInflater());
|
||||
|
@ -132,7 +130,6 @@ public class MediaActivity extends BaseActivity implements OnDownloadInterface {
|
|||
if (getSupportActionBar() != null) {
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
getSupportActionBar().setDisplayShowHomeEnabled(true);
|
||||
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
||||
}
|
||||
|
||||
if (attachments == null || attachments.size() == 0)
|
||||
|
|
|
@ -16,7 +16,6 @@ package app.fedilab.android.activities;
|
|||
|
||||
|
||||
import android.content.Intent;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.text.method.LinkMovementMethod;
|
||||
|
@ -25,7 +24,6 @@ import android.view.View;
|
|||
import android.widget.TextView;
|
||||
|
||||
import androidx.core.app.ActivityOptionsCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -49,13 +47,12 @@ public class PartnerShipActivity extends BaseActivity {
|
|||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
ThemeHelper.applyThemeBar(this);
|
||||
|
||||
ActivityPartnershipBinding binding = ActivityPartnershipBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
|
||||
if (getSupportActionBar() != null) {
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
||||
}
|
||||
|
||||
TextView about_partnership = findViewById(R.id.about_partnership);
|
||||
|
|
|
@ -25,7 +25,6 @@ import android.content.Intent;
|
|||
import android.content.IntentFilter;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.text.SpannableString;
|
||||
|
@ -135,7 +134,7 @@ public class ProfileActivity extends BaseActivity {
|
|||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
ThemeHelper.applyTheme(this);
|
||||
|
||||
binding = ActivityProfileBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
setSupportActionBar(binding.toolbar);
|
||||
|
@ -154,7 +153,6 @@ public class ProfileActivity extends BaseActivity {
|
|||
//Remove title
|
||||
if (actionBar != null) {
|
||||
actionBar.setDisplayShowTitleEnabled(false);
|
||||
actionBar.setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
||||
}
|
||||
|
||||
if (getSupportActionBar() != null) {
|
||||
|
@ -164,7 +162,6 @@ public class ProfileActivity extends BaseActivity {
|
|||
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
float scale = sharedpreferences.getFloat(getString(R.string.SET_FONT_SCALE), 1.1f);
|
||||
binding.title.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18 * 1.1f / scale);
|
||||
binding.toolbar.setPopupTheme(Helper.popupStyle());
|
||||
accountsVM = new ViewModelProvider(ProfileActivity.this).get(AccountsVM.class);
|
||||
if (account != null) {
|
||||
initializeView(account);
|
||||
|
@ -263,8 +260,6 @@ public class ProfileActivity extends BaseActivity {
|
|||
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);
|
||||
String targetedUrl = disableGif ? account.avatar_static : account.avatar;
|
||||
Glide.with(ProfileActivity.this)
|
||||
|
@ -314,7 +309,7 @@ public class ProfileActivity extends BaseActivity {
|
|||
|
||||
final SpannableString content = new SpannableString(getString(R.string.disclaimer_full));
|
||||
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);
|
||||
binding.warningMessage.setText(content);
|
||||
binding.warningMessage.setOnClickListener(view -> {
|
||||
|
@ -427,7 +422,7 @@ public class ProfileActivity extends BaseActivity {
|
|||
} else if (doAction == action.UNFOLLOW) {
|
||||
boolean confirm_unfollow = sharedpreferences.getBoolean(getString(R.string.SET_UNFOLLOW_VALIDATION), true);
|
||||
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.setMessage(account.acct);
|
||||
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
|
||||
if (identityProofsRecycler == null) {
|
||||
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);
|
||||
LinearLayoutManager mLayoutManager = new LinearLayoutManager(ProfileActivity.this);
|
||||
identityProofsRecycler.setLayoutManager(mLayoutManager);
|
||||
|
@ -603,7 +598,7 @@ public class ProfileActivity extends BaseActivity {
|
|||
binding.personalNote.setText(relationship.note);
|
||||
}
|
||||
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);
|
||||
EditText input = new EditText(ProfileActivity.this);
|
||||
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
|
||||
|
@ -778,7 +773,7 @@ public class ProfileActivity extends BaseActivity {
|
|||
});
|
||||
return true;
|
||||
} 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);
|
||||
List<String> tags = new ArrayList<>();
|
||||
if (featuredTagsSet != null) {
|
||||
|
@ -847,7 +842,7 @@ public class ProfileActivity extends BaseActivity {
|
|||
}
|
||||
accountsVM.getListContainingAccount(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, account.id)
|
||||
.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.setPositiveButton(R.string.close, (dialog, which) -> dialog.dismiss());
|
||||
String[] listsId = new String[mastodonLists.size()];
|
||||
|
@ -935,7 +930,7 @@ public class ProfileActivity extends BaseActivity {
|
|||
});
|
||||
return true;
|
||||
}
|
||||
builderInner = new AlertDialog.Builder(ProfileActivity.this, Helper.dialogStyle());
|
||||
builderInner = new AlertDialog.Builder(ProfileActivity.this);
|
||||
builderInner.setTitle(stringArrayConf[0]);
|
||||
|
||||
builderInner.setNeutralButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
|
||||
|
@ -963,7 +958,7 @@ public class ProfileActivity extends BaseActivity {
|
|||
});
|
||||
return true;
|
||||
} 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);
|
||||
//Text for report
|
||||
EditText input = new EditText(ProfileActivity.this);
|
||||
|
@ -983,7 +978,7 @@ public class ProfileActivity extends BaseActivity {
|
|||
builderInner.show();
|
||||
return true;
|
||||
} 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.blocking) {
|
||||
builderInner.setTitle(stringArrayConf[5]);
|
||||
|
@ -1023,7 +1018,7 @@ public class ProfileActivity extends BaseActivity {
|
|||
});
|
||||
builderInner.show();
|
||||
} 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];
|
||||
builderInner.setMessage(getString(R.string.block_domain_confirm_message, domain));
|
||||
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.SharedPreferences;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
|
@ -34,7 +33,6 @@ import android.widget.Toast;
|
|||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
@ -57,7 +55,6 @@ import app.fedilab.android.databinding.ActivityReorderTabsBinding;
|
|||
import app.fedilab.android.databinding.PopupSearchInstanceBinding;
|
||||
import app.fedilab.android.exception.DBException;
|
||||
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.SimpleItemTouchHelperCallback;
|
||||
import app.fedilab.android.ui.drawer.ReorderBottomMenuAdapter;
|
||||
|
@ -100,13 +97,12 @@ public class ReorderTimelinesActivity extends BaseActivity implements OnStartDra
|
|||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
ThemeHelper.applyThemeBar(this);
|
||||
|
||||
binding = ActivityReorderTabsBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
searchInstanceRunning = false;
|
||||
if (getSupportActionBar() != null) {
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
||||
}
|
||||
|
||||
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(ReorderTimelinesActivity.this);
|
||||
|
@ -174,7 +170,7 @@ public class ReorderTimelinesActivity extends BaseActivity implements OnStartDra
|
|||
}
|
||||
|
||||
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());
|
||||
dialogBuilder.setView(popupSearchInstanceBinding.getRoot());
|
||||
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,
|
||||
* see <http://www.gnu.org/licenses>. */
|
||||
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
|
@ -22,7 +21,6 @@ import android.widget.RadioButton;
|
|||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.widget.LinearLayoutCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
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.databinding.ActivityReportBinding;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.helper.ThemeHelper;
|
||||
import app.fedilab.android.ui.drawer.RulesAdapter;
|
||||
import app.fedilab.android.ui.fragment.timeline.FragmentMastodonTimeline;
|
||||
import app.fedilab.android.viewmodel.mastodon.AccountsVM;
|
||||
|
@ -64,14 +61,13 @@ public class ReportActivity extends BaseActivity {
|
|||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
ThemeHelper.applyThemeBar(this);
|
||||
|
||||
binding = ActivityReportBinding.inflate(getLayoutInflater());
|
||||
|
||||
setContentView(binding.getRoot());
|
||||
|
||||
if (getSupportActionBar() != null) {
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
||||
}
|
||||
|
||||
Bundle b = getIntent().getExtras();
|
||||
|
|
|
@ -17,14 +17,12 @@ package app.fedilab.android.activities;
|
|||
import static app.fedilab.android.BaseMainActivity.currentAccount;
|
||||
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.util.TypedValue;
|
||||
import android.view.MenuItem;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
||||
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.databinding.ActivityScheduledBinding;
|
||||
import app.fedilab.android.helper.MastodonHelper;
|
||||
import app.fedilab.android.helper.ThemeHelper;
|
||||
import app.fedilab.android.ui.pageadapter.FedilabScheduledPageAdapter;
|
||||
|
||||
public class ScheduledActivity extends BaseActivity {
|
||||
|
@ -42,7 +39,7 @@ public class ScheduledActivity extends BaseActivity {
|
|||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
ThemeHelper.applyTheme(this);
|
||||
|
||||
binding = ActivityScheduledBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
setSupportActionBar(binding.toolbar);
|
||||
|
@ -50,7 +47,6 @@ public class ScheduledActivity extends BaseActivity {
|
|||
//Remove title
|
||||
if (actionBar != null) {
|
||||
actionBar.setDisplayShowTitleEnabled(false);
|
||||
actionBar.setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
||||
}
|
||||
if (getSupportActionBar() != null) {
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
@ -68,8 +64,7 @@ public class ScheduledActivity extends BaseActivity {
|
|||
binding.scheduleViewpager.setAdapter(new FedilabScheduledPageAdapter(getSupportFragmentManager()));
|
||||
binding.scheduleViewpager.setOffscreenPageLimit(3);
|
||||
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() {
|
||||
@Override
|
||||
|
|
|
@ -16,7 +16,6 @@ package app.fedilab.android.activities;
|
|||
|
||||
import android.app.SearchManager;
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
|
@ -27,7 +26,6 @@ import android.widget.Toast;
|
|||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.widget.SearchView;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentStatePagerAdapter;
|
||||
|
@ -41,7 +39,6 @@ import org.jetbrains.annotations.NotNull;
|
|||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.databinding.ActivitySearchResultTabsBinding;
|
||||
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.FragmentMastodonTag;
|
||||
import app.fedilab.android.ui.fragment.timeline.FragmentMastodonTimeline;
|
||||
|
@ -58,7 +55,7 @@ public class SearchResultTabActivity extends BaseActivity {
|
|||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
ThemeHelper.applyThemeBar(this);
|
||||
|
||||
binding = ActivitySearchResultTabsBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
|
||||
|
@ -75,7 +72,6 @@ public class SearchResultTabActivity extends BaseActivity {
|
|||
|
||||
if (getSupportActionBar() != null) {
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
||||
}
|
||||
setTitle(search);
|
||||
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.toots)));
|
||||
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() {
|
||||
@Override
|
||||
public void onTabSelected(TabLayout.Tab tab) {
|
||||
|
|
|
@ -16,24 +16,20 @@ package app.fedilab.android.activities
|
|||
|
||||
import android.os.Bundle
|
||||
import android.view.MenuItem
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import androidx.navigation.findNavController
|
||||
import androidx.navigation.ui.AppBarConfiguration
|
||||
import androidx.navigation.ui.navigateUp
|
||||
import androidx.navigation.ui.setupActionBarWithNavController
|
||||
import app.fedilab.android.R
|
||||
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 appBarConfiguration: AppBarConfiguration
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
ThemeHelper.applyThemeBar(this)
|
||||
|
||||
|
||||
binding = ActivitySettingsBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
|
@ -56,15 +52,4 @@ class SettingsActivity : BaseActivity(), FragmentThemingSettings.ActionTheming {
|
|||
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.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.view.MenuItem;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.databinding.ActivityStatusHistoryBinding;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.helper.ThemeHelper;
|
||||
import app.fedilab.android.ui.drawer.StatusHistoryAdapter;
|
||||
import app.fedilab.android.viewmodel.mastodon.StatusesVM;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
|
@ -40,14 +37,13 @@ public class StatusHistoryActivity extends BaseActivity {
|
|||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
ThemeHelper.applyTheme(this);
|
||||
|
||||
ActivityStatusHistoryBinding binding = ActivityStatusHistoryBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
|
||||
|
||||
if (getSupportActionBar() != null) {
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
||||
}
|
||||
|
||||
Bundle b = getIntent().getExtras();
|
||||
|
|
|
@ -15,13 +15,11 @@ package app.fedilab.android.activities;
|
|||
* see <http://www.gnu.org/licenses>. */
|
||||
|
||||
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
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.databinding.ActivityStatusInfoBinding;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.helper.ThemeHelper;
|
||||
import app.fedilab.android.ui.drawer.AccountAdapter;
|
||||
import app.fedilab.android.viewmodel.mastodon.AccountsVM;
|
||||
import app.fedilab.android.viewmodel.mastodon.StatusesVM;
|
||||
|
@ -56,14 +53,13 @@ public class StatusInfoActivity extends BaseActivity {
|
|||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
ThemeHelper.applyTheme(this);
|
||||
|
||||
binding = ActivityStatusInfoBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
setSupportActionBar(binding.toolbar);
|
||||
if (getSupportActionBar() != null) {
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
getSupportActionBar().setDisplayShowHomeEnabled(true);
|
||||
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
||||
}
|
||||
accountList = new ArrayList<>();
|
||||
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,
|
||||
* see <http://www.gnu.org/licenses>. */
|
||||
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.view.MenuItem;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.databinding.ActivitySuggestionsBinding;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.helper.ThemeHelper;
|
||||
import app.fedilab.android.ui.fragment.timeline.FragmentMastodonSuggestion;
|
||||
|
||||
|
||||
|
@ -35,14 +31,13 @@ public class SuggestionActivity extends BaseActivity {
|
|||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
ThemeHelper.applyThemeBar(this);
|
||||
|
||||
ActivitySuggestionsBinding binding = ActivitySuggestionsBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
|
||||
|
||||
if (getSupportActionBar() != null) {
|
||||
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);
|
||||
|
|
|
@ -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,
|
||||
* see <http://www.gnu.org/licenses>. */
|
||||
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.view.MenuItem;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
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.databinding.ActivityTrendsBinding;
|
||||
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.FragmentMastodonTimeline;
|
||||
|
||||
|
@ -48,20 +45,17 @@ public class TrendsActivity extends BaseActivity {
|
|||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
ThemeHelper.applyThemeBar(this);
|
||||
|
||||
binding = ActivityTrendsBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
|
||||
|
||||
if (getSupportActionBar() != null) {
|
||||
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.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() {
|
||||
@Override
|
||||
public void onTabSelected(TabLayout.Tab tab) {
|
||||
|
|
|
@ -20,7 +20,6 @@ import android.annotation.SuppressLint;
|
|||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.graphics.drawable.LayerDrawable;
|
||||
import android.net.Uri;
|
||||
|
@ -46,7 +45,6 @@ import app.fedilab.android.R;
|
|||
import app.fedilab.android.databinding.ActivityWebviewBinding;
|
||||
import app.fedilab.android.helper.CountDrawable;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.helper.ThemeHelper;
|
||||
import app.fedilab.android.webview.CustomWebview;
|
||||
import app.fedilab.android.webview.FedilabWebChromeClient;
|
||||
import app.fedilab.android.webview.FedilabWebViewClient;
|
||||
|
@ -67,7 +65,7 @@ public class WebviewActivity extends BaseActivity {
|
|||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
ThemeHelper.applyTheme(this);
|
||||
|
||||
binding = ActivityWebviewBinding.inflate(getLayoutInflater());
|
||||
View view = binding.getRoot();
|
||||
setContentView(view);
|
||||
|
@ -80,7 +78,6 @@ public class WebviewActivity extends BaseActivity {
|
|||
if (getSupportActionBar() != null) {
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
getSupportActionBar().setDisplayShowHomeEnabled(true);
|
||||
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
||||
}
|
||||
Bundle b = getIntent().getExtras();
|
||||
if (b != null) {
|
||||
|
@ -193,7 +190,7 @@ public class WebviewActivity extends BaseActivity {
|
|||
final ArrayAdapter<String> arrayAdapter = new ArrayAdapter<>(WebviewActivity.this, R.layout.domains_blocked);
|
||||
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.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.exception.DBException;
|
||||
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.AdminVM;
|
||||
import app.fedilab.android.viewmodel.mastodon.OauthVM;
|
||||
|
@ -119,7 +118,7 @@ public class WebviewConnectActivity extends BaseActivity {
|
|||
@SuppressLint("SetJavaScriptEnabled")
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
ThemeHelper.applyTheme(this);
|
||||
|
||||
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(WebviewConnectActivity.this);
|
||||
|
||||
binding = ActivityWebviewConnectBinding.inflate(getLayoutInflater());
|
||||
|
|
|
@ -19,7 +19,6 @@ import android.content.ClipData;
|
|||
import android.content.ClipboardManager;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
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.MastodonHelper;
|
||||
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.NodeInfoVM;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
|
@ -83,7 +81,7 @@ public class AdminAccountActivity extends BaseActivity {
|
|||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
ThemeHelper.applyTheme(this);
|
||||
|
||||
binding = ActivityAdminAccountBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
setSupportActionBar(binding.toolbar);
|
||||
|
@ -99,7 +97,6 @@ public class AdminAccountActivity extends BaseActivity {
|
|||
//Remove title
|
||||
if (actionBar != null) {
|
||||
actionBar.setDisplayShowTitleEnabled(false);
|
||||
actionBar.setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
||||
}
|
||||
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
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().setDisplayShowHomeEnabled(true);
|
||||
}
|
||||
binding.toolbar.setPopupTheme(Helper.popupStyle());
|
||||
adminVM = new ViewModelProvider(AdminAccountActivity.this).get(AdminVM.class);
|
||||
if (account_id != null) {
|
||||
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));
|
||||
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);
|
||||
|
||||
//This account was moved to another one
|
||||
|
|
|
@ -22,7 +22,6 @@ import android.content.BroadcastReceiver;
|
|||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
|
@ -30,7 +29,6 @@ import android.view.MenuItem;
|
|||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
|
@ -81,13 +79,12 @@ public class AdminActionActivity extends BaseActivity {
|
|||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
ThemeHelper.applyThemeBar(this);
|
||||
|
||||
binding = ActivityAdminActionsBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
LocalBroadcastManager.getInstance(this).registerReceiver(mReceiver, new IntentFilter(Helper.BROADCAST_DATA));
|
||||
if (getSupportActionBar() != null) {
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
||||
}
|
||||
canGoBack = false;
|
||||
binding.reports.setOnClickListener(v -> displayTimeline(REPORT));
|
||||
|
@ -167,7 +164,7 @@ public class AdminActionActivity extends BaseActivity {
|
|||
return true;
|
||||
} else if (item.getItemId() == R.id.action_filter) {
|
||||
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());
|
||||
alertDialogBuilder.setView(binding.getRoot());
|
||||
if (local != null && remote == null) {
|
||||
|
@ -261,7 +258,7 @@ public class AdminActionActivity extends BaseActivity {
|
|||
AlertDialog alert = alertDialogBuilder.create();
|
||||
alert.show();
|
||||
} else {
|
||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(AdminActionActivity.this, Helper.dialogStyle());
|
||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(AdminActionActivity.this);
|
||||
PopupAdminFilterReportsBinding binding = PopupAdminFilterReportsBinding.inflate(getLayoutInflater());
|
||||
alertDialogBuilder.setView(binding.getRoot());
|
||||
if (resolved == null) {
|
||||
|
|
|
@ -18,7 +18,6 @@ package app.fedilab.android.activities.admin;
|
|||
import static app.fedilab.android.helper.Helper.BROADCAST_DATA;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
|
@ -28,7 +27,6 @@ import android.widget.ArrayAdapter;
|
|||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
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.databinding.ActivityAdminDomainblockBinding;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.helper.ThemeHelper;
|
||||
import app.fedilab.android.viewmodel.mastodon.AdminVM;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
|
||||
|
@ -52,12 +49,11 @@ public class AdminDomainBlockActivity extends BaseActivity {
|
|||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
ThemeHelper.applyThemeBar(this);
|
||||
|
||||
ActivityAdminDomainblockBinding binding = ActivityAdminDomainblockBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
if (getSupportActionBar() != null) {
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
||||
}
|
||||
Bundle b = getIntent().getExtras();
|
||||
if (b != null) {
|
||||
|
@ -133,7 +129,7 @@ public class AdminDomainBlockActivity extends BaseActivity {
|
|||
return true;
|
||||
} else if (itemId == R.id.action_delete) {
|
||||
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
|
||||
.setPositiveButton(R.string.unblock_domain, (dialog, which) -> {
|
||||
|
|
|
@ -19,7 +19,6 @@ import android.content.ClipData;
|
|||
import android.content.ClipboardManager;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
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.MastodonHelper;
|
||||
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.NodeInfoVM;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
|
@ -83,7 +81,7 @@ public class AdminReportActivity extends BaseActivity {
|
|||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
ThemeHelper.applyTheme(this);
|
||||
|
||||
binding = ActivityAdminAccountBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
setSupportActionBar(binding.toolbar);
|
||||
|
@ -100,7 +98,6 @@ public class AdminReportActivity extends BaseActivity {
|
|||
//Remove title
|
||||
if (actionBar != null) {
|
||||
actionBar.setDisplayShowTitleEnabled(false);
|
||||
actionBar.setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary)));
|
||||
}
|
||||
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
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().setDisplayShowHomeEnabled(true);
|
||||
}
|
||||
binding.toolbar.setPopupTheme(Helper.popupStyle());
|
||||
if (account != null) {
|
||||
initializeView(account);
|
||||
} else {
|
||||
|
@ -314,7 +310,7 @@ public class AdminReportActivity extends BaseActivity {
|
|||
|
||||
final SpannableString content = new SpannableString(getString(R.string.disclaimer_full));
|
||||
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);
|
||||
|
||||
//This account was moved to another one
|
||||
|
|
|
@ -63,7 +63,7 @@ public class CirclesDrawingView extends View {
|
|||
// Generate bitmap used for background
|
||||
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.setStyle(Paint.Style.STROKE);
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@ public class CrossActionHelper {
|
|||
}
|
||||
Handler mainHandler = new Handler(Looper.getMainLooper());
|
||||
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));
|
||||
final AccountsSearchAdapter accountsSearchAdapter = new AccountsSearchAdapter(context, accountList);
|
||||
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);
|
||||
BaseAccount selectedAccount = accountArray[which];
|
||||
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) {
|
||||
alt_bld.setMessage(context.getString(R.string.reblog_add));
|
||||
} else {
|
||||
|
@ -409,7 +409,7 @@ public class CrossActionHelper {
|
|||
context.startActivity(intentToot);
|
||||
((BaseActivity) context).finish();
|
||||
} 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));
|
||||
final AccountsSearchAdapter accountsSearchAdapter = new AccountsSearchAdapter(context, accountList);
|
||||
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.JsonToken;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import com.jaredrummler.cyanea.Cyanea;
|
||||
|
||||
import org.conscrypt.Conscrypt;
|
||||
|
||||
|
@ -473,7 +472,7 @@ public class Helper {
|
|||
* @param url String download 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;
|
||||
try {
|
||||
request = new DownloadManager.Request(Uri.parse(url.trim()));
|
||||
|
@ -941,13 +940,6 @@ public class Helper {
|
|||
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
|
||||
|
@ -1832,7 +1824,7 @@ public class Helper {
|
|||
is.close();
|
||||
String json = new String(buffer, StandardCharsets.UTF_8);
|
||||
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());
|
||||
dialogBuilderOptin.setView(binding.getRoot());
|
||||
try {
|
||||
|
|
|
@ -357,7 +357,7 @@ public class MastodonHelper {
|
|||
* @param status {@link Status}
|
||||
*/
|
||||
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());
|
||||
dialogBuilder.setView(binding.getRoot());
|
||||
final AlertDialog alertDialogBoost = dialogBuilder.create();
|
||||
|
|
|
@ -293,7 +293,7 @@ public class MediaHelper {
|
|||
AudioRecorder mAudioRecorder = AudioRecorder.getInstance();
|
||||
File mAudioFile = new File(filePath);
|
||||
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());
|
||||
AlertDialog alert = audioPopup.create();
|
||||
alert.show();
|
||||
|
@ -341,7 +341,7 @@ public class MediaHelper {
|
|||
* @param listener - OnSchedule
|
||||
*/
|
||||
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());
|
||||
|
||||
dialogBuilder.setView(binding.getRoot());
|
||||
|
|
|
@ -28,7 +28,6 @@ import android.os.Bundle;
|
|||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.util.TypedValue;
|
||||
import android.view.ContextThemeWrapper;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
|
@ -423,7 +422,7 @@ public class PinnedTimelineHelper {
|
|||
Pinned finalPinned = pinned;
|
||||
int finalToRemove1 = toRemove;
|
||||
activityMainBinding.moreTimelines.setOnClickListener(v -> {
|
||||
PopupMenu popup = new PopupMenu(new ContextThemeWrapper(activity, Helper.popupStyle()), v);
|
||||
PopupMenu popup = new PopupMenu(activity, v);
|
||||
try {
|
||||
@SuppressLint("PrivateApi")
|
||||
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) {
|
||||
boolean showExtendedFilter = timeLineEnum == Timeline.TimeLineEnum.HOME;
|
||||
PopupMenu popup = new PopupMenu(new ContextThemeWrapper(activity, Helper.popupStyle()), view);
|
||||
PopupMenu popup = new PopupMenu(activity, view);
|
||||
popup.getMenuInflater()
|
||||
.inflate(R.menu.option_filter_toots, popup.getMenu());
|
||||
Menu menu = popup.getMenu();
|
||||
|
@ -681,7 +680,7 @@ public class PinnedTimelineHelper {
|
|||
itemShowReplies.setChecked(show_replies);
|
||||
editor.apply();
|
||||
} 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();
|
||||
View dialogView = inflater.inflate(R.layout.popup_filter_regex, new LinearLayout(activity), false);
|
||||
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) {
|
||||
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);
|
||||
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(activity);
|
||||
boolean singleBar = sharedpreferences.getBoolean(activity.getString(R.string.SET_USE_SINGLE_TOPBAR), false);
|
||||
|
@ -870,7 +869,7 @@ public class PinnedTimelineHelper {
|
|||
e.printStackTrace();
|
||||
}
|
||||
} 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();
|
||||
View dialogView = inflater.inflate(R.layout.tags_any, new LinearLayout(activity), false);
|
||||
dialogBuilder.setView(dialogView);
|
||||
|
@ -899,7 +898,7 @@ public class PinnedTimelineHelper {
|
|||
LayoutInflater inflater;
|
||||
View dialogView;
|
||||
AlertDialog alertDialog;
|
||||
dialogBuilder = new AlertDialog.Builder(activity, Helper.dialogStyle());
|
||||
dialogBuilder = new AlertDialog.Builder(activity);
|
||||
inflater = activity.getLayoutInflater();
|
||||
dialogView = inflater.inflate(R.layout.tags_all, new LinearLayout(activity), false);
|
||||
dialogBuilder.setView(dialogView);
|
||||
|
@ -928,7 +927,7 @@ public class PinnedTimelineHelper {
|
|||
LayoutInflater inflater;
|
||||
View dialogView;
|
||||
AlertDialog alertDialog;
|
||||
dialogBuilder = new AlertDialog.Builder(activity, Helper.dialogStyle());
|
||||
dialogBuilder = new AlertDialog.Builder(activity);
|
||||
inflater = activity.getLayoutInflater();
|
||||
dialogView = inflater.inflate(R.layout.tags_all, new LinearLayout(activity), false);
|
||||
dialogBuilder.setView(dialogView);
|
||||
|
@ -957,7 +956,7 @@ public class PinnedTimelineHelper {
|
|||
LayoutInflater inflater;
|
||||
View dialogView;
|
||||
AlertDialog alertDialog;
|
||||
dialogBuilder = new AlertDialog.Builder(activity, Helper.dialogStyle());
|
||||
dialogBuilder = new AlertDialog.Builder(activity);
|
||||
inflater = activity.getLayoutInflater();
|
||||
dialogView = inflater.inflate(R.layout.tags_name, new LinearLayout(activity), false);
|
||||
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) {
|
||||
|
||||
PopupMenu popup = new PopupMenu(new ContextThemeWrapper(activity, Helper.popupStyle()), view);
|
||||
PopupMenu popup = new PopupMenu(activity, view);
|
||||
int toRemove = itemToRemoveInBottomMenu(activity);
|
||||
int offSetPosition = position - (BOTTOM_TIMELINE_COUNT - toRemove);
|
||||
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(activity);
|
||||
|
@ -1145,7 +1144,7 @@ public class PinnedTimelineHelper {
|
|||
}
|
||||
});
|
||||
changes[0] = true;
|
||||
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(activity, Helper.dialogStyle());
|
||||
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(activity);
|
||||
LayoutInflater inflater = activity.getLayoutInflater();
|
||||
View dialogView = inflater.inflate(R.layout.tags_instance, new LinearLayout(activity), false);
|
||||
dialogBuilder.setView(dialogView);
|
||||
|
@ -1229,7 +1228,7 @@ public class PinnedTimelineHelper {
|
|||
if (remoteInstance == null)
|
||||
return;
|
||||
String accounts = remoteInstance.host;
|
||||
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(activity, Helper.dialogStyle());
|
||||
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(activity);
|
||||
LayoutInflater inflater = activity.getLayoutInflater();
|
||||
View dialogView = inflater.inflate(R.layout.tags_any, new LinearLayout(activity), false);
|
||||
dialogBuilder.setView(dialogView);
|
||||
|
|
|
@ -57,7 +57,7 @@ public class PushHelper {
|
|||
Runnable myRunnable = () -> {
|
||||
List<String> distributors = UnifiedPush.getDistributors(context, new ArrayList<>());
|
||||
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);
|
||||
final TextView message = new TextView(context);
|
||||
String link = "https://fedilab.app/wiki/features/push-notifications/";
|
||||
|
@ -134,7 +134,7 @@ public class PushHelper {
|
|||
return;
|
||||
}
|
||||
|
||||
AlertDialog.Builder alert = new AlertDialog.Builder(context, Helper.dialogStyle());
|
||||
AlertDialog.Builder alert = new AlertDialog.Builder(context);
|
||||
alert.setTitle(R.string.select_distributors);
|
||||
String[] distributorsStr = distributors.toArray(new String[0]);
|
||||
alert.setSingleChoiceItems(distributorsStr, -1, (dialog, item) -> {
|
||||
|
|
|
@ -252,7 +252,7 @@ public class SpannableHelper {
|
|||
@Override
|
||||
public void onLongClick(View view) {
|
||||
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));
|
||||
dialogBuilder.setView(popupLinksBinding.getRoot());
|
||||
AlertDialog alertDialog = dialogBuilder.create();
|
||||
|
@ -270,7 +270,7 @@ public class SpannableHelper {
|
|||
}
|
||||
String finalURl1 = finalURl;
|
||||
popupLinksBinding.displayFullLink.setOnClickListener(v -> {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(mContext, Helper.dialogStyle());
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(mContext);
|
||||
builder.setMessage(finalURl1);
|
||||
builder.setTitle(context.getString(R.string.display_full_link));
|
||||
builder.setPositiveButton(R.string.close, (dialog, which) -> dialog.dismiss())
|
||||
|
@ -347,7 +347,7 @@ public class SpannableHelper {
|
|||
Handler mainHandler = new Handler(context.getMainLooper());
|
||||
String finalRedirect = redirect;
|
||||
Runnable myRunnable = () -> {
|
||||
AlertDialog.Builder builder1 = new AlertDialog.Builder(view.getContext(), Helper.dialogStyle());
|
||||
AlertDialog.Builder builder1 = new AlertDialog.Builder(view.getContext());
|
||||
if (finalRedirect != null) {
|
||||
builder1.setMessage(context.getString(R.string.redirect_detected, finalURl1, finalRedirect));
|
||||
builder1.setNegativeButton(R.string.copy_link, (dialog, which) -> {
|
||||
|
@ -488,7 +488,7 @@ public class SpannableHelper {
|
|||
@Override
|
||||
public void onLongClick(View view) {
|
||||
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));
|
||||
dialogBuilder.setView(popupLinksBinding.getRoot());
|
||||
AlertDialog alertDialog = dialogBuilder.create();
|
||||
|
@ -499,7 +499,7 @@ public class SpannableHelper {
|
|||
}
|
||||
String finalURl1 = finalURl;
|
||||
popupLinksBinding.displayFullLink.setOnClickListener(v -> {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(mContext, Helper.dialogStyle());
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(mContext);
|
||||
builder.setMessage(finalURl1);
|
||||
builder.setTitle(context.getString(R.string.display_full_link));
|
||||
builder.setPositiveButton(R.string.close, (dialog, which) -> dialog.dismiss())
|
||||
|
@ -576,7 +576,7 @@ public class SpannableHelper {
|
|||
Handler mainHandler = new Handler(context.getMainLooper());
|
||||
String finalRedirect = redirect;
|
||||
Runnable myRunnable = () -> {
|
||||
AlertDialog.Builder builder1 = new AlertDialog.Builder(view.getContext(), Helper.dialogStyle());
|
||||
AlertDialog.Builder builder1 = new AlertDialog.Builder(view.getContext());
|
||||
if (finalRedirect != null) {
|
||||
builder1.setMessage(context.getString(R.string.redirect_detected, finalURl1, finalRedirect));
|
||||
builder1.setNegativeButton(R.string.copy_link, (dialog, which) -> {
|
||||
|
@ -908,7 +908,7 @@ public class SpannableHelper {
|
|||
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
|
||||
.setPositiveButton(R.string.yes, (dialog, which) -> {
|
||||
|
@ -977,7 +977,7 @@ public class SpannableHelper {
|
|||
int end = spannable.getSpanEnd(quoteSpan);
|
||||
int flags = spannable.getSpanFlags(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(
|
||||
ContextCompat.getColor(context, R.color.transparent),
|
||||
colord,
|
||||
|
|
|
@ -36,9 +36,6 @@ import androidx.core.content.ContextCompat;
|
|||
import androidx.core.graphics.ColorUtils;
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
||||
import com.google.android.material.button.MaterialButton;
|
||||
import com.jaredrummler.cyanea.Cyanea;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
@ -49,7 +46,7 @@ import java.util.LinkedHashMap;
|
|||
import java.util.List;
|
||||
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.activities.BaseActivity;
|
||||
|
||||
|
||||
public class ThemeHelper {
|
||||
|
||||
|
@ -72,6 +69,25 @@ public class ThemeHelper {
|
|||
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
|
||||
* 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
|
||||
|
@ -282,23 +268,6 @@ public class ThemeHelper {
|
|||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
|
|
|
@ -48,7 +48,6 @@ import app.fedilab.android.client.entities.api.Account;
|
|||
import app.fedilab.android.databinding.DrawerAccountBinding;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.helper.MastodonHelper;
|
||||
import app.fedilab.android.helper.ThemeHelper;
|
||||
import app.fedilab.android.viewmodel.mastodon.AccountsVM;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
|
||||
|
@ -79,12 +78,7 @@ public class AccountAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
|||
// start the new activity
|
||||
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.setBackgroundTintList(ColorStateList.valueOf(ContextCompat.getColor(context, R.color.cyanea_accent_dark_reference)));
|
||||
if (account.relationShip != null) {
|
||||
|
||||
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);
|
||||
} else {
|
||||
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) {
|
||||
boolean confirm_unfollow = sharedpreferences.getBoolean(context.getString(R.string.SET_UNFOLLOW_VALIDATION), true);
|
||||
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.setMessage(account.acct);
|
||||
unfollowConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
|
||||
|
|
|
@ -97,7 +97,6 @@ public class AccountListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
|
|||
notifyItemChanged(position);
|
||||
});
|
||||
} 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.setOnClickListener(v -> {
|
||||
accountList.add(0, account);
|
||||
|
|
|
@ -147,7 +147,7 @@ public class AnnouncementAdapter extends RecyclerView.Adapter<AnnouncementAdapte
|
|||
emojiPopup.toggle();
|
||||
});
|
||||
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;
|
||||
float density = context.getResources().getDisplayMetrics().density;
|
||||
int paddingDp = (int) (paddingPixel * density);
|
||||
|
|
|
@ -28,7 +28,6 @@ import android.content.Context;
|
|||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.Drawable;
|
||||
|
@ -61,7 +60,6 @@ import androidx.appcompat.widget.AppCompatEditText;
|
|||
import androidx.appcompat.widget.LinearLayoutCompat;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.widget.ImageViewCompat;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.lifecycle.ViewModelStoreOwner;
|
||||
|
@ -954,7 +952,7 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
|||
context.startActivity(intent);
|
||||
});
|
||||
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);
|
||||
PopupMediaDescriptionBinding popupMediaDescriptionBinding = PopupMediaDescriptionBinding.inflate(LayoutInflater.from(context), null, false);
|
||||
builderInner.setView(popupMediaDescriptionBinding.getRoot());
|
||||
|
@ -1011,7 +1009,7 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
|||
}
|
||||
});
|
||||
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.setPositiveButton(R.string.delete, (dialog, which) -> {
|
||||
attachmentList.remove(attachment);
|
||||
|
@ -1142,8 +1140,6 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
|||
|
||||
if (theme_statuses_color != -1) {
|
||||
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) {
|
||||
holder.binding.username.setTextColor(theme_text_header_2_line);
|
||||
|
@ -1176,8 +1172,6 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
|||
} else {
|
||||
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);
|
||||
holder.binding.content.setInputType(newInputType);
|
||||
|
@ -1186,8 +1180,6 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
|||
holder.binding.contentSpoiler.setInputType(newInputTypeSpoiler);
|
||||
if (theme_statuses_color != -1) {
|
||||
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 -> {
|
||||
if (instanceInfo.configuration.media_attachments.supported_mime_types != null) {
|
||||
|
@ -1395,11 +1387,7 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
|||
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.setOnClickListener(v -> {
|
||||
|
@ -1456,7 +1444,7 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
|||
}
|
||||
|
||||
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.setSingleChoiceItems(languagesArr, selection, null);
|
||||
|
@ -1490,7 +1478,7 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
|||
* @param position - 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);
|
||||
ComposePollBinding composePollBinding = ComposePollBinding.inflate(LayoutInflater.from(context), new LinearLayout(context), false);
|
||||
alertPoll.setView(composePollBinding.getRoot());
|
||||
|
@ -1708,7 +1696,7 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
|||
*/
|
||||
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;
|
||||
float density = context.getResources().getDisplayMetrics().density;
|
||||
int paddingDp = (int) (paddingPixel * density);
|
||||
|
|
|
@ -29,7 +29,6 @@ import java.util.List;
|
|||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.activities.MainActivity;
|
||||
import app.fedilab.android.databinding.DrawerDomainBlockBinding;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.viewmodel.mastodon.AccountsVM;
|
||||
|
||||
|
||||
|
@ -64,7 +63,7 @@ public class DomainBlockAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
|
|||
holder.binding.domainName.setText(domain);
|
||||
AccountsVM accountsVM = new ViewModelProvider((ViewModelStoreOwner) context).get(AccountsVM.class);
|
||||
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.setPositiveButton(R.string.yes, (dialog, id) -> {
|
||||
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.client.entities.api.Filter;
|
||||
import app.fedilab.android.databinding.DrawerFilterBinding;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.viewmodel.mastodon.FiltersVM;
|
||||
|
||||
|
||||
|
@ -88,7 +87,7 @@ public class FilterAdapter extends RecyclerView.Adapter<FilterAdapter.FilterView
|
|||
}
|
||||
}));
|
||||
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.setMessage(R.string.action_lists_confirm_delete);
|
||||
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.databinding.DrawerReorderBinding;
|
||||
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.ItemTouchHelperViewHolder;
|
||||
import app.fedilab.android.helper.itemtouchhelper.OnStartDragListener;
|
||||
|
@ -170,7 +169,7 @@ public class ReorderTabAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
|
|||
}
|
||||
holder.binding.delete.setOnClickListener(v -> {
|
||||
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 message = "";
|
||||
alt_bld.setTitle(R.string.action_lists_delete);
|
||||
|
|
|
@ -50,7 +50,6 @@ import android.text.Spanned;
|
|||
import android.text.TextUtils;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.util.TypedValue;
|
||||
import android.view.ContextThemeWrapper;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
|
@ -439,7 +438,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
|||
});
|
||||
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;
|
||||
float density = context.getResources().getDisplayMetrics().density;
|
||||
int paddingDp = (int) (paddingPixel * density);
|
||||
|
@ -526,7 +525,6 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
|||
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) {
|
||||
Helper.changeDrawableColor(context, holder.binding.actionButtonReply, 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) {
|
||||
holder.binding.cardviewContainer.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) {
|
||||
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 -> {
|
||||
if (confirmBoost) {
|
||||
AlertDialog.Builder alt_bld = new AlertDialog.Builder(context, Helper.dialogStyle());
|
||||
AlertDialog.Builder alt_bld = new AlertDialog.Builder(context);
|
||||
if (statusToDeal.reblogged) {
|
||||
alt_bld.setMessage(context.getString(R.string.reblog_remove));
|
||||
} else {
|
||||
|
@ -888,7 +883,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
|||
});
|
||||
holder.binding.actionButtonFavorite.setOnClickListener(v -> {
|
||||
if (confirmFav) {
|
||||
AlertDialog.Builder alt_bld = new AlertDialog.Builder(context, Helper.dialogStyle());
|
||||
AlertDialog.Builder alt_bld = new AlertDialog.Builder(context);
|
||||
if (status.favourited) {
|
||||
alt_bld.setMessage(context.getString(R.string.favourite_remove));
|
||||
} else {
|
||||
|
@ -1534,7 +1529,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
|||
if (ownvotes != null && ownvotes.contains(j)) {
|
||||
Drawable img = ContextCompat.getDrawable(context, R.drawable.ic_baseline_check_24);
|
||||
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));
|
||||
pollItemBinding.pollItemText.setCompoundDrawables(null, null, img, null);
|
||||
}
|
||||
|
@ -1551,7 +1546,6 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
|||
(holder.binding.poll.multipleChoice).removeAllViews();
|
||||
for (Poll.PollItem pollOption : statusToDeal.poll.options) {
|
||||
CheckBox cb = new CheckBox(context);
|
||||
cb.setButtonTintList(ThemeHelper.getButtonColorStateList(context));
|
||||
cb.setText(
|
||||
pollOption.getSpanTitle(context, statusToDeal,
|
||||
new WeakReference<>(cb)),
|
||||
|
@ -1565,7 +1559,6 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
|||
(holder.binding.poll.singleChoiceRadioGroup).removeAllViews();
|
||||
for (Poll.PollItem pollOption : statusToDeal.poll.options) {
|
||||
RadioButton rb = new RadioButton(context);
|
||||
rb.setButtonTintList(ThemeHelper.getButtonColorStateList(context));
|
||||
rb.setText(
|
||||
pollOption.getSpanTitle(context, statusToDeal,
|
||||
new WeakReference<>(rb)),
|
||||
|
@ -1739,7 +1732,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
|||
}
|
||||
holder.binding.actionButtonMore.setOnClickListener(v -> {
|
||||
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()
|
||||
.inflate(R.menu.option_toot, popup.getMenu());
|
||||
if (statusToDeal.visibility.equals("private") || status.visibility.equals("direct")) {
|
||||
|
@ -1786,7 +1779,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
|||
popup.setOnMenuItemClickListener(item -> {
|
||||
int itemId = item.getItemId();
|
||||
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.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
|
||||
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) {
|
||||
Helper.openBrowser(context, statusToDeal.url);
|
||||
} 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.setMessage(statusToDeal.content);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
||||
|
@ -1859,7 +1852,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
|||
}));
|
||||
builderInner.show();
|
||||
} 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]);
|
||||
String domain = statusToDeal.account.acct.split("@")[1];
|
||||
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();
|
||||
} 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.setMessage(statusToDeal.account.acct);
|
||||
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);
|
||||
return true;
|
||||
} 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.setMessage(statusToDeal.account.acct);
|
||||
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());
|
||||
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));
|
||||
final AccountsSearchAdapter accountsSearchAdapter = new AccountsSearchAdapter(context, accountList);
|
||||
final BaseAccount[] accountArray = new BaseAccount[accounts.size()];
|
||||
|
|
|
@ -95,7 +95,7 @@ public class StatusDraftAdapter extends RecyclerView.Adapter<StatusDraftAdapter.
|
|||
|
||||
|
||||
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.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
|
||||
unfollowConfirm.setPositiveButton(R.string.delete, (dialog, which) -> {
|
||||
|
|
|
@ -22,7 +22,6 @@ import android.view.ViewGroup;
|
|||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.preference.PreferenceManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
|
@ -93,8 +92,6 @@ public class StatusHistoryAdapter extends RecyclerView.Adapter<RecyclerView.View
|
|||
}
|
||||
if (theme_statuses_color != -1) {
|
||||
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) {
|
||||
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 -> {
|
||||
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.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
|
||||
unfollowConfirm.setPositiveButton(R.string.delete, (dialog, which) -> {
|
||||
|
|
|
@ -18,7 +18,6 @@ package app.fedilab.android.ui.drawer;
|
|||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
|
@ -27,7 +26,6 @@ import android.widget.TextView;
|
|||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.app.ActivityOptionsCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.lifecycle.ViewModelStoreOwner;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
@ -92,7 +90,6 @@ public class SuggestionAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
|
|||
context.startActivity(intent, options.toBundle());
|
||||
});
|
||||
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) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -21,7 +21,6 @@ import android.view.LayoutInflater;
|
|||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
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));
|
||||
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.setDrawFilled(true);
|
||||
dataTrending.setDrawCircles(false);
|
||||
|
|
|
@ -83,7 +83,7 @@ public class TopMenuAdapter extends RecyclerView.Adapter<TopMenuAdapter.TopMenuH
|
|||
//Manage item decoration below the text
|
||||
if (pinnedTimeline.isSelected) {
|
||||
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 {
|
||||
holder.binding.underline.setVisibility(View.GONE);
|
||||
int textColor = _mContext.getResources().getColor(android.R.color.primary_text_dark);
|
||||
|
|
|
@ -63,7 +63,6 @@ public class FragmentAdminAccount extends Fragment {
|
|||
}
|
||||
flagLoading = false;
|
||||
binding = FragmentPaginationBinding.inflate(inflater, container, false);
|
||||
binding.getRoot().setBackgroundColor(ThemeHelper.getBackgroundColor(requireActivity()));
|
||||
return binding.getRoot();
|
||||
}
|
||||
|
||||
|
@ -87,8 +86,7 @@ public class FragmentAdminAccount extends Fragment {
|
|||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
int c1 = getResources().getColor(R.color.cyanea_accent_reference);
|
||||
binding.swipeContainer.setProgressBackgroundColorSchemeColor(getResources().getColor(R.color.cyanea_primary_reference));
|
||||
int c1 = ThemeHelper.getAttColor(requireActivity(), R.attr.colorAccent);
|
||||
binding.swipeContainer.setColorSchemeColors(
|
||||
c1, c1, c1
|
||||
);
|
||||
|
|
|
@ -112,10 +112,8 @@ public class FragmentAdminDomain extends Fragment {
|
|||
}
|
||||
|
||||
binding = FragmentPaginationBinding.inflate(inflater, container, false);
|
||||
binding.getRoot().setBackgroundColor(ThemeHelper.getBackgroundColor(requireActivity()));
|
||||
|
||||
int c1 = getResources().getColor(R.color.cyanea_accent_reference);
|
||||
binding.swipeContainer.setProgressBackgroundColorSchemeColor(getResources().getColor(R.color.cyanea_primary_reference));
|
||||
int c1 = ThemeHelper.getAttColor(requireActivity(), R.attr.colorAccent);
|
||||
binding.swipeContainer.setColorSchemeColors(
|
||||
c1, c1, c1
|
||||
);
|
||||
|
|
|
@ -69,10 +69,8 @@ public class FragmentAdminReport extends Fragment {
|
|||
}
|
||||
|
||||
binding = FragmentPaginationBinding.inflate(inflater, container, false);
|
||||
binding.getRoot().setBackgroundColor(ThemeHelper.getBackgroundColor(requireActivity()));
|
||||
|
||||
int c1 = getResources().getColor(R.color.cyanea_accent_reference);
|
||||
binding.swipeContainer.setProgressBackgroundColorSchemeColor(getResources().getColor(R.color.cyanea_primary_reference));
|
||||
int c1 = ThemeHelper.getAttColor(requireActivity(), R.attr.colorAccent);
|
||||
binding.swipeContainer.setColorSchemeColors(
|
||||
c1, c1, c1
|
||||
);
|
||||
|
|
|
@ -28,7 +28,6 @@ import android.net.Uri;
|
|||
import android.os.Bundle;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.view.ContextThemeWrapper;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
|
@ -182,7 +181,7 @@ public class FragmentLoginMain extends Fragment {
|
|||
}
|
||||
|
||||
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.inflate(R.menu.main_login, popupMenu.getMenu());
|
||||
MenuItem customTabItem = popupMenu.getMenu().findItem(R.id.action_custom_tabs);
|
||||
|
|
|
@ -165,7 +165,7 @@ public class FragmentLoginRegisterMastodon extends Fragment {
|
|||
Locale.getDefault().getLanguage(), null
|
||||
).observe(requireActivity(), token -> {
|
||||
if (token != null) {
|
||||
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(requireActivity(), Helper.dialogStyle());
|
||||
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(requireActivity());
|
||||
dialogBuilder.setCancelable(false);
|
||||
dialogBuilder.setPositiveButton(R.string.validate, (dialog, which) -> {
|
||||
dialog.dismiss();
|
||||
|
|
|
@ -25,7 +25,6 @@ import androidx.preference.SwitchPreferenceCompat;
|
|||
|
||||
import app.fedilab.android.BaseMainActivity;
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
|
||||
public class FragmentComposeSettings extends PreferenceFragmentCompat implements SharedPreferences.OnSharedPreferenceChangeListener {
|
||||
|
||||
|
@ -38,7 +37,6 @@ public class FragmentComposeSettings extends PreferenceFragmentCompat implements
|
|||
private void createPref() {
|
||||
SwitchPreferenceCompat SET_WATERMARK = findPreference(getString(R.string.SET_WATERMARK));
|
||||
if (SET_WATERMARK != null) {
|
||||
SET_WATERMARK.getContext().setTheme(Helper.dialogStyle());
|
||||
}
|
||||
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity());
|
||||
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);
|
||||
}
|
||||
MultiSelectListPreference SET_SELECTED_LANGUAGE = findPreference(getString(R.string.SET_SELECTED_LANGUAGE));
|
||||
if (SET_SELECTED_LANGUAGE != null) {
|
||||
SET_SELECTED_LANGUAGE.getContext().setTheme(Helper.dialogStyle());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -64,7 +64,6 @@ public class FragmentInterfaceSettings extends PreferenceFragmentCompat implemen
|
|||
}
|
||||
ListPreference SET_LOGO_LAUNCHER = findPreference(getString(R.string.SET_LOGO_LAUNCHER));
|
||||
if (SET_LOGO_LAUNCHER != null) {
|
||||
SET_LOGO_LAUNCHER.getContext().setTheme(Helper.dialogStyle());
|
||||
SET_LOGO_LAUNCHER.setIcon(LogoHelper.getDrawable(SET_LOGO_LAUNCHER.getValue()));
|
||||
}
|
||||
recreate = false;
|
||||
|
|
|
@ -37,9 +37,6 @@ public class FragmentLanguageSettings extends PreferenceFragmentCompat implement
|
|||
@SuppressLint("ApplySharedPref")
|
||||
private void createPref() {
|
||||
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));
|
||||
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity());
|
||||
|
|
|
@ -36,7 +36,6 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.helper.PushHelper;
|
||||
import app.fedilab.android.helper.settings.TimePreference;
|
||||
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));
|
||||
if (SET_NOTIFICATION_TYPE != null) {
|
||||
SET_NOTIFICATION_TYPE.getContext().setTheme(Helper.dialogStyle());
|
||||
}
|
||||
|
||||
String[] notificationValues = getResources().getStringArray(R.array.SET_NOTIFICATION_TYPE_VALUE);
|
||||
if (SET_NOTIFICATION_TYPE != null && SET_NOTIFICATION_TYPE.getValue().equals(notificationValues[2])) {
|
||||
PreferenceCategory notification_sounds = findPreference("notification_sounds");
|
||||
|
@ -108,9 +105,7 @@ public class FragmentNotificationsSettings extends PreferenceFragmentCompat impl
|
|||
return;
|
||||
} 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));
|
||||
if (SET_NOTIFICATION_DELAY_VALUE != null) {
|
||||
SET_NOTIFICATION_DELAY_VALUE.getContext().setTheme(Helper.dialogStyle());
|
||||
}
|
||||
|
||||
ListPreference SET_PUSH_DISTRIBUTOR = findPreference("SET_PUSH_DISTRIBUTOR");
|
||||
if (SET_PUSH_DISTRIBUTOR != null) {
|
||||
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));
|
||||
if (SET_PUSH_DISTRIBUTOR != null) {
|
||||
SET_PUSH_DISTRIBUTOR.getContext().setTheme(Helper.dialogStyle());
|
||||
List<String> distributors = UnifiedPush.getDistributors(requireActivity(), new ArrayList<>());
|
||||
SET_PUSH_DISTRIBUTOR.setValue(UnifiedPush.getDistributor(requireActivity()));
|
||||
SET_PUSH_DISTRIBUTOR.setEntries(distributors.toArray(new String[0]));
|
||||
|
|
|
@ -22,7 +22,6 @@ import androidx.preference.EditTextPreference;
|
|||
import androidx.preference.PreferenceFragmentCompat;
|
||||
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
|
||||
public class FragmentPrivacySettings extends PreferenceFragmentCompat implements SharedPreferences.OnSharedPreferenceChangeListener {
|
||||
|
||||
|
@ -34,9 +33,6 @@ public class FragmentPrivacySettings extends PreferenceFragmentCompat implements
|
|||
|
||||
private void createPref() {
|
||||
EditTextPreference SET_INVIDIOUS_HOST = findPreference(getString(R.string.SET_INVIDIOUS_HOST));
|
||||
if (SET_INVIDIOUS_HOST != null) {
|
||||
SET_INVIDIOUS_HOST.getContext().setTheme(Helper.dialogStyle());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -44,9 +44,6 @@ import androidx.preference.PreferenceFragmentCompat;
|
|||
import androidx.preference.PreferenceManager;
|
||||
|
||||
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.FileNotFoundException;
|
||||
|
@ -63,7 +60,6 @@ import java.util.List;
|
|||
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.activities.ComposeActivity;
|
||||
import app.fedilab.android.activities.SettingsActivity;
|
||||
import app.fedilab.android.databinding.PopupStatusThemeBinding;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.helper.ThemeHelper;
|
||||
|
@ -76,7 +72,6 @@ public class FragmentThemingSettings extends PreferenceFragmentCompat implements
|
|||
private List<LinkedHashMap<String, String>> listOfThemes;
|
||||
private SharedPreferences appPref;
|
||||
private SharedPreferences cyneaPref;
|
||||
public ActionTheming actionTheming;
|
||||
private boolean shouldRestart;
|
||||
|
||||
@Override
|
||||
|
@ -86,7 +81,6 @@ public class FragmentThemingSettings extends PreferenceFragmentCompat implements
|
|||
createPref();
|
||||
listOfThemes = ThemeHelper.getContributorsTheme(requireActivity());
|
||||
shouldRestart = false;
|
||||
actionTheming = (SettingsActivity) requireActivity();
|
||||
}
|
||||
|
||||
|
||||
|
@ -106,9 +100,7 @@ public class FragmentThemingSettings extends PreferenceFragmentCompat implements
|
|||
getPreferenceScreen().getSharedPreferences()
|
||||
.unregisterOnSharedPreferenceChangeListener(this);
|
||||
}
|
||||
if (shouldRestart && actionTheming != null) {
|
||||
actionTheming.restart();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -121,9 +113,6 @@ public class FragmentThemingSettings extends PreferenceFragmentCompat implements
|
|||
Helper.recreateMainActivity(requireActivity());
|
||||
}
|
||||
|
||||
public interface ActionTheming {
|
||||
void restart();
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
|
@ -264,7 +253,7 @@ public class FragmentThemingSettings extends PreferenceFragmentCompat implements
|
|||
br = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8));
|
||||
String sCurrentLine;
|
||||
SharedPreferences.Editor appEditor = appPref.edit();
|
||||
Cyanea.Editor cyaneaEditor = Cyanea.getInstance().edit();
|
||||
|
||||
appEditor.putBoolean("use_custom_theme", true);
|
||||
while ((sCurrentLine = br.readLine()) != null) {
|
||||
String[] line = sCurrentLine.split(",");
|
||||
|
@ -272,35 +261,15 @@ public class FragmentThemingSettings extends PreferenceFragmentCompat implements
|
|||
String key = line[0];
|
||||
String value = line[1];
|
||||
if (key.compareTo("pref_color_navigation_bar") == 0) {
|
||||
cyaneaEditor.shouldTintNavBar(Boolean.parseBoolean(value));
|
||||
|
||||
} 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) {
|
||||
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) {
|
||||
cyaneaEditor.accentLight(Integer.parseInt(value));
|
||||
cyaneaEditor.accent(Integer.parseInt(value));
|
||||
cyaneaEditor.accentDark(Integer.parseInt(value));
|
||||
|
||||
} else if (key.compareTo("theme_primary") == 0) {
|
||||
cyaneaEditor.primary(Integer.parseInt(value));
|
||||
cyaneaEditor.primaryLight(Integer.parseInt(value));
|
||||
cyaneaEditor.primaryDark(Integer.parseInt(value));
|
||||
|
||||
} else {
|
||||
if (value != null && value.matches("-?\\d+")) {
|
||||
appEditor.putInt(key, Integer.parseInt(value));
|
||||
|
@ -311,7 +280,6 @@ public class FragmentThemingSettings extends PreferenceFragmentCompat implements
|
|||
}
|
||||
}
|
||||
appEditor.commit();
|
||||
cyaneaEditor.apply().recreate(requireActivity());
|
||||
Helper.recreateMainActivity(requireActivity());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
|
@ -337,7 +305,7 @@ public class FragmentThemingSettings extends PreferenceFragmentCompat implements
|
|||
Preference launch_custom_theme = findPreference("launch_custom_theme");
|
||||
if (launch_custom_theme != null) {
|
||||
launch_custom_theme.setOnPreferenceClickListener(preference -> {
|
||||
startActivity(new Intent(requireActivity(), CyaneaSettingsActivity.class));
|
||||
|
||||
shouldRestart = true;
|
||||
return false;
|
||||
});
|
||||
|
@ -347,7 +315,7 @@ public class FragmentThemingSettings extends PreferenceFragmentCompat implements
|
|||
if (contributors_themes != null) {
|
||||
contributors_themes.setOnPreferenceClickListener(preference -> {
|
||||
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));
|
||||
PopupStatusThemeBinding binding = PopupStatusThemeBinding.inflate(getLayoutInflater(), new LinearLayout(requireActivity()), false);
|
||||
binding.selectTheme.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
|
@ -392,9 +360,7 @@ public class FragmentThemingSettings extends PreferenceFragmentCompat implements
|
|||
}
|
||||
|
||||
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_boost_header_color = findPreference("theme_boost_header_color");
|
||||
|
@ -469,7 +435,7 @@ public class FragmentThemingSettings extends PreferenceFragmentCompat implements
|
|||
}
|
||||
if (reset_pref != null) {
|
||||
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.setPositiveButton(R.string.reset, (dialog, id) -> {
|
||||
reset();
|
||||
|
|
|
@ -22,7 +22,6 @@ import androidx.preference.PreferenceFragmentCompat;
|
|||
import androidx.preference.PreferenceManager;
|
||||
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
|
||||
public class FragmentTimelinesSettings extends PreferenceFragmentCompat implements SharedPreferences.OnSharedPreferenceChangeListener {
|
||||
|
||||
|
@ -35,7 +34,6 @@ public class FragmentTimelinesSettings extends PreferenceFragmentCompat implemen
|
|||
private void createPref() {
|
||||
ListPreference SET_LOAD_MEDIA_TYPE = findPreference(getString(R.string.SET_LOAD_MEDIA_TYPE));
|
||||
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;
|
||||
binding = FragmentPaginationBinding.inflate(inflater, container, false);
|
||||
binding.getRoot().setBackgroundColor(ThemeHelper.getBackgroundColor(requireActivity()));
|
||||
return binding.getRoot();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
int c1 = getResources().getColor(R.color.cyanea_accent_reference);
|
||||
binding.swipeContainer.setProgressBackgroundColorSchemeColor(getResources().getColor(R.color.cyanea_primary_reference));
|
||||
int c1 = ThemeHelper.getAttColor(requireActivity(), R.attr.colorAccent);
|
||||
binding.swipeContainer.setColorSchemeColors(
|
||||
c1, c1, c1
|
||||
);
|
||||
|
|
|
@ -47,9 +47,7 @@ public class FragmentMastodonAnnouncement extends Fragment {
|
|||
|
||||
binding = FragmentPaginationBinding.inflate(inflater, container, false);
|
||||
View root = binding.getRoot();
|
||||
binding.getRoot().setBackgroundColor(ThemeHelper.getBackgroundColor(requireActivity()));
|
||||
int c1 = getResources().getColor(R.color.cyanea_accent_reference);
|
||||
binding.swipeContainer.setProgressBackgroundColorSchemeColor(getResources().getColor(R.color.cyanea_primary_reference));
|
||||
int c1 = ThemeHelper.getAttColor(requireActivity(), R.attr.colorAccent);
|
||||
binding.swipeContainer.setColorSchemeColors(
|
||||
c1, c1, c1
|
||||
);
|
||||
|
|
|
@ -151,12 +151,10 @@ public class FragmentMastodonContext extends Fragment {
|
|||
getChildFragmentManager().beginTransaction().remove(this).commit();
|
||||
}
|
||||
binding = FragmentPaginationBinding.inflate(inflater, container, false);
|
||||
int c1 = getResources().getColor(R.color.cyanea_accent_reference);
|
||||
binding.swipeContainer.setProgressBackgroundColorSchemeColor(getResources().getColor(R.color.cyanea_primary_reference));
|
||||
int c1 = ThemeHelper.getAttColor(requireActivity(), R.attr.colorAccent);
|
||||
binding.swipeContainer.setColorSchemeColors(
|
||||
c1, c1, c1
|
||||
);
|
||||
binding.getRoot().setBackgroundColor(ThemeHelper.getBackgroundColor(requireActivity()));
|
||||
statusesVM = new ViewModelProvider(FragmentMastodonContext.this).get(StatusesVM.class);
|
||||
binding.recyclerView.setNestedScrollingEnabled(true);
|
||||
this.statuses = new ArrayList<>();
|
||||
|
|
|
@ -81,7 +81,6 @@ public class FragmentMastodonConversation extends Fragment implements Conversati
|
|||
ViewGroup container, Bundle savedInstanceState) {
|
||||
flagLoading = false;
|
||||
binding = FragmentPaginationBinding.inflate(inflater, container, false);
|
||||
binding.getRoot().setBackgroundColor(ThemeHelper.getBackgroundColor(requireActivity()));
|
||||
isViewInitialized = false;
|
||||
return binding.getRoot();
|
||||
}
|
||||
|
@ -239,8 +238,7 @@ public class FragmentMastodonConversation extends Fragment implements Conversati
|
|||
super.onViewCreated(view, savedInstanceState);
|
||||
|
||||
|
||||
int c1 = getResources().getColor(R.color.cyanea_accent_reference);
|
||||
binding.swipeContainer.setProgressBackgroundColorSchemeColor(getResources().getColor(R.color.cyanea_primary_reference));
|
||||
int c1 = ThemeHelper.getAttColor(requireActivity(), R.attr.colorAccent);
|
||||
binding.swipeContainer.setColorSchemeColors(
|
||||
c1, c1, c1
|
||||
);
|
||||
|
|
|
@ -53,15 +53,13 @@ public class FragmentMastodonDomainBlock extends Fragment {
|
|||
ViewGroup container, Bundle savedInstanceState) {
|
||||
|
||||
binding = FragmentPaginationBinding.inflate(inflater, container, false);
|
||||
binding.getRoot().setBackgroundColor(ThemeHelper.getBackgroundColor(requireActivity()));
|
||||
return binding.getRoot();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
int c1 = getResources().getColor(R.color.cyanea_accent_reference);
|
||||
binding.swipeContainer.setProgressBackgroundColorSchemeColor(getResources().getColor(R.color.cyanea_primary_reference));
|
||||
int c1 = ThemeHelper.getAttColor(requireActivity(), R.attr.colorAccent);
|
||||
binding.swipeContainer.setColorSchemeColors(
|
||||
c1, c1, c1
|
||||
);
|
||||
|
|
|
@ -190,9 +190,7 @@ public class FragmentMastodonNotification extends Fragment implements Notificati
|
|||
notificationType = (NotificationTypeEnum) getArguments().get(Helper.ARG_NOTIFICATION_TYPE);
|
||||
}
|
||||
aggregateNotification = false;
|
||||
binding.getRoot().setBackgroundColor(ThemeHelper.getBackgroundColor(requireActivity()));
|
||||
int c1 = getResources().getColor(R.color.cyanea_accent_reference);
|
||||
binding.swipeContainer.setProgressBackgroundColorSchemeColor(getResources().getColor(R.color.cyanea_primary_reference));
|
||||
int c1 = ThemeHelper.getAttColor(requireActivity(), R.attr.colorAccent);
|
||||
binding.swipeContainer.setColorSchemeColors(
|
||||
c1, c1, c1
|
||||
);
|
||||
|
|
|
@ -52,15 +52,13 @@ public class FragmentMastodonSuggestion extends Fragment {
|
|||
ViewGroup container, Bundle savedInstanceState) {
|
||||
flagLoading = false;
|
||||
binding = FragmentPaginationBinding.inflate(inflater, container, false);
|
||||
binding.getRoot().setBackgroundColor(ThemeHelper.getBackgroundColor(requireActivity()));
|
||||
return binding.getRoot();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
int c1 = getResources().getColor(R.color.cyanea_accent_reference);
|
||||
binding.swipeContainer.setProgressBackgroundColorSchemeColor(getResources().getColor(R.color.cyanea_primary_reference));
|
||||
int c1 = ThemeHelper.getAttColor(requireActivity(), R.attr.colorAccent);
|
||||
binding.swipeContainer.setColorSchemeColors(
|
||||
c1, c1, c1
|
||||
);
|
||||
|
|
|
@ -59,15 +59,13 @@ public class FragmentMastodonTag extends Fragment {
|
|||
}
|
||||
|
||||
binding = FragmentPaginationBinding.inflate(inflater, container, false);
|
||||
binding.getRoot().setBackgroundColor(ThemeHelper.getBackgroundColor(requireActivity()));
|
||||
return binding.getRoot();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
int c1 = getResources().getColor(R.color.cyanea_accent_reference);
|
||||
binding.swipeContainer.setProgressBackgroundColorSchemeColor(getResources().getColor(R.color.cyanea_primary_reference));
|
||||
int c1 = ThemeHelper.getAttColor(requireActivity(), R.attr.colorAccent);
|
||||
binding.swipeContainer.setColorSchemeColors(
|
||||
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));
|
||||
binding = FragmentPaginationBinding.inflate(inflater, container, false);
|
||||
binding.getRoot().setBackgroundColor(ThemeHelper.getBackgroundColor(requireActivity()));
|
||||
|
||||
int c1 = getResources().getColor(R.color.cyanea_accent_reference);
|
||||
binding.swipeContainer.setProgressBackgroundColorSchemeColor(getResources().getColor(R.color.cyanea_primary_reference));
|
||||
int c1 = ThemeHelper.getAttColor(requireActivity(), R.attr.colorAccent);
|
||||
binding.swipeContainer.setColorSchemeColors(
|
||||
c1, c1, c1
|
||||
);
|
||||
|
|
|
@ -27,9 +27,7 @@ import android.view.ViewGroup;
|
|||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.content.res.ResourcesCompat;
|
||||
import androidx.core.graphics.drawable.DrawableCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
@ -45,8 +43,6 @@ import app.fedilab.android.BaseMainActivity;
|
|||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.databinding.FragmentNotificationContainerBinding;
|
||||
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.viewmodel.mastodon.NotificationsVM;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
|
@ -89,24 +85,13 @@ public class FragmentNotificationContainer extends Fragment {
|
|||
}
|
||||
AtomicBoolean changes = new AtomicBoolean(false);
|
||||
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());
|
||||
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 -> {
|
||||
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.setMessage(R.string.delete_notification_all_warning);
|
||||
db.setPositiveButton(R.string.delete_all, (dialog, id) -> {
|
||||
|
@ -233,8 +218,6 @@ public class FragmentNotificationContainer extends Fragment {
|
|||
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.tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
|
||||
@Override
|
||||
|
|
|
@ -21,7 +21,6 @@ import android.view.ViewGroup;
|
|||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
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.databinding.FragmentProfileTimelinesBinding;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.helper.ThemeHelper;
|
||||
import app.fedilab.android.ui.pageadapter.FedilabProfilePageAdapter;
|
||||
|
||||
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.replies)));
|
||||
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.setOffscreenPageLimit(3);
|
||||
binding.viewpager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(binding.tabLayout));
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<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" />
|
||||
<path
|
||||
android:fillColor="?attr/backgroundColor"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:tint="@color/cyanea_accent_reference"
|
||||
android:tint="?colorAccent"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:tint="@color/cyanea_accent_reference"
|
||||
android:tint="?colorAccent"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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="@color/cyanea_accent_light_reference" android:state_pressed="true" />
|
||||
<item android:drawable="@color/cyanea_accent_light_reference" android:state_focused="true" />
|
||||
<item android:drawable="?attr/colorAccent" android:state_checked="true" />
|
||||
<item android:drawable="?attr/colorAccent" android:state_pressed="true" />
|
||||
<item android:drawable="?attr/colorAccent" android:state_focused="true" />
|
||||
<item android:drawable="@color/transparent" />
|
||||
</selector>
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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="@color/cyanea_accent_dark_reference" android:state_pressed="true" />
|
||||
<item android:drawable="@color/cyanea_accent_dark_reference" android:state_focused="true" />
|
||||
<item android:drawable="?attr/colorAccent" android:state_checked="true" />
|
||||
<item android:drawable="?attr/colorAccent" android:state_pressed="true" />
|
||||
<item android:drawable="?attr/colorAccent" android:state_focused="true" />
|
||||
<item android:drawable="@color/transparent" />
|
||||
</selector>
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@color/cyanea_accent_dark_reference" />
|
||||
<solid android:color="?attr/colorAccent" />
|
||||
<padding
|
||||
android:left="2dp"
|
||||
android:right="2dp" />
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="@color/cyanea_accent_dark_reference" />
|
||||
android:color="?attr/colorAccent" />
|
||||
<corners android:radius="4dp" />
|
||||
</shape>
|
||||
|
|
|
@ -131,8 +131,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
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
|
||||
|
@ -142,8 +141,6 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="PayPal"
|
||||
android:textColor="@color/cyanea_accent_dark_reference"
|
||||
app:strokeColor="@color/cyanea_accent_dark_reference"
|
||||
tools:ignore="HardcodedText" />
|
||||
|
||||
|
||||
|
@ -177,7 +174,6 @@
|
|||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/about_license"
|
||||
style="@style/MyOutlinedButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="3"
|
||||
|
@ -202,7 +198,6 @@
|
|||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/about_code"
|
||||
style="@style/MyOutlinedButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="3"
|
||||
|
@ -228,7 +223,6 @@
|
|||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/about_thekinrar"
|
||||
style="@style/MyOutlinedButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="3"
|
||||
|
|
|
@ -20,11 +20,11 @@
|
|||
android:paddingVertical="12dp"
|
||||
android:text="@string/muted_menu"
|
||||
android:textAlignment="textStart"
|
||||
android:textColor="@color/cyanea_accent_dark_reference"
|
||||
android:textColor="?attr/colorAccent"
|
||||
app:icon="@drawable/ic_baseline_navigate_next_24"
|
||||
app:iconGravity="end"
|
||||
app:iconTint="@color/cyanea_accent_dark_reference"
|
||||
app:strokeColor="@color/cyanea_accent_dark_reference" />
|
||||
app:iconTint="?attr/colorAccent"
|
||||
app:strokeColor="?attr/colorAccent" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/blocked"
|
||||
|
@ -35,11 +35,11 @@
|
|||
android:paddingVertical="12dp"
|
||||
android:text="@string/blocked_menu"
|
||||
android:textAlignment="textStart"
|
||||
android:textColor="@color/cyanea_accent_dark_reference"
|
||||
android:textColor="?attr/colorAccent"
|
||||
app:icon="@drawable/ic_baseline_navigate_next_24"
|
||||
app:iconGravity="end"
|
||||
app:iconTint="@color/cyanea_accent_dark_reference"
|
||||
app:strokeColor="@color/cyanea_accent_dark_reference" />
|
||||
app:iconTint="?attr/colorAccent"
|
||||
app:strokeColor="?attr/colorAccent" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/bookmarks"
|
||||
|
@ -50,11 +50,11 @@
|
|||
android:paddingVertical="12dp"
|
||||
android:text="@string/bookmarks"
|
||||
android:textAlignment="textStart"
|
||||
android:textColor="@color/cyanea_accent_dark_reference"
|
||||
android:textColor="?attr/colorAccent"
|
||||
app:icon="@drawable/ic_baseline_navigate_next_24"
|
||||
app:iconGravity="end"
|
||||
app:iconTint="@color/cyanea_accent_dark_reference"
|
||||
app:strokeColor="@color/cyanea_accent_dark_reference" />
|
||||
app:iconTint="?attr/colorAccent"
|
||||
app:strokeColor="?attr/colorAccent" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/favourites"
|
||||
|
@ -65,11 +65,11 @@
|
|||
android:paddingVertical="12dp"
|
||||
android:text="@string/favourite"
|
||||
android:textAlignment="textStart"
|
||||
android:textColor="@color/cyanea_accent_dark_reference"
|
||||
android:textColor="?attr/colorAccent"
|
||||
app:icon="@drawable/ic_baseline_navigate_next_24"
|
||||
app:iconGravity="end"
|
||||
app:iconTint="@color/cyanea_accent_dark_reference"
|
||||
app:strokeColor="@color/cyanea_accent_dark_reference" />
|
||||
app:iconTint="?attr/colorAccent"
|
||||
app:strokeColor="?attr/colorAccent" />
|
||||
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
|
@ -81,11 +81,11 @@
|
|||
android:paddingVertical="12dp"
|
||||
android:text="@string/blocked_domains"
|
||||
android:textAlignment="textStart"
|
||||
android:textColor="@color/cyanea_accent_dark_reference"
|
||||
android:textColor="?attr/colorAccent"
|
||||
app:icon="@drawable/ic_baseline_navigate_next_24"
|
||||
app:iconGravity="end"
|
||||
app:iconTint="@color/cyanea_accent_dark_reference"
|
||||
app:strokeColor="@color/cyanea_accent_dark_reference" />
|
||||
app:iconTint="?attr/colorAccent"
|
||||
app:strokeColor="?attr/colorAccent" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
|
|
@ -26,13 +26,11 @@
|
|||
android:id="@+id/appBar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:backgroundTint="?backgroundColorLight"
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<com.google.android.material.appbar.CollapsingToolbarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:backgroundTint="?backgroundColorLight"
|
||||
android:fitsSystemWindows="true"
|
||||
app:contentScrim="?colorPrimaryDark"
|
||||
app:expandedTitleGravity="top"
|
||||
|
@ -394,9 +392,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:text="@string/approve"
|
||||
android:textColor="@color/cyanea_accent_dark_reference"
|
||||
app:strokeColor="@color/cyanea_accent_dark_reference" />
|
||||
android:text="@string/approve" />
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
|
@ -424,9 +420,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:text="@string/disable"
|
||||
android:textColor="@color/cyanea_accent_dark_reference"
|
||||
app:strokeColor="@color/cyanea_accent_dark_reference" />
|
||||
android:text="@string/disable" />
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
|
@ -454,9 +448,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:text="@string/silence"
|
||||
android:textColor="@color/cyanea_accent_dark_reference"
|
||||
app:strokeColor="@color/cyanea_accent_dark_reference" />
|
||||
android:text="@string/silence" />
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
|
@ -484,9 +476,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:text="@string/suspend"
|
||||
android:textColor="@color/cyanea_accent_dark_reference"
|
||||
app:strokeColor="@color/cyanea_accent_dark_reference" />
|
||||
android:text="@string/suspend" />
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
</ScrollView>
|
||||
|
|
|
@ -20,11 +20,8 @@
|
|||
android:paddingVertical="12dp"
|
||||
android:text="@string/reports"
|
||||
android:textAlignment="textStart"
|
||||
android:textColor="@color/cyanea_accent_dark_reference"
|
||||
app:icon="@drawable/ic_baseline_navigate_next_24"
|
||||
app:iconGravity="end"
|
||||
app:iconTint="@color/cyanea_accent_dark_reference"
|
||||
app:strokeColor="@color/cyanea_accent_dark_reference" />
|
||||
app:iconGravity="end" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/accounts"
|
||||
|
@ -35,11 +32,8 @@
|
|||
android:paddingVertical="12dp"
|
||||
android:text="@string/accounts"
|
||||
android:textAlignment="textStart"
|
||||
android:textColor="@color/cyanea_accent_dark_reference"
|
||||
app:icon="@drawable/ic_baseline_navigate_next_24"
|
||||
app:iconGravity="end"
|
||||
app:iconTint="@color/cyanea_accent_dark_reference"
|
||||
app:strokeColor="@color/cyanea_accent_dark_reference" />
|
||||
app:iconGravity="end" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/domains"
|
||||
|
@ -50,11 +44,8 @@
|
|||
android:paddingVertical="12dp"
|
||||
android:text="@string/blocked_domains"
|
||||
android:textAlignment="textStart"
|
||||
android:textColor="@color/cyanea_accent_dark_reference"
|
||||
app:icon="@drawable/ic_baseline_navigate_next_24"
|
||||
app:iconGravity="end"
|
||||
app:iconTint="@color/cyanea_accent_dark_reference"
|
||||
app:strokeColor="@color/cyanea_accent_dark_reference" />
|
||||
app:iconGravity="end" />
|
||||
|
||||
</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