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", "surfing_mode", "false"
buildConfigField "boolean", "sepia_search", "false"
buildConfigField "boolean", "instance_switcher", "true"
}
google_acad {
applicationId "app.fedilab.fedilabtube"
@ -58,6 +59,7 @@ android {
buildConfigField "boolean", "google_restriction", "true"
buildConfigField "boolean", "surfing_mode", "false"
buildConfigField "boolean", "sepia_search", "false"
buildConfigField "boolean", "instance_switcher", "true"
}
fdroid_full {
applicationId "app.fedilab.tubelab"
@ -68,6 +70,7 @@ android {
buildConfigField "boolean", "google_restriction", "false"
buildConfigField "boolean", "surfing_mode", "true"
buildConfigField "boolean", "sepia_search", "true"
buildConfigField "boolean", "instance_switcher", "true"
}
google_full {
applicationId "app.fedilab.tubelab"
@ -78,6 +81,7 @@ android {
buildConfigField "boolean", "google_restriction", "true"
buildConfigField "boolean", "surfing_mode", "true"
buildConfigField "boolean", "sepia_search", "true"
buildConfigField "boolean", "instance_switcher", "true"
}
queermotion {
applicationId "org.queermotion.peertube"
@ -88,6 +92,7 @@ android {
buildConfigField "boolean", "google_restriction", "false"
buildConfigField "boolean", "surfing_mode", "false"
buildConfigField "boolean", "sepia_search", "false"
buildConfigField "boolean", "instance_switcher", "false"
}
bittube {
applicationId "app.fedilab.bittube"
@ -98,6 +103,7 @@ android {
buildConfigField "boolean", "google_restriction", "true"
buildConfigField "boolean", "surfing_mode", "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);
}
//Developer donation
Button donatePaypal = findViewById(R.id.donate_paypal);
donatePaypal.setOnClickListener(v -> {
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.paypal.me/Mastalab"));
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);
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);
});

View File

@ -57,6 +57,7 @@ public class LoginActivity extends AppCompatActivity {
private static String client_secret;
private ActivityLoginBinding binding;
@SuppressLint("SetTextI18n")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@ -68,7 +69,13 @@ public class LoginActivity extends AppCompatActivity {
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 ForegroundColorSpan(ContextCompat.getColor(LoginActivity.this, Helper.getColorAccent())), 0, content_create.length(),
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);
}
if (BuildConfig.FLAVOR.compareTo("queermotion") == 0) {
binding.loginInstance.setText("queermotion.org");
}
if (Helper.isTablet(LoginActivity.this)) {

View File

@ -732,6 +732,9 @@ public class MainActivity extends AppCompatActivity implements ChromeCastsListen
break;
}
if (!BuildConfig.instance_switcher) {
instanceItem.setVisible(false);
}
if (!BuildConfig.sepia_search) {
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.entities.AccountCreation;
import app.fedilab.fedilabtube.databinding.ActivityRegisterPeertubeBinding;
import app.fedilab.fedilabtube.helper.Helper;
import app.fedilab.fedilabtube.helper.HelperAcadInstance;
import app.fedilab.fedilabtube.helper.HelperInstance;
import es.dmoral.toasty.Toasty;
@ -51,6 +50,7 @@ public class PeertubeRegisterActivity extends AppCompatActivity {
private String instance;
private ActivityRegisterPeertubeBinding binding;
@SuppressLint("SetTextI18n")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@ -63,7 +63,7 @@ public class PeertubeRegisterActivity extends AppCompatActivity {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
if (BuildConfig.full_instances) {
if (BuildConfig.full_instances && BuildConfig.instance_switcher) {
binding.loginInstanceContainer.setVisibility(View.VISIBLE);
binding.titleLoginInstance.setVisibility(View.VISIBLE);
} else {
@ -71,6 +71,10 @@ public class PeertubeRegisterActivity extends AppCompatActivity {
binding.titleLoginInstance.setVisibility(View.GONE);
}
if (BuildConfig.FLAVOR.compareTo("queermotion") == 0) {
binding.loginInstance.setText("queermotion.org");
}
binding.username.setOnFocusChangeListener((view, focused) -> {
if (!focused && binding.username.getText() != null) {
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());
} else if (BuildConfig.FLAVOR.compareTo("bittube") == 0) {
return sharedpreferences.getString(Helper.PREF_INSTANCE, "bittube.video");
} else if (BuildConfig.FLAVOR.compareTo("queermotion") == 0) {
return sharedpreferences.getString(Helper.PREF_INSTANCE, "queermotion.org");
} else {
acad = sharedpreferences.getString(Helper.PREF_INSTANCE, "tube.ac-lyon.fr");
if (acad == null) {

View File

@ -50,6 +50,12 @@
android:textSize="16sp" />
<LinearLayout
android:id="@+id/dev_info"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -150,6 +156,8 @@
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
<!-- Idea from info -->
<LinearLayout