update details

This commit is contained in:
Thomas 2020-12-12 09:32:55 +01:00
parent f1420fe29e
commit fcb93b7dc6
7 changed files with 126 additions and 82 deletions

View File

@ -48,6 +48,7 @@ android {
buildConfigField "boolean", "google_restriction", "false" buildConfigField "boolean", "google_restriction", "false"
buildConfigField "boolean", "surfing_mode", "false" buildConfigField "boolean", "surfing_mode", "false"
buildConfigField "boolean", "sepia_search", "false" buildConfigField "boolean", "sepia_search", "false"
buildConfigField "boolean", "instance_switcher", "true"
} }
google_acad { google_acad {
applicationId "app.fedilab.fedilabtube" applicationId "app.fedilab.fedilabtube"
@ -58,6 +59,7 @@ android {
buildConfigField "boolean", "google_restriction", "true" buildConfigField "boolean", "google_restriction", "true"
buildConfigField "boolean", "surfing_mode", "false" buildConfigField "boolean", "surfing_mode", "false"
buildConfigField "boolean", "sepia_search", "false" buildConfigField "boolean", "sepia_search", "false"
buildConfigField "boolean", "instance_switcher", "true"
} }
fdroid_full { fdroid_full {
applicationId "app.fedilab.tubelab" applicationId "app.fedilab.tubelab"
@ -68,6 +70,7 @@ android {
buildConfigField "boolean", "google_restriction", "false" buildConfigField "boolean", "google_restriction", "false"
buildConfigField "boolean", "surfing_mode", "true" buildConfigField "boolean", "surfing_mode", "true"
buildConfigField "boolean", "sepia_search", "true" buildConfigField "boolean", "sepia_search", "true"
buildConfigField "boolean", "instance_switcher", "true"
} }
google_full { google_full {
applicationId "app.fedilab.tubelab" applicationId "app.fedilab.tubelab"
@ -78,6 +81,7 @@ android {
buildConfigField "boolean", "google_restriction", "true" buildConfigField "boolean", "google_restriction", "true"
buildConfigField "boolean", "surfing_mode", "true" buildConfigField "boolean", "surfing_mode", "true"
buildConfigField "boolean", "sepia_search", "true" buildConfigField "boolean", "sepia_search", "true"
buildConfigField "boolean", "instance_switcher", "true"
} }
queermotion { queermotion {
applicationId "org.queermotion.peertube" applicationId "org.queermotion.peertube"
@ -88,6 +92,7 @@ android {
buildConfigField "boolean", "google_restriction", "false" buildConfigField "boolean", "google_restriction", "false"
buildConfigField "boolean", "surfing_mode", "false" buildConfigField "boolean", "surfing_mode", "false"
buildConfigField "boolean", "sepia_search", "false" buildConfigField "boolean", "sepia_search", "false"
buildConfigField "boolean", "instance_switcher", "false"
} }
bittube { bittube {
applicationId "app.fedilab.bittube" applicationId "app.fedilab.bittube"
@ -98,6 +103,7 @@ android {
buildConfigField "boolean", "google_restriction", "true" buildConfigField "boolean", "google_restriction", "true"
buildConfigField "boolean", "surfing_mode", "false" buildConfigField "boolean", "surfing_mode", "false"
buildConfigField "boolean", "sepia_search", "false" buildConfigField "boolean", "sepia_search", "false"
buildConfigField "boolean", "instance_switcher", "true"
} }
} }

View File

@ -115,15 +115,27 @@ public class AboutActivity extends AppCompatActivity {
donation_container.setVisibility(View.GONE); donation_container.setVisibility(View.GONE);
} }
//Developer donation //Developer donation
Button donatePaypal = findViewById(R.id.donate_paypal); Button donatePaypal = findViewById(R.id.donate_paypal);
donatePaypal.setOnClickListener(v -> { donatePaypal.setOnClickListener(v -> {
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.paypal.me/Mastalab")); Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.paypal.me/Mastalab"));
startActivity(browserIntent); startActivity(browserIntent);
}); });
if (BuildConfig.FLAVOR.equals("queermotion")) {
donatePaypal.setVisibility(View.GONE);
LinearLayout dev_info = findViewById(R.id.dev_info);
dev_info.setVisibility(View.GONE);
}
Button donateLiberapay = findViewById(R.id.donate_liberapay); Button donateLiberapay = findViewById(R.id.donate_liberapay);
donateLiberapay.setOnClickListener(v -> { donateLiberapay.setOnClickListener(v -> {
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://liberapay.com/tom79")); Intent browserIntent;
if (BuildConfig.FLAVOR.equals("queermotion")) {
browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://soutenir.queermotion.org"));
} else {
browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://liberapay.com/tom79"));
}
startActivity(browserIntent); startActivity(browserIntent);
}); });

