mirror of
https://framagit.org/tom79/fedilab-tube
synced 2025-04-19 04:47:19 +02:00
apply flavors
This commit is contained in:
parent
7827c97bf9
commit
f0eaceb8a4
@ -34,19 +34,38 @@ android {
|
|||||||
productFlavors {
|
productFlavors {
|
||||||
fdroid_acad {
|
fdroid_acad {
|
||||||
applicationId "app.fedilab.fedilabtube"
|
applicationId "app.fedilab.fedilabtube"
|
||||||
buildConfigField "string", "version", "fdroid_acad"
|
buildConfigField "String", "version", "\"fdroid_acad\""
|
||||||
}
|
buildConfigField "boolean", "full_instances", "false"
|
||||||
fdroid_full {
|
|
||||||
applicationId "app.fedilab.tubelab"
|
|
||||||
buildConfigField "string", "version", "fdroid_full"
|
|
||||||
}
|
}
|
||||||
google_acad {
|
google_acad {
|
||||||
applicationId "app.fedilab.fedilabtube"
|
applicationId "app.fedilab.fedilabtube"
|
||||||
buildConfigField "string", "version", "google_acad"
|
buildConfigField "String", "version", "\"google_acad\""
|
||||||
|
buildConfigField "boolean", "full_instances", "false"
|
||||||
|
}
|
||||||
|
fdroid_full {
|
||||||
|
applicationId "app.fedilab.tubelab"
|
||||||
|
buildConfigField "String", "version", "\"fdroid_full\""
|
||||||
|
buildConfigField "boolean", "full_instances", "true"
|
||||||
}
|
}
|
||||||
google_full {
|
google_full {
|
||||||
applicationId "app.fedilab.tubelab"
|
applicationId "app.fedilab.tubelab"
|
||||||
buildConfigField "string", "version", "google_full"
|
buildConfigField "String", "version", "\"google_full\""
|
||||||
|
buildConfigField "boolean", "full_instances", "true"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
|
fdroid_acad {
|
||||||
|
res.srcDirs = ['src/main/res', 'src/acad/res']
|
||||||
|
}
|
||||||
|
google_acad {
|
||||||
|
res.srcDirs = ['src/main/res', 'src/acad/res']
|
||||||
|
}
|
||||||
|
fdroid_full {
|
||||||
|
res.srcDirs = ['src/main/res', 'src/full/res']
|
||||||
|
}
|
||||||
|
google_full {
|
||||||
|
res.srcDirs = ['src/main/res', 'src/full/res']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -211,4 +211,4 @@
|
|||||||
<string name="display_list">Afficher la liste</string>
|
<string name="display_list">Afficher la liste</string>
|
||||||
<string name="delete_list">Supprimer la liste de lecture</string>
|
<string name="delete_list">Supprimer la liste de lecture</string>
|
||||||
<string name="edit">Modifier</string>
|
<string name="edit">Modifier</string>
|
||||||
</resources>
|
</resources>
|
204
app/src/full/res/values/strings.xml
Normal file
204
app/src/full/res/values/strings.xml
Normal file
@ -0,0 +1,204 @@
|
|||||||
|
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
<string name="app_name" translatable="false">Tubelab</string>
|
||||||
|
<string name="title_home">Home</string>
|
||||||
|
<string name="title_discover">Discover</string>
|
||||||
|
<string name="title_notifications">Notifications</string>
|
||||||
|
<string name="title_recently_added">Recently added</string>
|
||||||
|
<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="no_videos">No videos!</string>
|
||||||
|
<string name="favicon">Favicon</string>
|
||||||
|
<string name="open_with">Open with</string>
|
||||||
|
|
||||||
|
<string name="close">Close</string>
|
||||||
|
<string name="upload_video">Upload</string>
|
||||||
|
<string name="image_preview">Image preview</string>
|
||||||
|
<string name="file_to_upload">Select the file to upload</string>
|
||||||
|
|
||||||
|
<string name="channel">Channel</string>
|
||||||
|
<string name="videos">Videos</string>
|
||||||
|
<string name="channels">Channels</string>
|
||||||
|
|
||||||
|
<string name="yes">Yes</string>
|
||||||
|
<string name="no">No</string>
|
||||||
|
<string name="cancel">Cancel</string>
|
||||||
|
<string name="download">Download</string>
|
||||||
|
<string name="profile_picture">Profile picture</string>
|
||||||
|
<string name="update_video">Update video</string>
|
||||||
|
|
||||||
|
|
||||||
|
<string name="date_seconds">%d s</string>
|
||||||
|
<string name="date_minutes">%d m</string>
|
||||||
|
<string name="date_hours">%d h</string>
|
||||||
|
<string name="date_day">%d d</string>
|
||||||
|
<string name="number_view_video">%s views</string>
|
||||||
|
|
||||||
|
<string name="title_instance_login">Instance host</string>
|
||||||
|
<string name="uploading">Uploading, please wait…</string>
|
||||||
|
<string name="upload_video_success">The video has been uploaded!</string>
|
||||||
|
<string name="toast_cancelled">Upload cancelled!</string>
|
||||||
|
<string name="video_uploaded_action">Tap here to edit the video data.</string>
|
||||||
|
|
||||||
|
<string name="toot_select_image_error">An error occurred while selecting the media!</string>
|
||||||
|
|
||||||
|
<string name="download_file">Download %1$s</string>
|
||||||
|
|
||||||
|
|
||||||
|
<string name="action_privacy">Privacy</string>
|
||||||
|
<string name="action_logout">Logout</string>
|
||||||
|
<string name="login">Login</string>
|
||||||
|
|
||||||
|
|
||||||
|
<string name="password">Password</string>
|
||||||
|
<string name="email">Email</string>
|
||||||
|
<string name="tags">Tags</string>
|
||||||
|
|
||||||
|
<string name="validate">Validate</string>
|
||||||
|
<string name="share_with">Share with</string>
|
||||||
|
<string name="shared_via">Shared via Fedilab</string>
|
||||||
|
<string name="username">User name</string>
|
||||||
|
|
||||||
|
<string name="settings">Settings</string>
|
||||||
|
<string name="logout_account_confirmation">Are you sure you want to logout @%1$s@%2$s?</string>
|
||||||
|
|
||||||
|
<string name="following">Following</string>
|
||||||
|
<string name="followers">Followers</string>
|
||||||
|
<string name="client_error">Unable to get client id!</string>
|
||||||
|
<string name="toast_error_loading_account">An error occurred while switching between accounts!</string>
|
||||||
|
<string name="toast_error_search">An error occurred while searching!</string>
|
||||||
|
<string name="nothing_to_do">No action can be taken</string>
|
||||||
|
|
||||||
|
|
||||||
|
<string name="action_follow">Follow</string>
|
||||||
|
|
||||||
|
<string name="action_mute">Mute</string>
|
||||||
|
|
||||||
|
<string name="search">Search</string>
|
||||||
|
<string name="delete">Delete</string>
|
||||||
|
|
||||||
|
|
||||||
|
<string name="action_lists_confirm_delete">Are you sure you want to permanently delete this list?</string>
|
||||||
|
<string name="action_lists_delete">Delete list</string>
|
||||||
|
|
||||||
|
|
||||||
|
<string name="no_comments">Be the first to leave a comment on this video with the top right button!</string>
|
||||||
|
|
||||||
|
<string name="comment_no_allowed_peertube">Comments are not enabled on this video!</string>
|
||||||
|
<string name="pickup_resolution">Pick up a resolution</string>
|
||||||
|
<string name="bookmark_add_peertube">The video has been added to bookmarks!</string>
|
||||||
|
<string name="bookmark_remove_peertube">The video has been removed from bookmarks!</string>
|
||||||
|
|
||||||
|
<string name="information" tools:ignore="UnusedResources">Information</string>
|
||||||
|
<string name="app_logo">Logo of the application</string>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- languages not translated -->
|
||||||
|
<string name="subscriptions">Subscriptions</string>
|
||||||
|
|
||||||
|
<string name="delete_comment">Delete a comment</string>
|
||||||
|
<string name="delete_comment_confirm">Are you sure to delete this comment?</string>
|
||||||
|
<string name="set_video_mode">Mode for videos</string>
|
||||||
|
|
||||||
|
<string name="my_videos">My videos</string>
|
||||||
|
<string name="title">Title</string>
|
||||||
|
<string name="license">License</string>
|
||||||
|
<string name="category">Category</string>
|
||||||
|
<string name="language">Language</string>
|
||||||
|
<string name="peertube_nsfw">This video contains mature or explicit content</string>
|
||||||
|
<string name="peertube_enable_comments">Enable video comments</string>
|
||||||
|
|
||||||
|
<string name="description">Description</string>
|
||||||
|
<string name="toast_peertube_video_updated">The video has been updated!</string>
|
||||||
|
|
||||||
|
|
||||||
|
<string name="register_account">Register an account</string>
|
||||||
|
<string name="email_address">Email address</string>
|
||||||
|
<string name="preview">Preview</string>
|
||||||
|
<string name="change_preview">Change preview</string>
|
||||||
|
<string name="name">Name</string>
|
||||||
|
<string name="display_more">Display more</string>
|
||||||
|
<string name="no_channels">No channels!</string>
|
||||||
|
<string name="report_helper">Some explanations about your report…</string>
|
||||||
|
<string name="report_video">Report video</string>
|
||||||
|
<string name="report">Report</string>
|
||||||
|
<string name="change_instance">Pickup another instance</string>
|
||||||
|
<string name="my_history">History</string>
|
||||||
|
<string name="edit">Edit</string>
|
||||||
|
|
||||||
|
<string name="set_video_mode_choice" translatable="false">set_video_mode_choice</string>
|
||||||
|
<string name="set_video_mode_description">Allows to change mode for playing videos (default, streaming or via a browser).</string>
|
||||||
|
|
||||||
|
|
||||||
|
<string name="delete_video">Delete video</string>
|
||||||
|
<string name="delete_video_confirmation">Are you sure to delete this video?</string>
|
||||||
|
<string name="no_video_to_display">No videos to display!</string>
|
||||||
|
<string name="share">Share</string>
|
||||||
|
<string name="peertube_comment_on_video"><![CDATA[<b>%1$s</b> commented your video <b>%2$s</b>]]></string>
|
||||||
|
<string name="peertube_follow_channel"><![CDATA[<b>%1$s</b> is following your channel <b>%2$s</b>]]></string>
|
||||||
|
<string name="peertube_follow_account"><![CDATA[<b>%1$s</b> is following your account]]></string>
|
||||||
|
|
||||||
|
<string name="peertube_video_published"><![CDATA[Your video <b>%1$s</b> has been published]]></string>
|
||||||
|
<string name="peertube_video_import_success"><![CDATA[Your video import <b>%1$s</b> succeeded]]></string>
|
||||||
|
<string name="peertube_video_import_error"><![CDATA[Your video import <b>%1$s</b> failed]]></string>
|
||||||
|
<string name="peertube_video_from_subscription"><![CDATA[<b>%1$s</b> published a new video: <b>%2$s</b>]]></string>
|
||||||
|
<string name="peertube_video_blacklist"><![CDATA[Your video <b>%1$s</b> has been blacklisted]]></string>
|
||||||
|
<string name="peertube_video_unblacklist"><![CDATA[Your video <b>%1$s</b> has been unblacklisted]]></string>
|
||||||
|
<string name="add_public_comment">Add a public comment</string>
|
||||||
|
<string name="send_comment">Send comment</string>
|
||||||
|
<string name="all">All</string>
|
||||||
|
<!-- end languages -->
|
||||||
|
|
||||||
|
<string name="playlists">Playlists</string>
|
||||||
|
<string name="display_name">Display name</string>
|
||||||
|
<string name="action_playlist_add">You don\'t have any playlists. Tap on the \"+\" icon to add a new playlist</string>
|
||||||
|
<string name="error_display_name">You must provide a display name!</string>
|
||||||
|
<string name="error_channel_mandatory">The channel is required when the playlist is public.</string>
|
||||||
|
<string name="action_playlist_create">Create a playlist</string>
|
||||||
|
<string name="action_playlist_empty_content">There is nothing in this playlist yet.</string>
|
||||||
|
<string name="password_confirm">Confirm password</string>
|
||||||
|
<string name="agreement_check">I agree to %1$s and %2$s</string>
|
||||||
|
<string name="server_rules">server rules</string>
|
||||||
|
<string name="tos">terms of service</string>
|
||||||
|
<string name="sign_up">Sign up</string>
|
||||||
|
<string name="all_field_filled">Please, fill all the fields!</string>
|
||||||
|
<string name="password_error">Passwords don\'t match!</string>
|
||||||
|
<string name="email_error">The email doesn\'t seem to be valid!</string>
|
||||||
|
<string name="email_indicator">You will be sent a confirmation e-mail</string>
|
||||||
|
<string name="password_indicator">Use at least 8 characters</string>
|
||||||
|
<string name="password_too_short">Password should contain at least 8 characters</string>
|
||||||
|
<string name="username_error">Username should only contain letters, numbers and underscores</string>
|
||||||
|
<string name="account_created">Account created!</string>
|
||||||
|
<string name="account_created_message">
|
||||||
|
Your account has been created!\n\n
|
||||||
|
Think to validate your email within the 48 next hours.\n\n
|
||||||
|
You can now connect your account by writing <b>%1$s</b> in the first field and tap on <b>Connect</b>.\n\n
|
||||||
|
<b>Important</b>: If your instance required validation, you will receive an email once it is validated!
|
||||||
|
</string>
|
||||||
|
<string name="account">Account</string>
|
||||||
|
<string name="report_account">Report account</string>
|
||||||
|
|
||||||
|
<string-array name="settings_video_mode">
|
||||||
|
<item>Webview</item>
|
||||||
|
<item>Direct stream</item>
|
||||||
|
</string-array>
|
||||||
|
|
||||||
|
|
||||||
|
<string name="unfollow_confirm">Do you want to unfollow this account?</string>
|
||||||
|
|
||||||
|
|
||||||
|
<string name="title_video_peertube">Title for the video</string>
|
||||||
|
<string name="join_peertube">Join Peertube</string>
|
||||||
|
<string name="agreement_check_peertube">I am at least 16 years old and agree to the %1$s of this instance</string>
|
||||||
|
<string name="edit_profile">Edit profile</string>
|
||||||
|
<string name="make_an_action">Make an action</string>
|
||||||
|
|
||||||
|
|
||||||
|
<string name="action_unfollow">Unfollow</string>
|
||||||
|
|
||||||
|
<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>
|
||||||
|
|
||||||
|
</resources>
|
@ -54,7 +54,7 @@
|
|||||||
android:name=".AccountActivity"
|
android:name=".AccountActivity"
|
||||||
android:configChanges="orientation|screenSize"
|
android:configChanges="orientation|screenSize"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:windowSoftInputMode="stateAlwaysHidden"/>
|
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".SearchActivity"
|
android:name=".SearchActivity"
|
||||||
android:configChanges="orientation|screenSize"
|
android:configChanges="orientation|screenSize"
|
||||||
@ -87,15 +87,13 @@
|
|||||||
android:name=".LoginActivity"
|
android:name=".LoginActivity"
|
||||||
android:configChanges="orientation|screenSize"
|
android:configChanges="orientation|screenSize"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:windowSoftInputMode="stateAlwaysHidden">
|
android:windowSoftInputMode="stateAlwaysHidden"></activity>
|
||||||
</activity>
|
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".SettingsActivity"
|
android:name=".SettingsActivity"
|
||||||
android:configChanges="orientation|screenSize"
|
android:configChanges="orientation|screenSize"
|
||||||
android:label="@string/settings"
|
android:label="@string/settings"
|
||||||
android:windowSoftInputMode="stateAlwaysHidden">
|
android:windowSoftInputMode="stateAlwaysHidden"></activity>
|
||||||
</activity>
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".PeertubeRegisterActivity"
|
android:name=".PeertubeRegisterActivity"
|
||||||
android:configChanges="orientation|screenSize"
|
android:configChanges="orientation|screenSize"
|
||||||
|
@ -22,6 +22,7 @@ import android.text.Spanned;
|
|||||||
import android.text.style.ForegroundColorSpan;
|
import android.text.style.ForegroundColorSpan;
|
||||||
import android.text.style.UnderlineSpan;
|
import android.text.style.UnderlineSpan;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
@ -31,6 +32,7 @@ import android.widget.Toast;
|
|||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.core.content.ContextCompat;
|
import androidx.core.content.ContextCompat;
|
||||||
|
|
||||||
|
import com.google.android.material.textfield.TextInputEditText;
|
||||||
import com.google.android.material.textfield.TextInputLayout;
|
import com.google.android.material.textfield.TextInputLayout;
|
||||||
|
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
@ -66,7 +68,7 @@ public class LoginActivity extends AppCompatActivity {
|
|||||||
private EditText login_passwd;
|
private EditText login_passwd;
|
||||||
private Button connectionButton;
|
private Button connectionButton;
|
||||||
private String actionToken;
|
private String actionToken;
|
||||||
|
private TextInputEditText login_instance;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
@ -93,6 +95,12 @@ public class LoginActivity extends AppCompatActivity {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
TextInputLayout login_instance_container = findViewById(R.id.login_instance_container);
|
||||||
|
login_instance = findViewById(R.id.login_instance);
|
||||||
|
if (BuildConfig.full_instances) {
|
||||||
|
login_instance_container.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
|
||||||
login_uid = findViewById(R.id.login_uid);
|
login_uid = findViewById(R.id.login_uid);
|
||||||
login_passwd = findViewById(R.id.login_passwd);
|
login_passwd = findViewById(R.id.login_passwd);
|
||||||
|
|
||||||
@ -129,29 +137,33 @@ public class LoginActivity extends AppCompatActivity {
|
|||||||
Toasty.error(LoginActivity.this, getString(R.string.email_error)).show();
|
Toasty.error(LoginActivity.this, getString(R.string.email_error)).show();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String[] emailArray = login_uid.getText().toString().split("@");
|
|
||||||
if (emailArray.length > 1 && !Arrays.asList(Helper.valideEmails).contains(emailArray[1])) {
|
|
||||||
Toasty.error(LoginActivity.this, getString(R.string.email_error_domain, emailArray[1])).show();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
String host = emailArray[1];
|
|
||||||
String instance = Helper.getPeertubeUrl(host);
|
|
||||||
final HashMap<String, String> parameters = new HashMap<>();
|
|
||||||
connectionButton.setEnabled(false);
|
connectionButton.setEnabled(false);
|
||||||
|
final HashMap<String, String> parameters = new HashMap<>();
|
||||||
try {
|
String instance, host;
|
||||||
instance = URLEncoder.encode(instance, "utf-8");
|
if (!BuildConfig.full_instances) {
|
||||||
} catch (UnsupportedEncodingException e) {
|
String[] emailArray = login_uid.getText().toString().split("@");
|
||||||
Toasty.error(LoginActivity.this, getString(R.string.client_error), Toast.LENGTH_LONG).show();
|
if (emailArray.length > 1 && !Arrays.asList(Helper.valideEmails).contains(emailArray[1])) {
|
||||||
|
Toasty.error(LoginActivity.this, getString(R.string.email_error_domain, emailArray[1])).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
host = emailArray[1];
|
||||||
|
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();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
instance = host = login_instance.getText().toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (Arrays.asList(Helper.openid).contains(host)) {
|
if (Arrays.asList(Helper.openid).contains(host) || !BuildConfig.full_instances) {
|
||||||
String finalInstance = instance;
|
|
||||||
new Thread(() -> {
|
new Thread(() -> {
|
||||||
try {
|
try {
|
||||||
actionToken = "/api/v1/oauth-clients/local";
|
actionToken = "/api/v1/oauth-clients/local";
|
||||||
String response = new HttpsConnection(LoginActivity.this).get("https://" + finalInstance + actionToken, 30, null, null);
|
String response = new HttpsConnection(LoginActivity.this).get("https://" + instance + actionToken, 30, null, null);
|
||||||
if (response == null) {
|
if (response == null) {
|
||||||
runOnUiThread(() -> {
|
runOnUiThread(() -> {
|
||||||
connectionButton.setEnabled(true);
|
connectionButton.setEnabled(true);
|
||||||
@ -192,11 +204,10 @@ public class LoginActivity extends AppCompatActivity {
|
|||||||
parameters.put(Helper.REDIRECT_URIS, Helper.REDIRECT_CONTENT);
|
parameters.put(Helper.REDIRECT_URIS, Helper.REDIRECT_CONTENT);
|
||||||
parameters.put(Helper.SCOPES, Helper.OAUTH_SCOPES_PEERTUBE);
|
parameters.put(Helper.SCOPES, Helper.OAUTH_SCOPES_PEERTUBE);
|
||||||
parameters.put(Helper.WEBSITE, Helper.WEBSITE_VALUE);
|
parameters.put(Helper.WEBSITE, Helper.WEBSITE_VALUE);
|
||||||
String finalInstance = instance;
|
|
||||||
new Thread(() -> {
|
new Thread(() -> {
|
||||||
try {
|
try {
|
||||||
actionToken = "/api/v1/oauth-clients/local";
|
actionToken = "/api/v1/oauth-clients/local";
|
||||||
String response = new HttpsConnection(LoginActivity.this).get("https://" + finalInstance + actionToken, 30, parameters, null);
|
String response = new HttpsConnection(LoginActivity.this).get("https://" + instance + actionToken, 30, parameters, null);
|
||||||
if (response == null) {
|
if (response == null) {
|
||||||
runOnUiThread(() -> {
|
runOnUiThread(() -> {
|
||||||
connectionButton.setEnabled(true);
|
connectionButton.setEnabled(true);
|
||||||
@ -231,7 +242,7 @@ public class LoginActivity extends AppCompatActivity {
|
|||||||
parameters.put("scope", "user");
|
parameters.put("scope", "user");
|
||||||
String oauthUrl = "/api/v1/users/token";
|
String oauthUrl = "/api/v1/users/token";
|
||||||
try {
|
try {
|
||||||
String responseLogin = new HttpsConnection(LoginActivity.this).post("https://" + finalInstance + oauthUrl, 30, parameters, null);
|
String responseLogin = new HttpsConnection(LoginActivity.this).post("https://" + instance + oauthUrl, 30, parameters, null);
|
||||||
proceedLogin(responseLogin, host);
|
proceedLogin(responseLogin, host);
|
||||||
} catch (final Exception e) {
|
} catch (final Exception e) {
|
||||||
parameters.clear();
|
parameters.clear();
|
||||||
@ -250,7 +261,7 @@ public class LoginActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
parameters.put("scope", "user");
|
parameters.put("scope", "user");
|
||||||
try {
|
try {
|
||||||
String responseLogin = new HttpsConnection(LoginActivity.this).post("https://" + finalInstance + oauthUrl, 30, parameters, null);
|
String responseLogin = new HttpsConnection(LoginActivity.this).post("https://" + instance + oauthUrl, 30, parameters, null);
|
||||||
proceedLogin(responseLogin, host);
|
proceedLogin(responseLogin, host);
|
||||||
} catch (final Exception e2) {
|
} catch (final Exception e2) {
|
||||||
e2.printStackTrace();
|
e2.printStackTrace();
|
||||||
|
@ -22,6 +22,9 @@ import android.database.sqlite.SQLiteDatabase;
|
|||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
@ -43,11 +46,13 @@ import java.util.LinkedHashMap;
|
|||||||
import app.fedilab.fedilabtube.client.HttpsConnection;
|
import app.fedilab.fedilabtube.client.HttpsConnection;
|
||||||
import app.fedilab.fedilabtube.client.PeertubeAPI;
|
import app.fedilab.fedilabtube.client.PeertubeAPI;
|
||||||
import app.fedilab.fedilabtube.client.entities.Account;
|
import app.fedilab.fedilabtube.client.entities.Account;
|
||||||
|
import app.fedilab.fedilabtube.client.entities.InstanceNodeInfo;
|
||||||
import app.fedilab.fedilabtube.client.entities.PeertubeInformation;
|
import app.fedilab.fedilabtube.client.entities.PeertubeInformation;
|
||||||
import app.fedilab.fedilabtube.helper.Helper;
|
import app.fedilab.fedilabtube.helper.Helper;
|
||||||
import app.fedilab.fedilabtube.sqlite.AccountDAO;
|
import app.fedilab.fedilabtube.sqlite.AccountDAO;
|
||||||
import app.fedilab.fedilabtube.sqlite.Sqlite;
|
import app.fedilab.fedilabtube.sqlite.Sqlite;
|
||||||
import app.fedilab.fedilabtube.viewmodel.FeedsVM;
|
import app.fedilab.fedilabtube.viewmodel.FeedsVM;
|
||||||
|
import es.dmoral.toasty.Toasty;
|
||||||
|
|
||||||
import static app.fedilab.fedilabtube.helper.Helper.academies;
|
import static app.fedilab.fedilabtube.helper.Helper.academies;
|
||||||
|
|
||||||
@ -173,7 +178,11 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
if (item.getItemId() == R.id.action_change_instance) {
|
if (item.getItemId() == R.id.action_change_instance) {
|
||||||
showRadioButtonDialog();
|
if (BuildConfig.full_instances) {
|
||||||
|
showRadioButtonDialogFullInstances();
|
||||||
|
} else {
|
||||||
|
showRadioButtonDialog();
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
} else if (item.getItemId() == R.id.action_account) {
|
} else if (item.getItemId() == R.id.action_account) {
|
||||||
Intent intent;
|
Intent intent;
|
||||||
@ -249,4 +258,43 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
AlertDialog alert = alt_bld.create();
|
AlertDialog alert = alt_bld.create();
|
||||||
alert.show();
|
alert.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressLint("ApplySharedPref")
|
||||||
|
private void showRadioButtonDialogFullInstances() {
|
||||||
|
final SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
|
||||||
|
AlertDialog.Builder alt_bld = new AlertDialog.Builder(this);
|
||||||
|
alt_bld.setTitle(R.string.instance_choice);
|
||||||
|
String instance = Helper.getLiveInstance(MainActivity.this);
|
||||||
|
final EditText input = new EditText(MainActivity.this);
|
||||||
|
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
|
||||||
|
LinearLayout.LayoutParams.MATCH_PARENT,
|
||||||
|
LinearLayout.LayoutParams.MATCH_PARENT);
|
||||||
|
input.setLayoutParams(lp);
|
||||||
|
alt_bld.setView(input);
|
||||||
|
input.setText(instance);
|
||||||
|
alt_bld.setPositiveButton(R.string.validate,
|
||||||
|
(dialog, which) -> new Thread(() -> {
|
||||||
|
try {
|
||||||
|
String newInstance = input.getText().toString().trim();
|
||||||
|
InstanceNodeInfo instanceNodeInfo = new PeertubeAPI(MainActivity.this).displayNodeInfo(newInstance);
|
||||||
|
if (instanceNodeInfo.getName() != null && instanceNodeInfo.getName().trim().toLowerCase().compareTo("peertube") == 0) {
|
||||||
|
SharedPreferences.Editor editor = sharedpreferences.edit();
|
||||||
|
editor.putString(Helper.PREF_INSTANCE, newInstance);
|
||||||
|
editor.commit();
|
||||||
|
runOnUiThread(() -> {
|
||||||
|
dialog.dismiss();
|
||||||
|
recreate();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
runOnUiThread(() -> Toasty.error(MainActivity.this, getString(R.string.not_valide_instance), Toast.LENGTH_LONG).show());
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
}).start());
|
||||||
|
alt_bld.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
|
||||||
|
AlertDialog alert = alt_bld.create();
|
||||||
|
alert.show();
|
||||||
|
}
|
||||||
}
|
}
|
@ -30,6 +30,7 @@ import androidx.appcompat.app.AlertDialog;
|
|||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
import com.google.android.material.textfield.TextInputEditText;
|
import com.google.android.material.textfield.TextInputEditText;
|
||||||
|
import com.google.android.material.textfield.TextInputLayout;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
@ -58,13 +59,19 @@ public class PeertubeRegisterActivity extends AppCompatActivity {
|
|||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
|
||||||
signup = findViewById(R.id.signup);
|
signup = findViewById(R.id.signup);
|
||||||
|
|
||||||
|
TextInputLayout login_instance_container = findViewById(R.id.login_instance_container);
|
||||||
TextInputEditText username = findViewById(R.id.username);
|
TextInputEditText username = findViewById(R.id.username);
|
||||||
TextInputEditText email = findViewById(R.id.email);
|
TextInputEditText email = findViewById(R.id.email);
|
||||||
TextInputEditText password = findViewById(R.id.password);
|
TextInputEditText password = findViewById(R.id.password);
|
||||||
TextInputEditText password_confirm = findViewById(R.id.password_confirm);
|
TextInputEditText password_confirm = findViewById(R.id.password_confirm);
|
||||||
|
TextInputEditText login_instance = findViewById(R.id.login_instance);
|
||||||
CheckBox agreement = findViewById(R.id.agreement);
|
CheckBox agreement = findViewById(R.id.agreement);
|
||||||
error_message = findViewById(R.id.error_message);
|
error_message = findViewById(R.id.error_message);
|
||||||
|
|
||||||
|
if (BuildConfig.full_instances) {
|
||||||
|
login_instance_container.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
|
||||||
username.setOnFocusChangeListener((view, focused) -> {
|
username.setOnFocusChangeListener((view, focused) -> {
|
||||||
if (!focused && username.getText() != null) {
|
if (!focused && username.getText() != null) {
|
||||||
@ -134,8 +141,13 @@ public class PeertubeRegisterActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
signup.setEnabled(false);
|
signup.setEnabled(false);
|
||||||
|
|
||||||
String host = emailArray[1];
|
if (BuildConfig.full_instances) {
|
||||||
instance = Helper.getPeertubeUrl(host);
|
instance = login_instance.getText().toString();
|
||||||
|
} else {
|
||||||
|
String host = emailArray[1];
|
||||||
|
instance = Helper.getPeertubeUrl(host);
|
||||||
|
}
|
||||||
|
|
||||||
AccountCreation accountCreation = new AccountCreation();
|
AccountCreation accountCreation = new AccountCreation();
|
||||||
accountCreation.setEmail(email.getText().toString().trim());
|
accountCreation.setEmail(email.getText().toString().trim());
|
||||||
accountCreation.setPassword(password.getText().toString().trim());
|
accountCreation.setPassword(password.getText().toString().trim());
|
||||||
@ -193,10 +205,17 @@ public class PeertubeRegisterActivity extends AppCompatActivity {
|
|||||||
TextView agreement_text = findViewById(R.id.agreement_text);
|
TextView agreement_text = findViewById(R.id.agreement_text);
|
||||||
String tos = getString(R.string.tos);
|
String tos = getString(R.string.tos);
|
||||||
String serverrules = getString(R.string.server_rules);
|
String serverrules = getString(R.string.server_rules);
|
||||||
String content_agreement = getString(R.string.agreement_check,
|
String content_agreement;
|
||||||
"<a href='https://apps.education.fr/cgu#peertube' >" + serverrules + "</a>",
|
if (BuildConfig.full_instances) {
|
||||||
"<a href='https://apps.education.fr/bonnes-pratiques/' >" + tos + "</a>"
|
content_agreement = getString(R.string.agreement_check_peertube,
|
||||||
);
|
"<a href='https://" + instance + "/about/instance#terms-section' >" + tos + "</a>"
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
content_agreement = getString(R.string.agreement_check,
|
||||||
|
"<a href='https://apps.education.fr/cgu#peertube' >" + serverrules + "</a>",
|
||||||
|
"<a href='https://apps.education.fr/bonnes-pratiques/' >" + tos + "</a>"
|
||||||
|
);
|
||||||
|
}
|
||||||
agreement_text.setMovementMethod(LinkMovementMethod.getInstance());
|
agreement_text.setMovementMethod(LinkMovementMethod.getInstance());
|
||||||
agreement_text.setText(Html.fromHtml(content_agreement));
|
agreement_text.setText(Html.fromHtml(content_agreement));
|
||||||
setTitle(R.string.create_an_account);
|
setTitle(R.string.create_an_account);
|
||||||
|
@ -48,6 +48,8 @@ import app.fedilab.fedilabtube.client.entities.AccountCreation;
|
|||||||
import app.fedilab.fedilabtube.client.entities.ChannelCreation;
|
import app.fedilab.fedilabtube.client.entities.ChannelCreation;
|
||||||
import app.fedilab.fedilabtube.client.entities.Error;
|
import app.fedilab.fedilabtube.client.entities.Error;
|
||||||
import app.fedilab.fedilabtube.client.entities.Instance;
|
import app.fedilab.fedilabtube.client.entities.Instance;
|
||||||
|
import app.fedilab.fedilabtube.client.entities.InstanceNodeInfo;
|
||||||
|
import app.fedilab.fedilabtube.client.entities.NodeInfo;
|
||||||
import app.fedilab.fedilabtube.client.entities.Peertube;
|
import app.fedilab.fedilabtube.client.entities.Peertube;
|
||||||
import app.fedilab.fedilabtube.client.entities.PeertubeAccountNotification;
|
import app.fedilab.fedilabtube.client.entities.PeertubeAccountNotification;
|
||||||
import app.fedilab.fedilabtube.client.entities.PeertubeActorFollow;
|
import app.fedilab.fedilabtube.client.entities.PeertubeActorFollow;
|
||||||
@ -2091,6 +2093,55 @@ public class PeertubeAPI {
|
|||||||
return accounts;
|
return accounts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public InstanceNodeInfo displayNodeInfo(String domain) {
|
||||||
|
if (domain == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
String response;
|
||||||
|
InstanceNodeInfo instanceNodeInfo = new InstanceNodeInfo();
|
||||||
|
if (domain.startsWith("http://")) {
|
||||||
|
domain = domain.replace("http://", "");
|
||||||
|
}
|
||||||
|
if (domain.startsWith("https://")) {
|
||||||
|
domain = domain.replace("https://", "");
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
response = new HttpsConnection(context).get("https://" + domain + "/.well-known/nodeinfo", 30, null, null);
|
||||||
|
JSONArray jsonArray = new JSONObject(response).getJSONArray("links");
|
||||||
|
ArrayList<NodeInfo> nodeInfos = new ArrayList<>();
|
||||||
|
try {
|
||||||
|
int i = 0;
|
||||||
|
while (i < jsonArray.length()) {
|
||||||
|
|
||||||
|
JSONObject resobj = jsonArray.getJSONObject(i);
|
||||||
|
NodeInfo nodeInfo = new NodeInfo();
|
||||||
|
nodeInfo.setHref(resobj.getString("href"));
|
||||||
|
nodeInfo.setRel(resobj.getString("rel"));
|
||||||
|
i++;
|
||||||
|
nodeInfos.add(nodeInfo);
|
||||||
|
}
|
||||||
|
if (nodeInfos.size() > 0) {
|
||||||
|
NodeInfo nodeInfo = nodeInfos.get(nodeInfos.size() - 1);
|
||||||
|
response = new HttpsConnection(context).get(nodeInfo.getHref(), 30, null, null);
|
||||||
|
JSONObject resobj = new JSONObject(response);
|
||||||
|
JSONObject jsonObject = resobj.getJSONObject("software");
|
||||||
|
String name = jsonObject.getString("name").toUpperCase();
|
||||||
|
if (name.compareTo("CORGIDON") == 0) {
|
||||||
|
name = "MASTODON";
|
||||||
|
}
|
||||||
|
instanceNodeInfo.setName(name);
|
||||||
|
instanceNodeInfo.setVersion(jsonObject.getString("version"));
|
||||||
|
instanceNodeInfo.setOpenRegistrations(resobj.getBoolean("openRegistrations"));
|
||||||
|
}
|
||||||
|
} catch (JSONException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
} catch (IOException | JSONException | NoSuchAlgorithmException | KeyManagementException | HttpsConnection.HttpsConnectionException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return instanceNodeInfo;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the error message
|
* Set the error message
|
||||||
*
|
*
|
||||||
|
@ -0,0 +1,137 @@
|
|||||||
|
package app.fedilab.fedilabtube.client.entities;
|
||||||
|
|
||||||
|
/* Copyright 2020 Thomas Schneider
|
||||||
|
*
|
||||||
|
* This file is a part of TubeLab
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify it under the terms of the
|
||||||
|
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
|
||||||
|
* License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* TubeLab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
|
||||||
|
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||||
|
* Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
|
||||||
|
* see <http://www.gnu.org/licenses>. */
|
||||||
|
@SuppressWarnings("unused")
|
||||||
|
public class InstanceNodeInfo {
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
private String title;
|
||||||
|
private String version;
|
||||||
|
private boolean openRegistrations;
|
||||||
|
private boolean connectionError;
|
||||||
|
private int numberOfUsers = 0;
|
||||||
|
private int numberOfPosts = 0;
|
||||||
|
private int numberOfInstance = 0;
|
||||||
|
private String staffAccountStr;
|
||||||
|
private Account staffAccount;
|
||||||
|
private String nodeName;
|
||||||
|
private String nodeDescription;
|
||||||
|
private String thumbnail;
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVersion() {
|
||||||
|
return version;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVersion(String version) {
|
||||||
|
this.version = version;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isOpenRegistrations() {
|
||||||
|
return openRegistrations;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOpenRegistrations(boolean openRegistrations) {
|
||||||
|
this.openRegistrations = openRegistrations;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isConnectionError() {
|
||||||
|
return connectionError;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setConnectionError(boolean connectionError) {
|
||||||
|
this.connectionError = connectionError;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getNumberOfUsers() {
|
||||||
|
return numberOfUsers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNumberOfUsers(int numberOfUsers) {
|
||||||
|
this.numberOfUsers = numberOfUsers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getNumberOfPosts() {
|
||||||
|
return numberOfPosts;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNumberOfPosts(int numberOfPosts) {
|
||||||
|
this.numberOfPosts = numberOfPosts;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStaffAccountStr() {
|
||||||
|
return staffAccountStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStaffAccountStr(String staffAccountStr) {
|
||||||
|
this.staffAccountStr = staffAccountStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Account getStaffAccount() {
|
||||||
|
return staffAccount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStaffAccount(Account staffAccount) {
|
||||||
|
this.staffAccount = staffAccount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNodeName() {
|
||||||
|
return nodeName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNodeName(String nodeName) {
|
||||||
|
this.nodeName = nodeName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNodeDescription() {
|
||||||
|
return nodeDescription;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNodeDescription(String nodeDescription) {
|
||||||
|
this.nodeDescription = nodeDescription;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getThumbnail() {
|
||||||
|
return thumbnail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setThumbnail(String thumbnail) {
|
||||||
|
this.thumbnail = thumbnail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getNumberOfInstance() {
|
||||||
|
return numberOfInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNumberOfInstance(int numberOfInstance) {
|
||||||
|
this.numberOfInstance = numberOfInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTitle() {
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTitle(String title) {
|
||||||
|
this.title = title;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,37 @@
|
|||||||
|
package app.fedilab.fedilabtube.client.entities;
|
||||||
|
|
||||||
|
/* Copyright 2020 Thomas Schneider
|
||||||
|
*
|
||||||
|
* This file is a part of TubeLab
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify it under the terms of the
|
||||||
|
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
|
||||||
|
* License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* TubeLab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
|
||||||
|
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||||
|
* Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
|
||||||
|
* see <http://www.gnu.org/licenses>. */
|
||||||
|
@SuppressWarnings("unused")
|
||||||
|
public class NodeInfo {
|
||||||
|
private String rel;
|
||||||
|
private String href;
|
||||||
|
|
||||||
|
public String getRel() {
|
||||||
|
return rel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRel(String rel) {
|
||||||
|
this.rel = rel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getHref() {
|
||||||
|
return href;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHref(String href) {
|
||||||
|
this.href = href;
|
||||||
|
}
|
||||||
|
}
|
@ -38,7 +38,6 @@ import android.widget.Toast;
|
|||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.fragment.app.FragmentTransaction;
|
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
|
|
||||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||||
|
@ -56,6 +56,7 @@ import java.util.Locale;
|
|||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
import app.fedilab.fedilabtube.BuildConfig;
|
||||||
import app.fedilab.fedilabtube.MainActivity;
|
import app.fedilab.fedilabtube.MainActivity;
|
||||||
import app.fedilab.fedilabtube.R;
|
import app.fedilab.fedilabtube.R;
|
||||||
import app.fedilab.fedilabtube.WebviewActivity;
|
import app.fedilab.fedilabtube.WebviewActivity;
|
||||||
@ -209,6 +210,9 @@ public class Helper {
|
|||||||
*/
|
*/
|
||||||
public static String getPeertubeUrl(String acad) {
|
public static String getPeertubeUrl(String acad) {
|
||||||
|
|
||||||
|
if (BuildConfig.full_instances) {
|
||||||
|
return acad;
|
||||||
|
}
|
||||||
if (acad.compareTo("education.gouv.fr") == 0 || acad.compareTo("igesr.gouv.fr") == 0) {
|
if (acad.compareTo("education.gouv.fr") == 0 || acad.compareTo("igesr.gouv.fr") == 0) {
|
||||||
acad = "education.fr";
|
acad = "education.fr";
|
||||||
} else if (acad.compareTo("ac-nancy-metz.fr") == 0) {
|
} else if (acad.compareTo("ac-nancy-metz.fr") == 0) {
|
||||||
@ -241,14 +245,19 @@ public class Helper {
|
|||||||
*/
|
*/
|
||||||
public static String getLiveInstance(Context context) {
|
public static String getLiveInstance(Context context) {
|
||||||
final SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
|
final SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
|
||||||
String acad = sharedpreferences.getString(Helper.PREF_INSTANCE, "tube.ac-lyon.fr");
|
String acad;
|
||||||
if (acad == null) {
|
if (BuildConfig.full_instances) {
|
||||||
acad = "tube.ac-lyon.fr";
|
return sharedpreferences.getString(Helper.PREF_INSTANCE, "peertube.social");
|
||||||
}
|
|
||||||
if (acad.startsWith("tube-")) {
|
|
||||||
return acad;
|
|
||||||
} else {
|
} else {
|
||||||
return getPeertubeUrl(acad);
|
acad = sharedpreferences.getString(Helper.PREF_INSTANCE, "tube.ac-lyon.fr");
|
||||||
|
if (acad == null) {
|
||||||
|
acad = "tube.ac-lyon.fr";
|
||||||
|
}
|
||||||
|
if (acad.startsWith("tube-")) {
|
||||||
|
return acad;
|
||||||
|
} else {
|
||||||
|
return getPeertubeUrl(acad);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,13 +0,0 @@
|
|||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:shape="rectangle">
|
|
||||||
<solid android:color="@android:color/transparent" />
|
|
||||||
<stroke
|
|
||||||
android:width="1dip"
|
|
||||||
android:color="?colorAccent" />
|
|
||||||
<corners android:radius="2dp" />
|
|
||||||
<padding
|
|
||||||
android:bottom="1dip"
|
|
||||||
android:left="4dip"
|
|
||||||
android:right="4dip"
|
|
||||||
android:top="1dip" />
|
|
||||||
</shape>
|
|
File diff suppressed because one or more lines are too long
@ -1,10 +0,0 @@
|
|||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:width="24dp"
|
|
||||||
android:height="24dp"
|
|
||||||
android:tint="?attr/colorControlNormal"
|
|
||||||
android:viewportWidth="24"
|
|
||||||
android:viewportHeight="24">
|
|
||||||
<path
|
|
||||||
android:fillColor="@android:color/white"
|
|
||||||
android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z" />
|
|
||||||
</vector>
|
|
@ -1,10 +0,0 @@
|
|||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:width="24dp"
|
|
||||||
android:height="24dp"
|
|
||||||
android:tint="?attr/colorControlNormal"
|
|
||||||
android:viewportWidth="24"
|
|
||||||
android:viewportHeight="24">
|
|
||||||
<path
|
|
||||||
android:fillColor="@android:color/white"
|
|
||||||
android:pathData="M5.88,4.12L13.76,12l-7.88,7.88L8,22l10,-10L8,2z" />
|
|
||||||
</vector>
|
|
@ -1,10 +0,0 @@
|
|||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:width="24dp"
|
|
||||||
android:height="24dp"
|
|
||||||
android:tint="#FFFFFF"
|
|
||||||
android:viewportWidth="24"
|
|
||||||
android:viewportHeight="24">
|
|
||||||
<path
|
|
||||||
android:fillColor="@android:color/white"
|
|
||||||
android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z" />
|
|
||||||
</vector>
|
|
@ -1,10 +0,0 @@
|
|||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:width="24dp"
|
|
||||||
android:height="24dp"
|
|
||||||
android:tint="?attr/colorControlNormal"
|
|
||||||
android:viewportWidth="24"
|
|
||||||
android:viewportHeight="24">
|
|
||||||
<path
|
|
||||||
android:fillColor="@android:color/white"
|
|
||||||
android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z" />
|
|
||||||
</vector>
|
|
@ -1,9 +0,0 @@
|
|||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:width="24dp"
|
|
||||||
android:height="24dp"
|
|
||||||
android:viewportWidth="24.0"
|
|
||||||
android:viewportHeight="24.0">
|
|
||||||
<path
|
|
||||||
android:fillColor="#FF000000"
|
|
||||||
android:pathData="M3,13h8L11,3L3,3v10zM3,21h8v-6L3,15v6zM13,21h8L21,11h-8v10zM13,3v6h8L21,3h-8z" />
|
|
||||||
</vector>
|
|
@ -1,170 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:width="108dp"
|
|
||||||
android:height="108dp"
|
|
||||||
android:viewportWidth="108"
|
|
||||||
android:viewportHeight="108">
|
|
||||||
<path
|
|
||||||
android:fillColor="#3DDC84"
|
|
||||||
android:pathData="M0,0h108v108h-108z" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M9,0L9,108"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M19,0L19,108"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M29,0L29,108"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M39,0L39,108"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M49,0L49,108"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M59,0L59,108"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M69,0L69,108"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M79,0L79,108"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M89,0L89,108"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M99,0L99,108"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M0,9L108,9"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M0,19L108,19"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M0,29L108,29"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M0,39L108,39"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M0,49L108,49"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M0,59L108,59"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M0,69L108,69"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M0,79L108,79"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M0,89L108,89"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M0,99L108,99"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M19,29L89,29"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M19,39L89,39"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M19,49L89,49"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M19,59L89,59"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M19,69L89,69"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M19,79L89,79"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M29,19L29,89"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M39,19L39,89"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M49,19L49,89"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M59,19L59,89"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M69,19L69,89"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M79,19L79,89"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
</vector>
|
|
@ -1,9 +0,0 @@
|
|||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:width="24dp"
|
|
||||||
android:height="24dp"
|
|
||||||
android:viewportWidth="24.0"
|
|
||||||
android:viewportHeight="24.0">
|
|
||||||
<path
|
|
||||||
android:fillColor="#FF000000"
|
|
||||||
android:pathData="M12,22c1.1,0 2,-0.9 2,-2h-4c0,1.1 0.89,2 2,2zM18,16v-5c0,-3.07 -1.64,-5.64 -4.5,-6.32L13.5,4c0,-0.83 -0.67,-1.5 -1.5,-1.5s-1.5,0.67 -1.5,1.5v0.68C7.63,5.36 6,7.92 6,11v5l-2,2v1h16v-1l-2,-2z" />
|
|
||||||
</vector>
|
|
@ -1,9 +0,0 @@
|
|||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:width="24dp"
|
|
||||||
android:height="24dp"
|
|
||||||
android:viewportWidth="24"
|
|
||||||
android:viewportHeight="24">
|
|
||||||
<path
|
|
||||||
android:fillColor="#fff"
|
|
||||||
android:pathData="m9.6992,12c-2.21,0 -4,-1.79 -4,-4s1.79,-4 4,-4c2.21,0 4,1.79 4,4s-1.79,4 -4,4zM22.3012,10v2.3752h-6.6017v-2.3752zM9.6992,14c2.67,0 8,1.34 8,4v2h-16v-2c0,-2.66 5.33,-4 8,-4z" />
|
|
||||||
</vector>
|
|
@ -1,10 +0,0 @@
|
|||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:width="24dp"
|
|
||||||
android:height="24dp"
|
|
||||||
android:tint="#FFFFFFFF"
|
|
||||||
android:viewportWidth="24.0"
|
|
||||||
android:viewportHeight="24.0">
|
|
||||||
<path
|
|
||||||
android:fillColor="#FFFFFFFF"
|
|
||||||
android:pathData="M15,12c2.21,0 4,-1.79 4,-4s-1.79,-4 -4,-4 -4,1.79 -4,4 1.79,4 4,4zM6,10L6,7L4,7v3L1,10v2h3v3h2v-3h3v-2L6,10zM15,14c-2.67,0 -8,1.34 -8,4v2h16v-2c0,-2.66 -5.33,-4 -8,-4z" />
|
|
||||||
</vector>
|
|
@ -23,7 +23,6 @@
|
|||||||
tools:context=".AccountActivity">
|
tools:context=".AccountActivity">
|
||||||
|
|
||||||
<com.google.android.material.appbar.AppBarLayout
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
android:id="@+id/appBar"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:fitsSystemWindows="true"
|
android:fitsSystemWindows="true"
|
||||||
|
@ -21,7 +21,6 @@
|
|||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/step_instance"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
@ -72,13 +71,32 @@
|
|||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
|
android:id="@+id/login_instance_container"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/instance_chosen">
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
|
android:id="@+id/login_instance"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:hint="@string/title_instance_login"
|
||||||
|
android:inputType="textWebEditText"
|
||||||
|
android:singleLine="true" />
|
||||||
|
|
||||||
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputLayout
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
android:id="@+id/login_uid_container"
|
android:id="@+id/login_uid_container"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/instance_chosen">
|
app:layout_constraintTop_toBottomOf="@id/login_instance_container">
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputEditText
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
android:id="@+id/login_uid"
|
android:id="@+id/login_uid"
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
-->
|
-->
|
||||||
<androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/drawer_layout"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:fitsSystemWindows="true">
|
android:fitsSystemWindows="true">
|
||||||
|
@ -33,7 +33,6 @@
|
|||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/host_reg"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
@ -41,7 +40,6 @@
|
|||||||
android:textSize="18sp" />
|
android:textSize="18sp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/change_instance"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
@ -62,6 +60,31 @@
|
|||||||
android:textColor="@color/red_1"
|
android:textColor="@color/red_1"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="150dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:labelFor="@+id/login_instance"
|
||||||
|
android:text="@string/title_instance_login" />
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
|
android:id="@+id/login_instance_container"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent">
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
|
android:id="@+id/login_instance"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:inputType="textWebEditText"
|
||||||
|
android:singleLine="true" />
|
||||||
|
|
||||||
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="150dp"
|
android:layout_width="150dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -70,7 +93,6 @@
|
|||||||
android:text="@string/username" />
|
android:text="@string/username" />
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputLayout
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
android:id="@+id/username_layout"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:errorEnabled="true">
|
app:errorEnabled="true">
|
||||||
@ -83,7 +105,6 @@
|
|||||||
</com.google.android.material.textfield.TextInputLayout>
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/username_indicator"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textSize="12sp" />
|
android:textSize="12sp" />
|
||||||
@ -96,7 +117,6 @@
|
|||||||
android:text="@string/email" />
|
android:text="@string/email" />
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputLayout
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
android:id="@+id/email_layout"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:errorEnabled="true">
|
app:errorEnabled="true">
|
||||||
@ -121,7 +141,6 @@
|
|||||||
android:text="@string/password" />
|
android:text="@string/password" />
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputLayout
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
android:id="@+id/password_layout"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:errorEnabled="true">
|
app:errorEnabled="true">
|
||||||
@ -149,7 +168,6 @@
|
|||||||
|
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputLayout
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
android:id="@+id/password_confirm_layout"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:errorEnabled="true">
|
app:errorEnabled="true">
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
tools:context=".ShowAccountActivity">
|
tools:context=".ShowAccountActivity">
|
||||||
|
|
||||||
<com.google.android.material.appbar.AppBarLayout
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
android:id="@+id/appBar"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:fitsSystemWindows="true"
|
android:fitsSystemWindows="true"
|
||||||
@ -101,7 +100,6 @@
|
|||||||
app:layout_constraintTop_toBottomOf="@id/account_dn" />
|
app:layout_constraintTop_toBottomOf="@id/account_dn" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/header_edit_profile"
|
|
||||||
style="@style/Widget.AppCompat.Button.Colored"
|
style="@style/Widget.AppCompat.Button.Colored"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -117,7 +115,6 @@
|
|||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/main_header_container"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@+id/top_banner"
|
android:layout_below="@+id/top_banner"
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
see <http://www.gnu.org/licenses>.
|
see <http://www.gnu.org/licenses>.
|
||||||
-->
|
-->
|
||||||
<androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:id="@+id/drawer_layout"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
see <http://www.gnu.org/licenses>.
|
see <http://www.gnu.org/licenses>.
|
||||||
-->
|
-->
|
||||||
<androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:id="@+id/drawer_layout"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
see <http://www.gnu.org/licenses>.
|
see <http://www.gnu.org/licenses>.
|
||||||
-->
|
-->
|
||||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:id="@+id/card_status_container"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
@ -1,125 +0,0 @@
|
|||||||
<?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>
|
|
@ -1,83 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?><!--
|
|
||||||
Copyright 2020 Thomas Schneider
|
|
||||||
|
|
||||||
This file is a part of TubeLab
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it under the terms of the
|
|
||||||
GNU General Public License as published by the Free Software Foundation; either version 3 of the
|
|
||||||
License, or (at your option) any later version.
|
|
||||||
|
|
||||||
TubeLab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
|
|
||||||
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
|
||||||
Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License along with TubeLab; if not,
|
|
||||||
see <http://www.gnu.org/licenses>.
|
|
||||||
-->
|
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:paddingLeft="@dimen/fab_margin"
|
|
||||||
android:paddingRight="@dimen/fab_margin">
|
|
||||||
<!-- Listview Accounts -->
|
|
||||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
|
||||||
android:id="@+id/swipeContainer"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
|
||||||
android:id="@+id/lv_accounts"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:divider="@null"
|
|
||||||
android:scrollbars="none" />
|
|
||||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:id="@+id/no_action"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:visibility="gone">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/no_action_text"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:gravity="center"
|
|
||||||
android:padding="10dp"
|
|
||||||
android:text="@string/no_channels"
|
|
||||||
android:textSize="25sp"
|
|
||||||
android:textStyle="italic|bold"
|
|
||||||
android:typeface="serif" />
|
|
||||||
</RelativeLayout>
|
|
||||||
<!-- Main Loader -->
|
|
||||||
<RelativeLayout
|
|
||||||
android:id="@+id/loader"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:gravity="center"
|
|
||||||
android:visibility="gone">
|
|
||||||
|
|
||||||
<ProgressBar
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:indeterminate="true" />
|
|
||||||
</RelativeLayout>
|
|
||||||
<!-- Loader for next accounts -->
|
|
||||||
<RelativeLayout
|
|
||||||
android:id="@+id/loading_next_accounts"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="20dp"
|
|
||||||
android:layout_alignParentBottom="true"
|
|
||||||
android:layout_gravity="bottom|center_horizontal"
|
|
||||||
android:gravity="bottom|center_horizontal"
|
|
||||||
android:visibility="gone">
|
|
||||||
|
|
||||||
<ProgressBar
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:indeterminate="true" />
|
|
||||||
</RelativeLayout>
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
@ -1,58 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?><!--
|
|
||||||
Copyright 2020 Thomas Schneider
|
|
||||||
|
|
||||||
This file is a part of TubeLab
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it under the terms of the
|
|
||||||
GNU General Public License as published by the Free Software Foundation; either version 3 of the
|
|
||||||
License, or (at your option) any later version.
|
|
||||||
|
|
||||||
TubeLab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
|
|
||||||
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
|
||||||
Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License along with TubeLab; if not,
|
|
||||||
see <http://www.gnu.org/licenses>.
|
|
||||||
-->
|
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:paddingLeft="@dimen/fab_margin"
|
|
||||||
android:paddingRight="@dimen/fab_margin">
|
|
||||||
<!-- Listview Peertube bookmark -->
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
|
||||||
android:id="@+id/lv_status"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:scrollbars="none" />
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:id="@+id/no_action"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:visibility="gone">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:gravity="center"
|
|
||||||
android:padding="10dp"
|
|
||||||
android:text="@string/bookmark_peertube_empty"
|
|
||||||
android:textSize="25sp" />
|
|
||||||
</RelativeLayout>
|
|
||||||
<!-- Main Loader -->
|
|
||||||
<RelativeLayout
|
|
||||||
android:id="@+id/loader"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:gravity="center"
|
|
||||||
android:visibility="gone">
|
|
||||||
|
|
||||||
<ProgressBar
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:indeterminate="true" />
|
|
||||||
</RelativeLayout>
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
@ -1,67 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?><!--
|
|
||||||
Copyright 2020 Thomas Schneider
|
|
||||||
|
|
||||||
This file is a part of TubeLab
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it under the terms of the
|
|
||||||
GNU General Public License as published by the Free Software Foundation; either version 3 of the
|
|
||||||
License, or (at your option) any later version.
|
|
||||||
|
|
||||||
TubeLab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
|
|
||||||
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
|
||||||
Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License along with TubeLab; if not,
|
|
||||||
see <http://www.gnu.org/licenses>.
|
|
||||||
-->
|
|
||||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:id="@+id/swipeContainer"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_marginStart="@dimen/fab_margin"
|
|
||||||
android:layout_marginLeft="@dimen/fab_margin"
|
|
||||||
android:layout_marginEnd="@dimen/fab_margin"
|
|
||||||
android:layout_marginRight="@dimen/fab_margin"
|
|
||||||
android:paddingLeft="@dimen/drawer_padding"
|
|
||||||
android:paddingRight="@dimen/drawer_padding">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:paddingLeft="@dimen/fab_margin"
|
|
||||||
android:paddingRight="@dimen/fab_margin"
|
|
||||||
tools:ignore="UselessParent">
|
|
||||||
<!-- Choose stream -->
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:text="@string/set_video_mode" />
|
|
||||||
|
|
||||||
<Spinner
|
|
||||||
android:id="@+id/set_video_mode"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<!-- DISPLAY NSFW VIDEOS -->
|
|
||||||
<CheckBox
|
|
||||||
android:id="@+id/set_video_nsfw"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:text="@string/display_nsfw_videos" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</ScrollView>
|
|
||||||
|
|
@ -1,53 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?><!--
|
|
||||||
Copyright 2020 Thomas Schneider
|
|
||||||
|
|
||||||
This file is a part of TubeLab
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it under the terms of the
|
|
||||||
GNU General Public License as published by the Free Software Foundation; either version 3 of the
|
|
||||||
License, or (at your option) any later version.
|
|
||||||
|
|
||||||
TubeLab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
|
|
||||||
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
|
||||||
Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License along with TubeLab; if not,
|
|
||||||
see <http://www.gnu.org/licenses>.
|
|
||||||
-->
|
|
||||||
<androidx.appcompat.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:id="@+id/toolbar"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:background="?colorPrimary"
|
|
||||||
android:contentInsetStart="0dp"
|
|
||||||
android:contentInsetLeft="0dp"
|
|
||||||
android:contentInsetEnd="0dp"
|
|
||||||
android:contentInsetRight="0dp"
|
|
||||||
app:contentInsetEnd="0dp"
|
|
||||||
app:contentInsetLeft="0dp"
|
|
||||||
app:contentInsetRight="0dp"
|
|
||||||
app:contentInsetStart="0dp"
|
|
||||||
tools:ignore="UnusedAttribute">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/toolbar_close"
|
|
||||||
android:layout_width="30dp"
|
|
||||||
android:layout_height="30dp"
|
|
||||||
android:layout_marginEnd="10dp"
|
|
||||||
android:contentDescription="@string/close"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:src="@drawable/ic_baseline_close_24" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/toolbar_title"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:scrollHorizontally="true"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:textSize="16sp" />
|
|
||||||
|
|
||||||
</androidx.appcompat.widget.Toolbar>
|
|
@ -2,7 +2,6 @@
|
|||||||
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
|
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/mobile_navigation"
|
|
||||||
app:startDestination="@id/navigation_discover">
|
app:startDestination="@id/navigation_discover">
|
||||||
|
|
||||||
|
|
||||||
@ -14,7 +13,7 @@
|
|||||||
<argument
|
<argument
|
||||||
android:name="type"
|
android:name="type"
|
||||||
android:defaultValue="POVERVIEW"
|
android:defaultValue="POVERVIEW"
|
||||||
app:argType=".viewmodel.FeedsVM$Type" />
|
app:argType="app.fedilab.fedilabtube.viewmodel.FeedsVM$Type" />
|
||||||
</fragment>
|
</fragment>
|
||||||
|
|
||||||
|
|
||||||
@ -26,7 +25,7 @@
|
|||||||
<argument
|
<argument
|
||||||
android:name="type"
|
android:name="type"
|
||||||
android:defaultValue="PTRENDING"
|
android:defaultValue="PTRENDING"
|
||||||
app:argType=".viewmodel.FeedsVM$Type" />
|
app:argType="app.fedilab.fedilabtube.viewmodel.FeedsVM$Type" />
|
||||||
</fragment>
|
</fragment>
|
||||||
|
|
||||||
<fragment
|
<fragment
|
||||||
@ -37,7 +36,7 @@
|
|||||||
<argument
|
<argument
|
||||||
android:name="type"
|
android:name="type"
|
||||||
android:defaultValue="PMOSTLIKED"
|
android:defaultValue="PMOSTLIKED"
|
||||||
app:argType=".viewmodel.FeedsVM$Type" />
|
app:argType="app.fedilab.fedilabtube.viewmodel.FeedsVM$Type" />
|
||||||
</fragment>
|
</fragment>
|
||||||
|
|
||||||
|
|
||||||
@ -49,7 +48,7 @@
|
|||||||
<argument
|
<argument
|
||||||
android:name="type"
|
android:name="type"
|
||||||
android:defaultValue="PRECENTLYADDED"
|
android:defaultValue="PRECENTLYADDED"
|
||||||
app:argType=".viewmodel.FeedsVM$Type" />
|
app:argType="app.fedilab.fedilabtube.viewmodel.FeedsVM$Type" />
|
||||||
</fragment>
|
</fragment>
|
||||||
|
|
||||||
|
|
||||||
@ -61,8 +60,6 @@
|
|||||||
<argument
|
<argument
|
||||||
android:name="type"
|
android:name="type"
|
||||||
android:defaultValue="PLOCAL"
|
android:defaultValue="PLOCAL"
|
||||||
app:argType=".viewmodel.FeedsVM$Type" />
|
app:argType="app.fedilab.fedilabtube.viewmodel.FeedsVM$Type" />
|
||||||
</fragment>
|
</fragment>
|
||||||
|
|
||||||
|
|
||||||
</navigation>
|
</navigation>
|
@ -2,7 +2,6 @@
|
|||||||
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
|
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/mobile_navigation"
|
|
||||||
app:startDestination="@id/navigation_discover">
|
app:startDestination="@id/navigation_discover">
|
||||||
|
|
||||||
|
|
||||||
|
@ -2,5 +2,4 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<bool name="is_tablet">true</bool>
|
<bool name="is_tablet">true</bool>
|
||||||
<dimen name="video_comment_margin">150dp</dimen>
|
<dimen name="video_comment_margin">150dp</dimen>
|
||||||
<dimen name="margin_account">100dp</dimen>
|
|
||||||
</resources>
|
</resources>
|
@ -1,15 +1,9 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<!-- Default screen margins, per the Android Design guidelines. -->
|
<!-- Default screen margins, per the Android Design guidelines. -->
|
||||||
<dimen name="activity_horizontal_margin">16dp</dimen>
|
|
||||||
<dimen name="activity_vertical_margin">16dp</dimen>
|
|
||||||
<dimen name="fab_margin">5dp</dimen>
|
<dimen name="fab_margin">5dp</dimen>
|
||||||
<dimen name="fab_margin_button">16dp</dimen>
|
<dimen name="fab_margin_button">16dp</dimen>
|
||||||
<dimen name="drawer_padding">2dp</dimen>
|
|
||||||
<dimen name="layout_height_header">100dp</dimen>
|
|
||||||
<dimen name="fab_margin_floating">16dp</dimen>
|
<dimen name="fab_margin_floating">16dp</dimen>
|
||||||
<dimen name="video_padding">0dp</dimen>
|
|
||||||
<bool name="is_tablet">false</bool>
|
<bool name="is_tablet">false</bool>
|
||||||
<dimen name="video_comment_margin">0dp</dimen>
|
<dimen name="video_comment_margin">0dp</dimen>
|
||||||
<dimen name="popup_padding">20dp</dimen>
|
<dimen name="popup_padding">20dp</dimen>
|
||||||
<dimen name="margin_account">10dp</dimen>
|
|
||||||
</resources>
|
</resources>
|
@ -11,12 +11,6 @@
|
|||||||
|
|
||||||
|
|
||||||
<!-- Base application theme. -->
|
<!-- Base application theme. -->
|
||||||
<style name="AppThemeNoActionBar" parent="Theme.AppCompat.Light.NoActionBar">
|
|
||||||
<!-- Customize your theme here. -->
|
|
||||||
<item name="colorPrimary">@color/colorPrimary</item>
|
|
||||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
|
||||||
<item name="colorAccent">@color/colorAccent</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
|
|
||||||
</resources>
|
</resources>
|
Loading…
x
Reference in New Issue
Block a user