Merge branch 'master' into Login

This commit is contained in:
Stefan Schueller 2018-12-02 15:09:56 +01:00
commit bc8d0788be
5 changed files with 104 additions and 44 deletions

View File

@ -6,8 +6,8 @@ android {
applicationId "net.schueller.peertube" applicationId "net.schueller.peertube"
minSdkVersion 23 minSdkVersion 23
targetSdkVersion 28 targetSdkVersion 28
versionCode 103 versionCode 104
versionName "1.0.3" versionName "1.0.4"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
dependencies { dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar']) implementation fileTree(dir: 'libs', include: ['*.jar'])

View File

@ -64,44 +64,44 @@ public class VideoListActivity extends AppCompatActivity {
private BottomNavigationViewEx.OnNavigationItemSelectedListener mOnNavigationItemSelectedListener private BottomNavigationViewEx.OnNavigationItemSelectedListener mOnNavigationItemSelectedListener
= item -> { = item -> {
switch (item.getItemId()) { switch (item.getItemId()) {
case R.id.navigation_home: case R.id.navigation_home:
//Log.v(TAG, "navigation_home"); //Log.v(TAG, "navigation_home");
if (!isLoading) { if (!isLoading) {
sort = "-createdAt"; sort = "-createdAt";
currentStart = 0; currentStart = 0;
loadVideos(currentStart, count, sort, filter); loadVideos(currentStart, count, sort, filter);
}
return true;
case R.id.navigation_trending:
//Log.v(TAG, "navigation_trending");
if (!isLoading) {
sort = "-trending";
currentStart = 0;
loadVideos(currentStart, count, sort, filter);
}
return true;
case R.id.navigation_subscriptions:
//Log.v(TAG, "navigation_subscriptions");
Toast.makeText(VideoListActivity.this, "Subscriptions Not Implemented", Toast.LENGTH_SHORT).show();
return false;
case R.id.navigation_account:
//Log.v(TAG, "navigation_account");
Toast.makeText(VideoListActivity.this, "Account Not Implemented", Toast.LENGTH_SHORT).show();
Intent intent = new Intent(this, LoginActivity.class);
this.startActivity(intent);
return false;
} }
return true;
case R.id.navigation_trending:
//Log.v(TAG, "navigation_trending");
if (!isLoading) {
sort = "-trending";
currentStart = 0;
loadVideos(currentStart, count, sort, filter);
}
return true;
case R.id.navigation_subscriptions:
//Log.v(TAG, "navigation_subscriptions");
Toast.makeText(VideoListActivity.this, "Subscriptions Not Implemented", Toast.LENGTH_SHORT).show();
return false; return false;
};
case R.id.navigation_account:
//Log.v(TAG, "navigation_account");
Toast.makeText(VideoListActivity.this, "Account Not Implemented", Toast.LENGTH_SHORT).show();
// Intent intent = new Intent(this, LoginActivity.class);
// this.startActivity(intent);
return false;
}
return false;
};
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
@ -215,7 +215,7 @@ public class VideoListActivity extends AppCompatActivity {
if (dy > 0) { if (dy > 0) {
// is at end of list? // is at end of list?
if(!recyclerView.canScrollVertically(RecyclerView.FOCUS_DOWN)){ if (!recyclerView.canScrollVertically(RecyclerView.FOCUS_DOWN)) {
if (!isLoading) { if (!isLoading) {
currentStart = currentStart + count; currentStart = currentStart + count;
loadVideos(currentStart, count, sort, filter); loadVideos(currentStart, count, sort, filter);
@ -280,8 +280,8 @@ public class VideoListActivity extends AppCompatActivity {
/** /**
* Force android to not use SSLv3 * Force android to not use SSLv3
* * <p>
// * @param callingActivity Activity * // * @param callingActivity Activity
*/ */
// private void updateAndroidSecurityProvider(Activity callingActivity) { // private void updateAndroidSecurityProvider(Activity callingActivity) {
// try { // try {
@ -294,12 +294,13 @@ public class VideoListActivity extends AppCompatActivity {
// Log.e("SecurityException", "Google Play Services not available."); // Log.e("SecurityException", "Google Play Services not available.");
// } // }
// } // }
@Override @Override
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
// only check when we actually need the permission
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED &&
sharedPref.getBoolean("pref_torrent_player", false)) {
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 0); ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 0);
} }
} }

View File

@ -4,6 +4,7 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:keepScreenOn="true"
tools:context="net.schueller.peertube.activity.VideoPlayActivity"> tools:context="net.schueller.peertube.activity.VideoPlayActivity">
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"

View File

@ -0,0 +1,58 @@
<resources>
<string name="app_name">PeerTube</string>
<string name="title_activity_video_play">VideoPlayActivity</string>
<string name="title_activity_settings">Paramètres</string>
<string name="title_activity_login">Connexion</string>
<!-- Strings related to login -->
<string name="prompt_server">Serveur</string>
<string name="prompt_email">Email</string>
<string name="prompt_password">Mot de passe (optionnel)</string>
<string name="action_sign_in">Connexion</string>
<string name="action_sign_in_short">Connexion</string>
<string name="error_invalid_email">Cette adresse mail n\'est pas valide</string>
<string name="error_invalid_password">Ce mot de passe est trop court</string>
<string name="error_incorrect_password">Ce mot de passe est incorrect</string>
<string name="error_field_required">Ce champs est requis</string>
<string name="permission_rationale">"L\'autorisation sur les contacts est requise pour la complétion des adresses email."
</string>
<!-- Action bar -->
<string name="action_bar_title_search">Rechercher</string>
<string name="action_bar_title_settings">Paramètres</string>
<!-- Bottom navigation bar -->
<string name="bottom_nav_title_home">Accueil</string>
<string name="bottom_nav_title_trending">Tendances</string>
<string name="bottom_nav_title_subscriptions">Abonnements</string>
<string name="bottom_nav_title_account">Compte</string>
<!-- Strings related to Settings -->
<string name="peertube_required_server_version">1.0.0-alpha.7</string>
<string name="pref_default_api_base_url" formatted="false">https://troll.tv</string>
<string name="pref_title_peertube_server">PeerTube Server</string>
<!-- Strings related to Video meta data -->
<string name="meta_data_seperator">\u0020-\u0020</string>
<string name="meta_data_views">\u0020Views</string>
<string name="meta_data_owner_seperator">\@</string>
<string name="video_row_video_thumbnail">Miniature vidéo</string>
<string name="video_row_account_avatar">Avatar compte</string>
<string name="pref_title_show_nsfw">Afficher le contenu adulte</string>
<string name="pref_description_show_nsfw">Le contenu adulte sera affiché si activé</string>
<string name="title_activity_url_video_play">UrlVideoPlayActivity</string>
<string name="pref_title_torrent_player">Lecteur Vidéo Torrent</string>
<string name="pref_description_torrent_player">Lecture de vidéo via un flux torrent</string>
<string name="pref_title_license">Licence</string>
<string name="pref_description_license">\n<b>GNU Affero General Public License v3.0</b>\n\nPermissions of this strongest copyleft license are conditioned on making available complete source code of licensed works and modifications, which include larger works using a licensed work, under the same license. Copyright and license notices must be preserved. Contributors provide an express grant of patent rights. When a modified version is used to provide a service over a network, the complete source code of the modified version must be made available.</string>
<string name="pref_title_version">Version</string>
<string name="search_hint">Rechercher sur PeerTube</string>
<string name="title_activity_search">Rechercher</string>
</resources>

View File

@ -49,7 +49,7 @@
<string name="pref_description_show_nsfw">NSFW content will be shown if enabled.</string> <string name="pref_description_show_nsfw">NSFW content will be shown if enabled.</string>
<string name="title_activity_url_video_play">UrlVideoPlayActivity</string> <string name="title_activity_url_video_play">UrlVideoPlayActivity</string>
<string name="pref_title_torrent_player">Torrent Video Player</string> <string name="pref_title_torrent_player">Torrent Video Player</string>
<string name="pref_description_torrent_player">Videos playback via a torrent stream</string> <string name="pref_description_torrent_player">Video playback via a torrent stream. This requires Storage Permissions.</string>
<string name="pref_title_license">License</string> <string name="pref_title_license">License</string>
<string name="pref_description_license">\n<b>GNU Affero General Public License v3.0</b>\n\nPermissions of this strongest copyleft license are conditioned on making available complete source code of licensed works and modifications, which include larger works using a licensed work, under the same license. Copyright and license notices must be preserved. Contributors provide an express grant of patent rights. When a modified version is used to provide a service over a network, the complete source code of the modified version must be made available.</string> <string name="pref_description_license">\n<b>GNU Affero General Public License v3.0</b>\n\nPermissions of this strongest copyleft license are conditioned on making available complete source code of licensed works and modifications, which include larger works using a licensed work, under the same license. Copyright and license notices must be preserved. Contributors provide an express grant of patent rights. When a modified version is used to provide a service over a network, the complete source code of the modified version must be made available.</string>
<string name="pref_title_version">Version</string> <string name="pref_title_version">Version</string>