1
0
mirror of https://framagit.org/tom79/fedilab-tube synced 2025-06-05 21:09:11 +02:00

improve flavor

This commit is contained in:
Thomas
2020-09-14 15:53:31 +02:00
parent f0eaceb8a4
commit 26af939014
48 changed files with 242 additions and 17 deletions

View File

@ -67,7 +67,7 @@ public class AccountActivity extends AppCompatActivity {
SpannableString content_create = new SpannableString(getString(R.string.join_peertube));
content_create.setSpan(new UnderlineSpan(), 0, content_create.length(), 0);
content_create.setSpan(new ForegroundColorSpan(ContextCompat.getColor(AccountActivity.this, R.color.colorAccent)), 0, content_create.length(),
content_create.setSpan(new ForegroundColorSpan(ContextCompat.getColor(AccountActivity.this, Helper.getColorAccent())), 0, content_create.length(),
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);

View File

@ -83,7 +83,7 @@ public class LoginActivity extends AppCompatActivity {
SpannableString content_create = new SpannableString(getString(R.string.join_peertube));
content_create.setSpan(new UnderlineSpan(), 0, content_create.length(), 0);
content_create.setSpan(new ForegroundColorSpan(ContextCompat.getColor(LoginActivity.this, R.color.colorAccent)), 0, content_create.length(),
content_create.setSpan(new ForegroundColorSpan(ContextCompat.getColor(LoginActivity.this, Helper.getColorAccent())), 0, content_create.length(),
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
create_an_account_peertube.setText(content_create);
@ -152,7 +152,7 @@ public class LoginActivity extends AppCompatActivity {
instance = Helper.getPeertubeUrl(host);
} else {
if (login_instance == null || login_instance.getText() == null || login_instance.getText().toString().trim().length() == 0) {
Toasty.error(LoginActivity.this, getString(R.string.instance_fails)).show();
Toasty.error(LoginActivity.this, getString(R.string.not_valide_instance)).show();
return;
}
instance = host = login_instance.getText().toString();

View File

@ -313,10 +313,10 @@ public class ShowAccountActivity extends AppCompatActivity {
};
int[] colors = new int[]{
ContextCompat.getColor(ShowAccountActivity.this, R.color.colorAccent),
ContextCompat.getColor(ShowAccountActivity.this, R.color.colorAccent),
ContextCompat.getColor(ShowAccountActivity.this, R.color.colorAccent),
ContextCompat.getColor(ShowAccountActivity.this, R.color.colorAccent)
ContextCompat.getColor(ShowAccountActivity.this, Helper.getColorAccent()),
ContextCompat.getColor(ShowAccountActivity.this, Helper.getColorAccent()),
ContextCompat.getColor(ShowAccountActivity.this, Helper.getColorAccent()),
ContextCompat.getColor(ShowAccountActivity.this, Helper.getColorAccent())
};
account_follow.setBackgroundTintList(new ColorStateList(states, colors));
}

View File

@ -42,6 +42,7 @@ import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import app.fedilab.fedilabtube.BuildConfig;
import app.fedilab.fedilabtube.R;
import app.fedilab.fedilabtube.client.entities.Account;
import app.fedilab.fedilabtube.client.entities.AccountCreation;
@ -2005,7 +2006,7 @@ public class PeertubeAPI {
JSONObject resobj = jsonArray.getJSONObject(i);
Peertube peertube = parsePeertube(resobj);
i++;
if (peertube != null && (peertube.getName() == null || !peertube.getName().toLowerCase().contains("youtube video downloader"))) {
if (!BuildConfig.google_restriction || (peertube != null && (peertube.getName() == null || !peertube.getName().toLowerCase().contains("youtube video downloader")))) {
peertubes.add(peertube);
}
}

View File

@ -403,7 +403,7 @@ public class Status implements Parcelable {
spannable.removeSpan(quoteSpan);
spannable.setSpan(new CustomQuoteSpan(
ContextCompat.getColor(context, android.R.color.transparent),
R.color.colorAccent,
Helper.getColorAccent(),
10,
20),
start,

View File

@ -68,7 +68,7 @@ public class AccountsHorizontalListAdapter extends RecyclerView.Adapter<Recycler
Helper.loadGiF(context, account, holder.account_pp, 270);
if (account.isSelected()) {
holder.main_container.setBackgroundColor(ColorUtils.setAlphaComponent(ContextCompat.getColor(context, R.color.colorAccent), 50));
holder.main_container.setBackgroundColor(ColorUtils.setAlphaComponent(ContextCompat.getColor(context, Helper.getColorAccent()), 50));
} else {
holder.main_container.setBackgroundColor(Color.TRANSPARENT);
}

View File

@ -93,7 +93,7 @@ public class AccountsListAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
holder.account_action.setContentDescription(context.getString(R.string.delete_channel));
holder.account_action.setOnClickListener(view -> {
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setTitle(context.getString(R.string.action_channel_delete) + ": " + account.getAcct());
builder.setTitle(context.getString(R.string.delete_channel) + ": " + account.getAcct());
builder.setMessage(context.getString(R.string.action_channel_confirm_delete));
builder.setIcon(android.R.drawable.ic_dialog_alert)
.setPositiveButton(R.string.yes, (dialog, which) -> {
@ -179,7 +179,7 @@ public class AccountsListAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
switch (item.getItemId()) {
case R.id.action_delete:
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setTitle(context.getString(R.string.action_channel_delete) + ": " + account.getAcct());
builder.setTitle(context.getString(R.string.delete_channel) + ": " + account.getAcct());
builder.setMessage(context.getString(R.string.action_channel_confirm_delete));
builder.setIcon(android.R.drawable.ic_dialog_alert)
.setPositiveButton(R.string.yes, (dialog, which) -> {

View File

@ -521,7 +521,7 @@ public class Helper {
if (custom_tabs) {
CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
CustomTabsIntent customTabsIntent = builder.build();
builder.setToolbarColor(ContextCompat.getColor(context, R.color.colorPrimary));
builder.setToolbarColor(ContextCompat.getColor(context, getColorPrimary()));
try {
customTabsIntent.launchUrl(context, Uri.parse(url));
} catch (Exception ignored) {
@ -691,5 +691,11 @@ public class Helper {
return context.getResources().getBoolean(R.bool.is_tablet);
}
public static int getColorAccent() {
return BuildConfig.full_instances?R.color.colorAccent_full:R.color.colorAccent;
}
public static int getColorPrimary() {
return BuildConfig.full_instances?R.color.colorPrimary_full:R.color.colorPrimary;
}
}