1
0
mirror of https://framagit.org/tom79/fedilab-tube synced 2025-02-21 14:30:36 +01: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

@ -36,21 +36,25 @@ android {
applicationId "app.fedilab.fedilabtube"
buildConfigField "String", "version", "\"fdroid_acad\""
buildConfigField "boolean", "full_instances", "false"
buildConfigField "boolean", "google_restriction", "false"
}
google_acad {
applicationId "app.fedilab.fedilabtube"
buildConfigField "String", "version", "\"google_acad\""
buildConfigField "boolean", "full_instances", "false"
buildConfigField "boolean", "google_restriction", "true"
}
fdroid_full {
applicationId "app.fedilab.tubelab"
buildConfigField "String", "version", "\"fdroid_full\""
buildConfigField "boolean", "full_instances", "true"
buildConfigField "boolean", "google_restriction", "false"
}
google_full {
applicationId "app.fedilab.tubelab"
buildConfigField "String", "version", "\"google_full\""
buildConfigField "boolean", "full_instances", "true"
buildConfigField "boolean", "google_restriction", "true"
}
}

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true" android:color="@color/colorAccent" />
<item android:color="@android:color/tab_indicator_text" />
</selector>

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

View File

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -1,5 +1,5 @@
<resources>
<string name="app_name">TubeLab</string>
<string name="app_name" translatable="false">TubeAcad</string>
<string name="title_home">Locale</string>
<string name="title_discover">Découvrir</string>
<string name="title_notifications">Notifications</string>
@ -108,6 +108,7 @@
<string name="no_channels">Aucune chaîne !</string>
<string name="following">Suit</string>
<string name="followers">Abonné·e·s</string>
<string name="title_instance_login">Domaine de l\'instance</string>
<string name="followers_count">%1$s Abonné·e·s</string>
<string name="nothing_to_do">Aucune action ne peut être réalisée</string>
<string name="unfollow_confirm">Voulez-vous vous désabonner de ce compte ?</string>
@ -148,7 +149,6 @@
<string name="logout_account_confirmation">Voulez-vous vraiment déconnecter le compte @%1$s ?</string>
<string name="action_lists_delete">Supprimer la liste de lecture</string>
<string name="action_channel_delete">Supprimer la chaîne</string>
<string name="action_lists_confirm_delete">Êtes-vous sûr de vouloir supprimer définitivement cette liste de lecture ?</string>
<string name="action_channel_confirm_delete">Êtes-vous sûr de vouloir supprimer définitivement cette chaîne ?</string>
<string name="action_playlist_create">Créer une liste de lecture</string>
@ -211,4 +211,6 @@
<string name="display_list">Afficher la liste</string>
<string name="delete_list">Supprimer la liste de lecture</string>
<string name="edit">Modifier</string>
<string name="not_valide_instance">Cette instance ne semble pas être valide !</string>
</resources>

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true" android:color="@color/colorAccent_full" />
<item android:color="@android:color/tab_indicator_text" />
</selector>

View File

@ -0,0 +1,15 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108"
android:tint="#F2690D">
<group android:scaleX="2.61"
android:scaleY="2.61"
android:translateX="22.68"
android:translateY="22.68">
<path
android:fillColor="@android:color/white"
android:pathData="M10,16.5l6,-4.5 -6,-4.5v9zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8z"/>
</group>
</vector>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1014 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#000000</color>
</resources>

View File