View File

@ -57,6 +57,7 @@ public class LoginActivity extends AppCompatActivity {
private static String client_secret; private static String client_secret;
private ActivityLoginBinding binding; private ActivityLoginBinding binding;
@SuppressLint("SetTextI18n")
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
@ -68,7 +69,13 @@ public class LoginActivity extends AppCompatActivity {
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true);
SpannableString content_create = new SpannableString(getString(R.string.join_peertube)); SpannableString content_create;
if (BuildConfig.FLAVOR.compareTo("queermotion") == 0) {
content_create = new SpannableString(getString(R.string.register_account));
} else {
content_create = new SpannableString(getString(R.string.join_peertube));
}
content_create.setSpan(new UnderlineSpan(), 0, content_create.length(), 0); content_create.setSpan(new UnderlineSpan(), 0, content_create.length(), 0);
content_create.setSpan(new ForegroundColorSpan(ContextCompat.getColor(LoginActivity.this, Helper.getColorAccent())), 0, content_create.length(), content_create.setSpan(new ForegroundColorSpan(ContextCompat.getColor(LoginActivity.this, Helper.getColorAccent())), 0, content_create.length(),
Spanned.SPAN_INCLUSIVE_EXCLUSIVE); Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
@ -82,10 +89,12 @@ public class LoginActivity extends AppCompatActivity {
}); });
if (BuildConfig.full_instances) { if (BuildConfig.full_instances && BuildConfig.instance_switcher) {
binding.loginInstanceContainer.setVisibility(View.VISIBLE); binding.loginInstanceContainer.setVisibility(View.VISIBLE);
} }
if (BuildConfig.FLAVOR.compareTo("queermotion") == 0) {
binding.loginInstance.setText("queermotion.org");
}
if (Helper.isTablet(LoginActivity.this)) { if (Helper.isTablet(LoginActivity.this)) {

View File

@ -732,6 +732,9 @@ public class MainActivity extends AppCompatActivity implements ChromeCastsListen
break; break;
} }
if (!BuildConfig.instance_switcher) {
instanceItem.setVisible(false);
}
if (!BuildConfig.sepia_search) { if (!BuildConfig.sepia_search) {
sepiaSearchItem.setVisible(false); sepiaSearchItem.setVisible(false);

View File

@ -38,7 +38,6 @@ import app.fedilab.fedilabtube.client.APIResponse;
import app.fedilab.fedilabtube.client.RetrofitPeertubeAPI; import app.fedilab.fedilabtube.client.RetrofitPeertubeAPI;
import app.fedilab.fedilabtube.client.entities.AccountCreation; import app.fedilab.fedilabtube.client.entities.AccountCreation;
import app.fedilab.fedilabtube.databinding.ActivityRegisterPeertubeBinding; import app.fedilab.fedilabtube.databinding.ActivityRegisterPeertubeBinding;
import app.fedilab.fedilabtube.helper.Helper;
import app.fedilab.fedilabtube.helper.HelperAcadInstance; import app.fedilab.fedilabtube.helper.HelperAcadInstance;
import app.fedilab.fedilabtube.helper.HelperInstance; import app.fedilab.fedilabtube.helper.HelperInstance;
import es.dmoral.toasty.Toasty; import es.dmoral.toasty.Toasty;
@ -51,6 +50,7 @@ public class PeertubeRegisterActivity extends AppCompatActivity {
private String instance; private String instance;
private ActivityRegisterPeertubeBinding binding; private ActivityRegisterPeertubeBinding binding;
@SuppressLint("SetTextI18n")
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
@ -63,7 +63,7 @@ public class PeertubeRegisterActivity extends AppCompatActivity {
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true);
if (BuildConfig.full_instances) { if (BuildConfig.full_instances && BuildConfig.instance_switcher) {
binding.loginInstanceContainer.setVisibility(View.VISIBLE); binding.loginInstanceContainer.setVisibility(View.VISIBLE);
binding.titleLoginInstance.setVisibility(View.VISIBLE); binding.titleLoginInstance.setVisibility(View.VISIBLE);
} else { } else {
@ -71,6 +71,10 @@ public class PeertubeRegisterActivity extends AppCompatActivity {
binding.titleLoginInstance.setVisibility(View.GONE); binding.titleLoginInstance.setVisibility(View.GONE);
} }
if (BuildConfig.FLAVOR.compareTo("queermotion") == 0) {
binding.loginInstance.setText("queermotion.org");
}
binding.username.setOnFocusChangeListener((view, focused) -> { binding.username.setOnFocusChangeListener((view, focused) -> {
if (!focused && binding.username.getText() != null) { if (!focused && binding.username.getText() != null) {
Pattern patternUsername = Pattern.compile("^[a-z0-9._]{1,50}$"); Pattern patternUsername = Pattern.compile("^[a-z0-9._]{1,50}$");

View File

@ -72,6 +72,8 @@ public class HelperInstance {
return sharedpreferences.getString(Helper.PREF_INSTANCE, getDefaultInstance()); return sharedpreferences.getString(Helper.PREF_INSTANCE, getDefaultInstance());
} else if (BuildConfig.FLAVOR.compareTo("bittube") == 0) { } else if (BuildConfig.FLAVOR.compareTo("bittube") == 0) {
return sharedpreferences.getString(Helper.PREF_INSTANCE, "bittube.video"); return sharedpreferences.getString(Helper.PREF_INSTANCE, "bittube.video");
} else if (BuildConfig.FLAVOR.compareTo("queermotion") == 0) {
return sharedpreferences.getString(Helper.PREF_INSTANCE, "queermotion.org");
} else { } else {
acad = sharedpreferences.getString(Helper.PREF_INSTANCE, "tube.ac-lyon.fr"); acad = sharedpreferences.getString(Helper.PREF_INSTANCE, "tube.ac-lyon.fr");
if (acad == null) { if (acad == null) {

View File

@ -50,106 +50,114 @@
android:textSize="16sp" /> android:textSize="16sp" />
<TextView <LinearLayout
android:id="@+id/dev_info"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="5dp" android:orientation="vertical">
android:layout_marginTop="15dp"
android:gravity="center"
android:text="@string/developer"
android:textStyle="bold" />
<!-- Developer info --> <TextView
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp">
<LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:baselineAligned="false" android:layout_margin="5dp"
android:orientation="horizontal" android:layout_marginTop="15dp"
android:padding="5dp"> android:gravity="center"
android:text="@string/developer"
android:textStyle="bold" />
<!-- Developer info -->
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp">
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:baselineAligned="false"
android:layout_weight="1" android:orientation="horizontal"
android:orientation="vertical" android:padding="5dp">
tools:ignore="UseCompoundDrawables">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="tom79"
android:textSize="16sp"
android:textStyle="bold"
tools:ignore="HardcodedText" />
<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_gravity="center"
android:layout_marginTop="5dp"
android:src="@drawable/tom79_avatar"
tools:ignore="ContentDescription" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="3"
android:orientation="vertical">
<TextView
android:id="@+id/developer_mastodon"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="\@TubeLab@toot.fedilab.org"
android:textSize="16sp"
android:textStyle="bold"
tools:ignore="HardcodedText" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="10dp" android:layout_gravity="center"
android:orientation="horizontal"> android:layout_weight="1"
android:orientation="vertical"
tools:ignore="UseCompoundDrawables">
<TextView <TextView
android:id="@+id/framagit" android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_gravity="center"
android:text="Framagit" android:text="tom79"
android:textSize="16sp" android:textSize="16sp"
android:textStyle="bold"
tools:ignore="HardcodedText" /> tools:ignore="HardcodedText" />
<TextView <ImageView
android:id="@+id/github" android:layout_width="50dp"
android:layout_width="0dp" android:layout_height="50dp"
android:layout_height="wrap_content" android:layout_gravity="center"
android:layout_weight="1" android:layout_marginTop="5dp"
android:text="Github" android:src="@drawable/tom79_avatar"
android:textSize="16sp" tools:ignore="ContentDescription" />
tools:ignore="HardcodedText" /> </LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="3"
android:orientation="vertical">
<TextView <TextView
android:id="@+id/codeberg" android:id="@+id/developer_mastodon"
android:layout_width="0dp" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:text="\@TubeLab@toot.fedilab.org"
android:text="Codeberg"
android:textSize="16sp" android:textSize="16sp"
android:textStyle="bold"
tools:ignore="HardcodedText" /> tools:ignore="HardcodedText" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal">
<TextView
android:id="@+id/framagit"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Framagit"
android:textSize="16sp"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/github"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Github"
android:textSize="16sp"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/codeberg"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Codeberg"
android:textSize="16sp"
tools:ignore="HardcodedText" />
</LinearLayout>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</LinearLayout> </androidx.cardview.widget.CardView>
</androidx.cardview.widget.CardView> </LinearLayout>
<!-- Idea from info --> <!-- Idea from info -->
<LinearLayout <LinearLayout