@ -7,11 +7,15 @@
<string name="title_trending">Trending</string>
<string name="title_most_liked">Most liked</string>
<string name="toast_error">Oops! An error occurred!</string>
<string name="title_muted">Muted</string>
<string name="title_channel">Channels</string>
<string name="instance_choice">Pickup an instance</string>
<string name="not_valide_instance">This instance does not seem to be valid!</string>
<string name="no_videos">No videos!</string>
<string name="favicon">Favicon</string>
<string name="open_with">Open with</string>
<string name="action_playlist_edit">Edit a playlist</string>
<string name="close">Close</string>
<string name="upload_video">Upload</string>
<string name="image_preview">Image preview</string>
@ -200,5 +204,31 @@
<string name="display_nsfw_videos">Display sensitive videos</string>
<string name="fullscreen">Fullscreen</string>
<string name="bookmark_peertube_empty">There are no videos in your favourites!</string>
<string name="delete_channel">Remove channel</string>
<string name="action_channel_confirm_delete">Are you sure to permanently delete this channel?</string>
<string name="no_muted">No muted accounts!</string>
<string name="error_display_name_channel">You must define a name and a display name for this channel!</string>
<string name="action_channel_create">Create a channel</string>
<string name="action_channel_edit">Edit channel</string>
<string name="email_error_domain">Email addresses in %1$s are not allowed!</string>
<string name="report_comment_size">Please, specify the reasons</string>
<string name="not_logged_in">You must be authenticated to proceed to this action!</string>
<string name="successful_report">The account has been reported!</string>
<string name="successful_video_report">The video has been reported!</string>
<string name="password_length_error">The password must contain at least 6 characters!</string>
<string name="muted_done">The account has been muted!</string>
<string name="edit_video">Edit video</string>
<string name="create_an_account">Create an account</string>
<string name="followers_count">%1$s Subscribers</string>
</resources>

View File

@ -0,0 +1,11 @@
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary_full</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark_full</item>
<item name="colorAccent">@color/colorAccent_full</item>
</style>
</resources>

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;
}
}

View File

@ -29,7 +29,9 @@
android:background="?android:attr/windowBackground"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" />
app:layout_constraintRight_toRightOf="parent"
app:itemTextColor="@color/bottom_nav_color"
app:itemIconTint="@color/bottom_nav_color"/>
<fragment
android:id="@+id/nav_host_fragment"

View File

@ -0,0 +1,125 @@
<?xml version="1.0" encoding="utf-8"?><!-- Copyright (C) 2016 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="#CC000000"
android:layoutDirection="ltr"
android:orientation="vertical"
tools:targetApi="28">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal"
android:paddingTop="4dp">
<ImageButton
android:id="@id/exo_prev"
style="@style/ExoMediaButton.Previous" />
<ImageButton
android:id="@id/exo_rew"
style="@style/ExoMediaButton.Rewind" />
<ImageButton
android:id="@id/exo_shuffle"
style="@style/ExoMediaButton.VR" />
<ImageButton
android:id="@id/exo_repeat_toggle"
style="@style/ExoMediaButton" />
<ImageButton
android:id="@id/exo_play"
style="@style/ExoMediaButton.Play" />
<ImageButton
android:id="@id/exo_pause"
style="@style/ExoMediaButton.Pause" />
<ImageButton
android:id="@id/exo_ffwd"
style="@style/ExoMediaButton.FastForward" />
<ImageButton
android:id="@id/exo_next"
style="@style/ExoMediaButton.Next" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/resolution"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:includeFontPadding="false"
android:paddingLeft="4dp"
android:paddingRight="4dp"
android:textColor="#FFBEBEBE"
android:textSize="14sp"
android:textStyle="bold" />
<TextView
android:id="@id/exo_position"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:includeFontPadding="false"
android:paddingLeft="4dp"
android:paddingRight="4dp"
android:textColor="#FFBEBEBE"
android:textSize="12sp" />
<com.google.android.exoplayer2.ui.DefaultTimeBar
android:id="@id/exo_progress"
android:layout_width="0dp"
android:layout_height="26dp"
android:layout_weight="1" />
<TextView
android:id="@id/exo_duration"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:includeFontPadding="false"
android:paddingLeft="4dp"
android:paddingRight="4dp"
android:textColor="#FFBEBEBE"
android:textSize="12sp" />
<FrameLayout
android:id="@+id/exo_fullscreen_button"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_gravity="end">
<ImageView
android:id="@+id/exo_fullscreen_icon"
android:layout_width="18dp"
android:layout_height="18dp"
android:layout_gravity="center"
android:adjustViewBounds="true"
android:contentDescription="@string/fullscreen"
android:scaleType="fitCenter"
android:src="@drawable/ic_baseline_fullscreen_24" />
</FrameLayout>
</LinearLayout>
</LinearLayout>

View File

@ -4,6 +4,11 @@
<color name="colorPrimaryDark">#4527A0</color>
<color name="colorAccent">#9C27B0</color>
<color name="colorPrimary_full">#212529</color>
<color name="colorPrimaryDark_full">#000000</color>
<color name="colorAccent_full">#F2690D</color>
<color name="positive_thumbs">#2b90d9</color>
<color name="negative_thumbs">#F44336</color>