Merge branch 'develop' into Login

# Conflicts:
#	app/src/main/AndroidManifest.xml
#	app/src/main/java/net/schueller/peertube/activity/LoginActivity.java
#	app/src/main/java/net/schueller/peertube/activity/VideoListActivity.java
#	app/src/main/res/values/strings.xml
This commit is contained in:
Stefan Schueller 2018-12-26 20:19:21 +01:00
commit 8175956bc0
38 changed files with 1131 additions and 311 deletions

View File

@ -6,8 +6,9 @@
</h4>
<p align="center">
<img src="https://raw.githubusercontent.com/sschueller/peertube-android/develop/Screenshot2.jpg" alt="screenshot" />
<img src="https://raw.githubusercontent.com/sschueller/peertube-android/develop/Screenshot1.png" alt="screenshot" />
<img width="250" src="https://raw.githubusercontent.com/sschueller/peertube-android/develop/Screenshot_1545425516.png" alt="screenshot" />
<img width="250" src="https://raw.githubusercontent.com/sschueller/peertube-android/develop/Screenshot_1545425431.png" alt="screenshot" />
<img width="250" src="https://raw.githubusercontent.com/sschueller/peertube-android/develop/Screenshot_1545425504.png" alt="screenshot" />
</p>
## Download
@ -23,16 +24,19 @@ Beta Test on Google Play: https://play.google.com/store/apps/details?id=net.schu
- [X] Change Server
- [X] Search
- [X] App Icon and assets
- [X] Themes / Dark mode
- [X] Background playback
- [X] NSFW Filter option
## TODO
# TODO
- [ ] Video Playback via WebRTC
- [ ] Login
- [ ] Authentication / Login
- [ ] Like/dislike video
- [ ] Comment video
- [ ] Unit Tests
- [ ] Lots more missing at this point...

BIN
Screenshot_1545425431.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 843 KiB

BIN
Screenshot_1545425504.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 725 KiB

BIN
Screenshot_1545425516.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 585 KiB

View File

@ -6,26 +6,24 @@ android {
applicationId "net.schueller.peertube"
minSdkVersion 21
targetSdkVersion 28
versionCode 1010
versionName "1.0.10"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
versionCode 1015
versionName "1.0.15"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
// Layouts and design
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'androidx.legacy:legacy-support-v13:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.android.support:support-v13:28.0.0'
// font awesome
implementation 'com.blackboardtheory:android-iconify-fontawesome:3.0.1-SNAPSHOT'
// BottomNavigationViewEx -> https://github.com/ittianyu/BottomNavigationViewEx
implementation 'com.github.ittianyu:BottomNavigationViewEx:2.0.2'
implementation "com.mikepenz:iconics-core:3.1.0"
implementation 'com.mikepenz:fontawesome-typeface:5.3.1.1@aar'
// http client / REST
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
@ -49,12 +47,12 @@ android {
implementation 'com.google.android.exoplayer:exoplayer-ui:2.9.2'
implementation 'com.google.android.exoplayer:exoplayer-hls:2.9.2'
implementation 'com.google.android.exoplayer:exoplayer-smoothstreaming:2.9.2'
// implementation 'com.devbrackets.android:exomedia:4.1.0'
implementation 'com.google.android.exoplayer:extension-mediasession:2.9.2'
// testing
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}
}
buildTypes {

View File

@ -1,8 +1,8 @@
package net.schueller.peertube;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import androidx.test.InstrumentationRegistry;
import androidx.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;

View File

@ -19,33 +19,41 @@
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:ignore="GoogleAppIndexingWarning">
<activity
android:name=".activity.VideoListActivity"
<activity android:name=".activity.VideoListActivity"
android:theme="@style/AppTheme.NoActionBar"
android:launchMode="singleTop">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.SEARCH" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data
android:name="android.app.searchable"
android:resource="@xml/searchable"></meta-data>
android:resource="@xml/searchable">
</meta-data>
</activity>
<activity
android:name=".activity.LoginActivity"
android:theme="@style/AppTheme.NoActionBar"
android:label="@string/title_activity_login" />
<activity
android:name=".activity.VideoPlayActivity"
android:theme="@style/AppTheme.NoActionBar"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|screenLayout|smallestScreenSize|uiMode"
android:label="@string/title_activity_video_play"
android:launchMode="singleTop"
android:theme="@style/AppTheme" />
android:launchMode="singleTop" />
<activity
android:name=".activity.SettingsActivity"
android:theme="@style/AppTheme.NoActionBar"
android:label="@string/title_activity_settings" />
<activity android:name=".activity.SelectServerActivity"
android:theme="@style/AppTheme.NoActionBar"/>
<activity android:name=".activity.UserActivity"
android:theme="@style/AppTheme.NoActionBar"/>
<!-- Content provider for search suggestions -->
<provider
android:name=".provider.SearchSuggestionsProvider"
@ -53,11 +61,9 @@
android:enabled="true"
android:exported="false" />
<activity android:name=".activity.SelectServerActivity" />
<service android:name=".service.VideoPlayerService" />
<activity android:name=".activity.UserActivity"></activity>
</application>
</manifest>

View File

@ -3,11 +3,10 @@ package net.schueller.peertube.activity;
import android.content.res.Configuration;
import android.os.Bundle;
import android.preference.PreferenceActivity;
import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatDelegate;
import android.support.v7.widget.Toolbar;
import androidx.annotation.LayoutRes;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatDelegate;
import android.view.MenuInflater;
import android.view.View;
import android.view.ViewGroup;

View File

@ -21,6 +21,9 @@ import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import static net.schueller.peertube.helper.Constants.DEFAULT_THEME;
import static net.schueller.peertube.helper.Constants.THEME_PREF_KEY;
public class LoginActivity extends AppCompatActivity {
private String TAG = "LoginActivity";
@ -32,6 +35,15 @@ public class LoginActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Set theme
SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
setTheme(getResources().getIdentifier(
sharedPref.getString(THEME_PREF_KEY, DEFAULT_THEME),
"style",
getPackageName())
);
setContentView(R.layout.activity_login);
// bind button click

View File

@ -1,7 +1,7 @@
package net.schueller.peertube.activity;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import net.schueller.peertube.R;

View File

@ -3,11 +3,12 @@ package net.schueller.peertube.activity;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.os.Build;
import android.os.Bundle;
import android.preference.Preference;
import android.support.v7.app.ActionBar;
import androidx.appcompat.app.ActionBar;
import android.preference.PreferenceFragment;
import android.preference.PreferenceManager;
import android.util.Patterns;
@ -17,9 +18,13 @@ import android.widget.Toast;
import net.schueller.peertube.R;
import java.util.List;
import static net.schueller.peertube.helper.Constants.DEFAULT_THEME;
import static net.schueller.peertube.helper.Constants.THEME_PREF_KEY;
public class SettingsActivity extends AppCompatPreferenceActivity {
private static String previousThemeColorValue = "";
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
@ -30,6 +35,21 @@ public class SettingsActivity extends AppCompatPreferenceActivity {
return super.onOptionsItemSelected(item);
}
private static String getSelectedColor(Context context, String colorId){
String res = "Color not found";
String [ ] themeArray = context.getResources().getStringArray(R.array.themeValues);
String [ ] colorArray = context.getResources().getStringArray(R.array.themeArray);
for (int i = 0 ; i < themeArray.length ; i++){
if (themeArray[i].equals(colorId)){
res = colorArray[i];
break;
}
}
return res;
}
/**
* A preference value change listener that updates the preference's summary
* to reflect its new value.
@ -42,6 +62,19 @@ public class SettingsActivity extends AppCompatPreferenceActivity {
Toast.makeText(preference.getContext(), R.string.invalid_url, Toast.LENGTH_LONG).show();
return false;
}
// Check if Theme color has change & Provide selected color
else if (preference.getKey().equals("pref_theme")) {
stringValue = getSelectedColor(preference.getContext(), stringValue);
if (!previousThemeColorValue.equals("") && !previousThemeColorValue.equals(stringValue)) {
Toast.makeText(preference.getContext(), R.string.pref_description_app_theme, Toast.LENGTH_LONG).show();
}
previousThemeColorValue = stringValue;
preference.setSummary(stringValue);
return true;
}
preference.setSummary(stringValue);
@ -80,10 +113,19 @@ public class SettingsActivity extends AppCompatPreferenceActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
// Set theme
SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
setTheme(getResources().getIdentifier(
sharedPref.getString(THEME_PREF_KEY, DEFAULT_THEME),
"style",
getPackageName())
);
super.onCreate(savedInstanceState);
setupActionBar();
getFragmentManager().beginTransaction().replace(android.R.id.content, new GeneralPreferenceFragment()).commit();
}
/**
@ -140,6 +182,7 @@ public class SettingsActivity extends AppCompatPreferenceActivity {
// updated to reflect the new value, per the Android Design
// guidelines.
bindPreferenceSummaryToValue(findPreference("pref_api_base"));
bindPreferenceSummaryToValue(findPreference("pref_theme"));
}
@Override

View File

@ -8,17 +8,20 @@ import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.preference.PreferenceManager;
import android.provider.SearchRecentSuggestions;
import android.support.annotation.NonNull;
import android.support.design.bottomnavigation.LabelVisibilityMode;
import android.support.v4.app.ActivityCompat;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.app.AppCompatActivity;
import androidx.annotation.NonNull;
import com.google.android.material.bottomnavigation.BottomNavigationView;
import com.google.android.material.bottomnavigation.LabelVisibilityMode;
import androidx.core.app.ActivityCompat;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.SearchView;
import android.support.v7.widget.Toolbar;
import androidx.appcompat.app.AppCompatDelegate;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.appcompat.widget.SearchView;
import androidx.appcompat.widget.Toolbar;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
@ -26,17 +29,8 @@ import android.view.MenuItem;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
//import com.google.android.gms.common.GooglePlayServicesNotAvailableException;
//import com.google.android.gms.common.GooglePlayServicesRepairableException;
//import com.google.android.gms.common.GooglePlayServicesUtil;
//import com.google.android.gms.security.ProviderInstaller;
import com.ittianyu.bottomnavigationviewex.BottomNavigationViewEx;
import com.joanzapata.iconify.IconDrawable;
import com.joanzapata.iconify.Iconify;
import com.joanzapata.iconify.fonts.FontAwesomeIcons;
import com.joanzapata.iconify.fonts.FontAwesomeModule;
import com.mikepenz.fontawesome_typeface_library.FontAwesome;
import com.mikepenz.iconics.IconicsDrawable;
import net.schueller.peertube.R;
import net.schueller.peertube.adapter.VideoAdapter;
import net.schueller.peertube.helper.APIUrlHelper;
@ -44,6 +38,7 @@ import net.schueller.peertube.model.VideoList;
import net.schueller.peertube.network.GetVideoDataService;
import net.schueller.peertube.network.RetrofitInstance;
import net.schueller.peertube.provider.SearchSuggestionsProvider;
import net.schueller.peertube.service.VideoPlayerService;
import java.util.ArrayList;
@ -52,6 +47,9 @@ import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import static net.schueller.peertube.helper.Constants.DEFAULT_THEME;
import static net.schueller.peertube.helper.Constants.THEME_PREF_KEY;
public class VideoListActivity extends AppCompatActivity {
private String TAG = "VideoListActivity";
@ -72,85 +70,35 @@ public class VideoListActivity extends AppCompatActivity {
private boolean isLoading = false;
private BottomNavigationViewEx.OnNavigationItemSelectedListener mOnNavigationItemSelectedListener
= item -> {
switch (item.getItemId()) {
case R.id.navigation_home:
//Log.v(TAG, "navigation_home");
if (!isLoading) {
sort = "-createdAt";
currentStart = 0;
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, UserActivity.class);
this.startActivity(intent);
return false;
}
return false;
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Set Night Mode
SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
AppCompatDelegate.setDefaultNightMode(sharedPref.getBoolean("pref_dark_mode", false) ?
AppCompatDelegate.MODE_NIGHT_YES : AppCompatDelegate.MODE_NIGHT_NO);
// Set theme
setTheme(getResources().getIdentifier(
sharedPref.getString(THEME_PREF_KEY, DEFAULT_THEME),
"style",
getPackageName())
);
setContentView(R.layout.activity_video_list);
filter = "";
// Init icons
Iconify.with(new FontAwesomeModule());
createBottomBarNavigation();
// Attaching the layout to the toolbar object
Toolbar toolbar = findViewById(R.id.tool_bar);
// Setting toolbar as the ActionBar with setSupportActionBar() call
setSupportActionBar(toolbar);
// fix android trying to use SSLv3 for handshake
// updateAndroidSecurityProvider(this);
// Bottom Navigation
BottomNavigationViewEx navigation = findViewById(R.id.navigation);
navigation.enableAnimation(false);
navigation.setLabelVisibilityMode(LabelVisibilityMode.LABEL_VISIBILITY_LABELED); // enableShiftingMode
navigation.setItemHorizontalTranslationEnabled(false); // enableItemShiftingMode
Menu navMenu = navigation.getMenu();
navMenu.findItem(R.id.navigation_home).setIcon(
new IconDrawable(this, FontAwesomeIcons.fa_home));
navMenu.findItem(R.id.navigation_trending).setIcon(
new IconDrawable(this, FontAwesomeIcons.fa_fire));
navMenu.findItem(R.id.navigation_subscriptions).setIcon(
new IconDrawable(this, FontAwesomeIcons.fa_folder));
navMenu.findItem(R.id.navigation_account).setIcon(
new IconDrawable(this, FontAwesomeIcons.fa_user_circle));
navigation.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener);
// load Video List
createList();
@ -163,16 +111,12 @@ public class VideoListActivity extends AppCompatActivity {
// Set an icon in the ActionBar
menu.findItem(R.id.action_settings).setIcon(
new IconDrawable(this, FontAwesomeIcons.fa_cog)
.colorRes(R.color.cardview_light_background)
.actionBarSize());
new IconicsDrawable(this, FontAwesome.Icon.faw_cog).actionBar());
MenuItem searchMenuItem = menu.findItem(R.id.action_search);
searchMenuItem.setIcon(
new IconDrawable(this, FontAwesomeIcons.fa_search)
.colorRes(R.color.cardview_light_background)
.actionBarSize());
new IconicsDrawable(this, FontAwesome.Icon.faw_search).actionBar());
// Get the SearchView and set the searchable configuration
SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
@ -208,6 +152,11 @@ public class VideoListActivity extends AppCompatActivity {
return true;
}
@Override
protected void onDestroy() {
super.onDestroy();
stopService(new Intent(this, VideoPlayerService.class));
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
@ -338,22 +287,7 @@ public class VideoListActivity extends AppCompatActivity {
});
}
/**
* Force android to not use SSLv3
* <p>
* // * @param callingActivity Activity
*/
// private void updateAndroidSecurityProvider(Activity callingActivity) {
// try {
// ProviderInstaller.installIfNeeded(this);
// } catch (GooglePlayServicesRepairableException e) {
// // Thrown when Google Play Services is not installed, up-to-date, or enabled
// // Show dialog to allow users to install, update, or otherwise enable Google Play services.
// GooglePlayServicesUtil.getErrorDialog(e.getConnectionStatusCode(), callingActivity, 0);
// } catch (GooglePlayServicesNotAvailableException e) {
// Log.e("SecurityException", "Google Play Services not available.");
// }
// }
@Override
protected void onResume() {
super.onResume();
@ -397,4 +331,66 @@ public class VideoListActivity extends AppCompatActivity {
}
private void createBottomBarNavigation() {
// Get Bottom Navigation
BottomNavigationView navigation = findViewById(R.id.navigation);
// Always show text label
navigation.setLabelVisibilityMode(LabelVisibilityMode.LABEL_VISIBILITY_LABELED);
// Add Icon font
Menu navMenu = navigation.getMenu();
navMenu.findItem(R.id.navigation_home).setIcon(
new IconicsDrawable(this, FontAwesome.Icon.faw_home));
navMenu.findItem(R.id.navigation_trending).setIcon(
new IconicsDrawable(this, FontAwesome.Icon.faw_fire));
navMenu.findItem(R.id.navigation_subscriptions).setIcon(
new IconicsDrawable(this, FontAwesome.Icon.faw_folder));
navMenu.findItem(R.id.navigation_account).setIcon(
new IconicsDrawable(this, FontAwesome.Icon.faw_user_circle));
// Click Listener
navigation.setOnNavigationItemSelectedListener(menuItem -> {
switch (menuItem.getItemId()) {
case R.id.navigation_home:
//Log.v(TAG, "navigation_home");
if (!isLoading) {
sort = "-createdAt";
currentStart = 0;
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 false;
});
}
}

View File

@ -12,14 +12,15 @@ import android.os.Bundle;
import android.os.Environment;
import android.os.IBinder;
import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.PopupMenu;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.PopupMenu;
import android.util.Log;
import android.view.Surface;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.ProgressBar;
@ -39,6 +40,7 @@ import com.google.android.exoplayer2.util.Util;
import com.google.android.exoplayer2.video.VideoRendererEventListener;
import com.squareup.picasso.Picasso;
import net.schueller.peertube.R;
import net.schueller.peertube.fragment.VideoOptionsFragment;
import net.schueller.peertube.helper.APIUrlHelper;
import net.schueller.peertube.helper.MetaDataHelper;
import net.schueller.peertube.intents.Intents;
@ -51,6 +53,9 @@ import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import static net.schueller.peertube.helper.Constants.DEFAULT_THEME;
import static net.schueller.peertube.helper.Constants.THEME_PREF_KEY;
public class VideoPlayActivity extends AppCompatActivity implements VideoRendererEventListener {
private static final String TAG = "VideoPlayActivity";
@ -89,6 +94,15 @@ public class VideoPlayActivity extends AppCompatActivity implements VideoRendere
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Set theme
SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
setTheme(getResources().getIdentifier(
sharedPref.getString(THEME_PREF_KEY, DEFAULT_THEME),
"style",
getPackageName())
);
setContentView(R.layout.activity_video_play);
progressBar = findViewById(R.id.progress);
@ -229,6 +243,8 @@ public class VideoPlayActivity extends AppCompatActivity implements VideoRendere
TextView videoMeta = findViewById(R.id.videoMeta);
ImageView avatarView = findViewById(R.id.avatar);
ImageButton moreButton = findViewById(R.id.moreButton);
ImageButton videoOptions = findViewById(R.id.exo_more);
Video video = response.body();
@ -275,8 +291,18 @@ public class VideoPlayActivity extends AppCompatActivity implements VideoRendere
popup.show();
});
// video player options
videoOptions.setOnClickListener(v -> {
VideoOptionsFragment videoOptionsFragment =
VideoOptionsFragment.newInstance(mService);
videoOptionsFragment.show(getSupportFragmentManager(),
"video_options_fragment");
});
mService.setCurrentStreamUrl(video.getFiles().get(0).getFileUrl());
SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
if (sharedPref.getBoolean("pref_torrent_player", false)) {

View File

@ -2,9 +2,9 @@ package net.schueller.peertube.adapter;
import android.content.Context;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.v7.widget.PopupMenu;
import android.support.v7.widget.RecyclerView;
import androidx.annotation.NonNull;
import androidx.appcompat.widget.PopupMenu;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

View File

@ -0,0 +1,78 @@
package net.schueller.peertube.fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
import com.mikepenz.iconics.Iconics;
import net.schueller.peertube.R;
import net.schueller.peertube.service.VideoPlayerService;
import androidx.annotation.Nullable;
public class VideoOptionsFragment extends BottomSheetDialogFragment {
private static VideoPlayerService videoPlayerService;
private TextView speed05Icon;
private TextView speed10Icon;
private TextView speed15Icon;
private TextView speed20Icon;
public static VideoOptionsFragment newInstance(VideoPlayerService mService) {
videoPlayerService = mService;
return new VideoOptionsFragment();
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater,
@Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.bottom_sheet_video_options_fragment, container,
false);
// Icons
speed05Icon = view.findViewById(R.id.video_speed05_icon);
speed10Icon = view.findViewById(R.id.video_speed10_icon);
speed15Icon = view.findViewById(R.id.video_speed15_icon);
speed20Icon = view.findViewById(R.id.video_speed20_icon);
// Buttons
TextView speed05 = view.findViewById(R.id.video_speed05);
TextView speed10 = view.findViewById(R.id.video_speed10);
TextView speed15 = view.findViewById(R.id.video_speed15);
TextView speed20 = view.findViewById(R.id.video_speed20);
// Default
setVideoSpeed(1.0f, speed10Icon);
// Attach the listener
speed05.setOnClickListener(v -> setVideoSpeed(0.5f, speed05Icon));
speed10.setOnClickListener(v -> setVideoSpeed(1.0f, speed10Icon));
speed15.setOnClickListener(v -> setVideoSpeed(1.5f, speed15Icon));
speed20.setOnClickListener(v -> setVideoSpeed(2.0f, speed20Icon));
return view;
}
private void setVideoSpeed(Float speed, TextView icon) {
speed05Icon.setText("");
speed10Icon.setText("");
speed15Icon.setText("");
speed20Icon.setText("");
videoPlayerService.setPlayBackSpeed(speed);
icon.setText(R.string.video_speed_active_icon);
new Iconics.IconicsBuilder().ctx(getContext()).on(icon).build();
}
}

View File

@ -0,0 +1,6 @@
package net.schueller.peertube.helper;
public class Constants {
public static final String THEME_PREF_KEY = "pref_theme";
public static final String DEFAULT_THEME = "AppTheme.ORANGE";
}

View File

@ -1,8 +1,21 @@
package net.schueller.peertube.model;
import android.content.Context;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.media.MediaDescriptionCompat;
import com.squareup.picasso.Picasso;
import net.schueller.peertube.R;
import net.schueller.peertube.helper.APIUrlHelper;
import java.util.ArrayList;
import java.util.Date;
import androidx.annotation.DrawableRes;
public class Video {
private Integer id;
@ -247,4 +260,31 @@ public class Video {
public void setFiles(ArrayList<File> files) {
this.files = files;
}
public static MediaDescriptionCompat getMediaDescription(Context context, Video video) {
// String apiBaseURL = APIUrlHelper.getUrlWithVersion(context);
// Bundle extras = new Bundle();
// Bitmap bitmap = getBitmap(context, Uri.parse(apiBaseURL + video.thumbnailPath));
// extras.putParcelable(MediaDescriptionCompat.DESCRIPTION_KEY_MEDIA_URI, bitmap);
return new MediaDescriptionCompat.Builder()
.setMediaId(video.getUuid())
// .setIconBitmap(bitmap)
// .setExtras(extras)
.setTitle(video.getName())
.setDescription(video.getDescription())
.build();
}
// TODO: add support for the thumbnail
// public static Bitmap getBitmap(Context context, Uri fullThumbnailUrl) {
//
// return Picasso.with(context).load(fullThumbnailUrl)
// .placeholder(R.drawable.ic_peertube)
// .error(R.drawable.ic_peertube).get();
// }
}

View File

@ -11,13 +11,22 @@ import android.graphics.Bitmap;
import android.media.AudioManager;
import android.net.Uri;
import android.os.Binder;
import android.os.Bundle;
import android.os.IBinder;
import android.support.annotation.Nullable;
import androidx.annotation.Nullable;
import android.support.v4.media.MediaDescriptionCompat;
import android.support.v4.media.session.MediaSessionCompat;
import android.util.Log;
import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.ExoPlayerFactory;
import com.google.android.exoplayer2.PlaybackParameters;
import com.google.android.exoplayer2.Player;
import com.google.android.exoplayer2.SimpleExoPlayer;
import com.google.android.exoplayer2.audio.AudioAttributes;
import com.google.android.exoplayer2.ext.mediasession.MediaSessionConnector;
import com.google.android.exoplayer2.ext.mediasession.TimelineQueueNavigator;
import com.google.android.exoplayer2.source.ExtractorMediaSource;
import com.google.android.exoplayer2.trackselection.DefaultTrackSelector;
import com.google.android.exoplayer2.ui.PlayerNotificationManager;
@ -36,6 +45,9 @@ import static net.schueller.peertube.activity.VideoListActivity.EXTRA_VIDEOID;
public class VideoPlayerService extends Service {
private static final String TAG = "VideoPlayerService";
private static final String MEDIA_SESSION_TAG = "peertube_player";
private final IBinder mBinder = new LocalBinder();
private static final String PLAYBACK_CHANNEL_ID = "playback_channel";
@ -63,12 +75,12 @@ public class VideoPlayerService extends Service {
public void onPlayerStateChanged(boolean playWhenReady, int playbackState) {
if (playbackState == ACTION_PAUSE) { // this means that pause is available, hence the audio is playing
Log.v("VideoPlayerService", "ACTION_PLAY: " + playbackState);
Log.v(TAG, "ACTION_PLAY: " + playbackState);
registerReceiver(myNoisyAudioStreamReceiver, becomeNoisyIntentFilter);
}
if (playbackState == ACTION_PLAY) { // this means that play is available, hence the audio is paused or stopped
Log.v("VideoPlayerService", "ACTION_PAUSE: " + playbackState);
Log.v(TAG, "ACTION_PAUSE: " + playbackState);
unregisterReceiver(myNoisyAudioStreamReceiver);
}
}
@ -88,7 +100,7 @@ public class VideoPlayerService extends Service {
@Override
public void onDestroy() {
Log.v("VideoPlayerService", "onDestroy...");
Log.v(TAG, "onDestroy...");
playerNotificationManager.setPlayer(null);
player.release();
@ -105,7 +117,7 @@ public class VideoPlayerService extends Service {
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
Log.v("VideoPlayerService", "onStartCommand...");
Log.v(TAG, "onStartCommand...");
playVideo();
return START_STICKY;
}
@ -113,21 +125,27 @@ public class VideoPlayerService extends Service {
public void setCurrentVideo(Video video)
{
Log.v("VideoPlayerService", "setCurrentVideo...");
Log.v(TAG, "setCurrentVideo...");
currentVideo = video;
}
public void setCurrentStreamUrl(String streamUrl)
{
Log.v("VideoPlayerService", "setCurrentStreamUrl...");
Log.v(TAG, "setCurrentStreamUrl...");
currentStreamUrl = streamUrl;
}
public void playVideo()
{
//Playback speed control
public void setPlayBackSpeed(float speed) {
Log.v(TAG, "setPlayBackSpeed...");
player.setPlaybackParameters(new PlaybackParameters(speed));
}
public void playVideo() {
Context context = this;
Log.v("VideoPlayerService", "playVideo...");
Log.v(TAG, "playVideo...");
// Produces DataSource instances through which media data is loaded.
DataSource.Factory dataSourceFactory = new DefaultDataSourceFactory(getApplicationContext(),
@ -143,6 +161,9 @@ public class VideoPlayerService extends Service {
// Auto play
player.setPlayWhenReady(true);
//reset playback speed
this.setPlayBackSpeed(1.0f);
playerNotificationManager = PlayerNotificationManager.createWithNotificationChannel(
context, PLAYBACK_CHANNEL_ID, R.string.playback_channel_name,
PLAYBACK_NOTIFICATION_ID,
@ -193,7 +214,7 @@ public class VideoPlayerService extends Service {
@Override
public void onNotificationCancelled(int notificationId) {
Log.v("VideoPlayerService", "onNotificationCancelled...");
Log.v(TAG, "onNotificationCancelled...");
// TODO: only kill the notification if we no longer have a bound activity
stopForeground(true);
@ -203,6 +224,26 @@ public class VideoPlayerService extends Service {
playerNotificationManager.setPlayer(player);
// external Media control, Android Wear / Google Home etc.
MediaSessionCompat mediaSession = new MediaSessionCompat(context, MEDIA_SESSION_TAG);
mediaSession.setActive(true);
playerNotificationManager.setMediaSessionToken(mediaSession.getSessionToken());
MediaSessionConnector mediaSessionConnector = new MediaSessionConnector(mediaSession);
mediaSessionConnector.setQueueNavigator(new TimelineQueueNavigator(mediaSession) {
@Override
public MediaDescriptionCompat getMediaDescription(Player player, int windowIndex) {
return Video.getMediaDescription(context, currentVideo);
}
});
mediaSessionConnector.setPlayer(player, null);
// Audio Focus
AudioAttributes audioAttributes = new AudioAttributes.Builder()
.setUsage(C.USAGE_MEDIA)
.setContentType(C.CONTENT_TYPE_MOVIE)
.build();
player.setAudioAttributes(audioAttributes,true);
}
// pause playback on audio output change
@ -215,4 +256,5 @@ public class VideoPlayerService extends Service {
}
}
}

View File

@ -1,21 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:color="@color/colorAccent"
android:state_checked="true"
android:state_pressed="true"
android:state_focused="true"
android:state_selected="true"
android:state_checkable="true"
android:state_enabled="true"
/>
<item
android:color="@color/viewBg"
android:state_checked="false"
android:state_pressed="false"
android:state_focused="false"
android:state_selected="false"
android:state_checkable="false"
android:state_enabled="false"
/>
</selector>

View File

@ -30,7 +30,7 @@
android:layout_height="wrap_content"
android:orientation="vertical">
<android.support.design.widget.TextInputLayout
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
@ -43,9 +43,9 @@
android:maxLines="1"
android:singleLine="true" />
</android.support.design.widget.TextInputLayout>
</com.google.android.material.textfield.TextInputLayout>
<android.support.design.widget.TextInputLayout
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
@ -61,7 +61,7 @@
android:maxLines="1"
android:singleLine="true" />
</android.support.design.widget.TextInputLayout>
</com.google.android.material.textfield.TextInputLayout>
<Button
android:id="@+id/email_sign_in_button"

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout 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:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activity.SelectServerActivity">
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,22 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.coordinatorlayout.widget.CoordinatorLayout 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:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="net.schueller.peertube.activity.VideoListActivity">
<android.support.design.widget.AppBarLayout
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<include
android:orientation="vertical">
<androidx.appcompat.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/tool_bar"
layout="@layout/tool_bar" />
</android.support.design.widget.AppBarLayout>
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_scrollFlags="scroll|enterAlways"
android:elevation="4dp" />
</com.google.android.material.appbar.AppBarLayout>
<TextView
android:id="@+id/empty_view"
@ -24,10 +28,9 @@
android:layout_height="match_parent"
android:gravity="center"
android:visibility="gone"
android:textColor="@color/black"
android:text="@string/no_data_available" />
<android.support.v4.widget.SwipeRefreshLayout
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/swipeRefreshLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
@ -36,19 +39,19 @@
android:layout_weight="1"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<android.support.v7.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
</android.support.v7.widget.RecyclerView>
</androidx.recyclerview.widget.RecyclerView>
</android.support.v4.widget.SwipeRefreshLayout>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
<com.ittianyu.bottomnavigationviewex.BottomNavigationViewEx
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/navigation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -59,8 +62,7 @@
app:layout_constraintRight_toRightOf="parent"
android:layout_gravity="bottom"
app:menu="@menu/menu_bottom"
app:itemIconTint="@color/bottom_bar"
android:background="?android:attr/windowBackground"
/>
</android.support.design.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.coordinatorlayout.widget.CoordinatorLayout 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:layout_width="match_parent"
@ -17,7 +17,7 @@
android:id="@+id/video_view"
android:layout_width="match_parent"
android:layout_height="250dp"
android:background="@color/black"
android:background="@color/videoBackgroundColor"
app:layout_constraintDimensionRatio="H,3:1"
app:layout_constraintEnd_toEndOf="parent"
@ -30,7 +30,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/video_view"
android:background="@color/black"
android:indeterminate="false"
android:max="100" />
@ -110,9 +109,10 @@
android:layout_marginEnd="12dp"
android:textAppearance="@style/Base.TextAppearance.AppCompat.Body1" />
</RelativeLayout>
</RelativeLayout>
</android.support.design.widget.CoordinatorLayout>
</RelativeLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -0,0 +1,127 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:background="@color/videoBackgroundColor"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/video_speed05_icon"
android:layout_width="32dp"
android:layout_height="56dp"
android:layout_marginStart="16dp"
android:gravity="center|start"
android:textAllCaps="false"
android:textColor="#ffffff"
android:textSize="12sp" />
<TextView
android:id="@+id/video_speed05"
android:layout_width="match_parent"
android:layout_height="56dp"
android:layout_marginStart="8dp"
android:layout_marginEnd="16dp"
android:gravity="center|start"
android:text="@string/video_speed_05"
android:textAllCaps="false"
android:textColor="#ffffff"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/video_speed10_icon"
android:layout_width="32dp"
android:layout_height="56dp"
android:layout_marginStart="16dp"
android:gravity="center|start"
android:textAllCaps="false"
android:textColor="#ffffff"
android:textSize="12sp" />
<TextView
android:id="@+id/video_speed10"
android:layout_width="match_parent"
android:layout_height="56dp"
android:layout_marginStart="8dp"
android:layout_marginEnd="16dp"
android:gravity="center|start"
android:text="@string/video_speed_10"
android:textAllCaps="false"
android:textColor="#ffffff"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/video_speed15_icon"
android:layout_width="32dp"
android:layout_height="56dp"
android:layout_marginStart="16dp"
android:gravity="center|start"
android:textAllCaps="false"
android:textColor="#ffffff"
android:textSize="12sp" />
<TextView
android:id="@+id/video_speed15"
android:layout_width="match_parent"
android:layout_height="56dp"
android:layout_marginStart="8dp"
android:layout_marginEnd="16dp"
android:gravity="center|start"
android:text="@string/video_speed_15"
android:textAllCaps="false"
android:textColor="#ffffff"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/video_speed20_icon"
android:layout_width="32dp"
android:layout_height="56dp"
android:layout_marginStart="16dp"
android:gravity="center|start"
android:textAllCaps="false"
android:textColor="#ffffff"
android:textSize="12sp" />
<TextView
android:id="@+id/video_speed20"
android:layout_width="match_parent"
android:layout_height="56dp"
android:layout_marginStart="8dp"
android:layout_marginEnd="16dp"
android:gravity="center|start"
android:text="@string/video_speed_20"
android:textAllCaps="false"
android:textColor="#ffffff"
android:textSize="16sp" />
</LinearLayout>
</LinearLayout>

View File

@ -2,13 +2,44 @@
<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:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_gravity="center"
android:layoutDirection="ltr"
android:background="#CC000000"
android:orientation="vertical"
tools:targetApi="28">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="0dp"
android:gravity="bottom"
android:orientation="horizontal">
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1" />
<ImageButton android:src="@drawable/ic_action_more_vert"
android:id="@+id/exo_more"
android:tint="#ffffff"
android:background="@null"
android:paddingTop="0dp"
android:layout_width="wrap_content"
android:layout_height="48dp"
/>
</LinearLayout>
<View
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -19,9 +50,6 @@
<ImageButton android:id="@id/exo_rew"
style="@style/ExoMediaButton.Rewind"/>
<ImageButton android:id="@id/exo_shuffle"
style="@style/ExoMediaButton.Shuffle"/>
<ImageButton android:id="@id/exo_repeat_toggle"
style="@style/ExoMediaButton"/>
@ -36,11 +64,18 @@
</LinearLayout>
<View
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:gravity="center_vertical"
android:gravity="bottom"
android:orientation="horizontal">
<TextView android:id="@id/exo_position"
@ -48,27 +83,43 @@
android:layout_height="wrap_content"
android:textSize="14sp"
android:textStyle="bold"
android:paddingLeft="4dp"
android:paddingRight="4dp"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:includeFontPadding="false"
android:textColor="#FFBEBEBE"/>
<com.google.android.exoplayer2.ui.DefaultTimeBar
android:id="@id/exo_progress"
<View
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="26dp"/>
android:layout_height="0dp"
android:layout_weight="1" />
<TextView android:id="@id/exo_duration"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:textStyle="bold"
android:paddingLeft="4dp"
android:paddingRight="4dp"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:includeFontPadding="false"
android:textColor="#FFBEBEBE"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:gravity="bottom"
android:orientation="horizontal">
<com.google.android.exoplayer2.ui.DefaultTimeBar
android:id="@id/exo_progress"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="26dp"
app:played_color="?attr/colorPrimary"/>
</LinearLayout>
</LinearLayout>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?><!-- START*** Root Container *** -->
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -89,4 +89,4 @@
</RelativeLayout>
</android.support.v7.widget.CardView>
</androidx.cardview.widget.CardView>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@color/colorPrimary"
app:layout_scrollFlags="scroll|enterAlways"
android:elevation="4dp" />

View File

@ -1,45 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Unused? delete? -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<!--<android.support.v7.widget.CardView-->
<!--android:layout_margin="16dp"-->
<!--android:layout_width="220dp"-->
<!--android:layout_gravity="center"-->
<!--android:layout_height="wrap_content">-->
<!--<LinearLayout-->
<!--android:id="@+id/linearLayout"-->
<!--android:padding="8dp"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content"-->
<!--android:orientation="vertical">-->
<!--<ImageView-->
<!--android:id="@+id/thumb"-->
<!--android:layout_margin="5dp"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content" />-->
<!--<TextView-->
<!--android:id="@+id/name"-->
<!--android:layout_margin="5dp"-->
<!--android:gravity="center"-->
<!--android:textAppearance="@style/Base.TextAppearance.AppCompat.Large"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content"-->
<!--android:text="username"/>-->
<!--<TextView-->
<!--android:id="@+id/description"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content"-->
<!--/>-->
<!--</LinearLayout>-->
<!--</android.support.v7.widget.CardView>-->
</LinearLayout>

View File

@ -9,7 +9,7 @@
android:orderInCategory="300"
android:title="@string/action_bar_title_search"
app:showAsAction="always|collapseActionView"
app:actionViewClass="android.support.v7.widget.SearchView" />
app:actionViewClass="androidx.appcompat.widget.SearchView" />
<item
android:id="@+id/action_settings"

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/menu_video_playback_speed"
android:icon="@drawable/ic_action_share"
android:title="@string/menu_share" />
</menu>

View File

@ -32,7 +32,7 @@
<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>
<string name="pref_title_peertube_server">Serveur Peertube</string>
<!-- Strings related to Video meta data -->
@ -54,5 +54,33 @@
<string name="pref_title_version">Version</string>
<string name="search_hint">Rechercher sur PeerTube</string>
<string name="title_activity_search">Rechercher</string>
<string name="no_data_available">Pas de résultat</string>
<string name="descr_overflow_button">Plus</string>
<string name="menu_share">Partager</string>
<string name="playback_channel_name">PeerTube</string>
<string name="invalid_url">URL invalide !</string>
<string name="pref_title_dark_mode">Mode Sombre</string>
<string name="pref_description_dark_mode">Relancez l\'application pour que le Mode Sombre soit activé</string>
<string name="pref_title_app_theme">Thème de l\'Application</string>
<string name="pref_description_app_theme">Relancez l\'application pour que le nouveau thème soit activé</string>
<string name="red">Rouge</string>
<string name="pink">Rose</string>
<string name="purple">Violet</string>
<string name="deeppurple">Violet Foncé</string>
<string name="indigo">Indigo</string>
<string name="blue">Bleu</string>
<string name="lightblue">Bleu Clair</string>
<string name="cyan">Cyan</string>
<string name="teal">Turquoise</string>
<string name="green">Vert</string>
<string name="lightgreen">Vert Clair</string>
<string name="lime">Citron Vert</string>
<string name="yellow">Jaune</string>
<string name="amber">Ambre</string>
<string name="orange">Orange</string>
<string name="deeporange">Orange Foncé</string>
<string name="brown">Brun</string>
<string name="gray">Gris</string>
<string name="bluegray">Bleu-Gris</string>
</resources>

View File

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="themeArray">
<item>@string/red</item>
<item>@string/pink</item>
<item>@string/purple</item>
<item>@string/deeppurple</item>
<item>@string/indigo</item>
<item>@string/blue</item>
<item>@string/lightblue</item>
<item>@string/cyan</item>
<item>@string/teal</item>
<item>@string/green</item>
<item>@string/lightgreen</item>
<item>@string/lime</item>
<item>@string/yellow</item>
<item>@string/amber</item>
<item>@string/orange</item>
<item>@string/deeporange</item>
<item>@string/brown</item>
<item>@string/gray</item>
<item>@string/bluegray</item>
</string-array>
<string-array name="themeValues">
<item>AppTheme.RED</item>
<item>AppTheme.PINK</item>
<item>AppTheme.PURPLE</item>
<item>AppTheme.DEEPPURPLE</item>
<item>AppTheme.INDIGO</item>
<item>AppTheme.BLUE</item>
<item>AppTheme.LIGHTBLUE</item>
<item>AppTheme.CYAN</item>
<item>AppTheme.TEAL</item>
<item>AppTheme.GREEN</item>
<item>AppTheme.LIGHTGREEN</item>
<item>AppTheme.LIME</item>
<item>AppTheme.YELLOW</item>
<item>AppTheme.AMBER</item>
<item>AppTheme.ORANGE</item>
<item>AppTheme.DEEPORANGE</item>
<item>AppTheme.BROWN</item>
<item>AppTheme.GRAY</item>
<item>AppTheme.BLUEGRAY</item>
</string-array>
</resources>

View File

@ -1,12 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Declare custom theme attributes that allow changing which styles are
used for button bars depending on the API level.
?android:attr/buttonBarStyle is new as of API 11 so this is
necessary to support previous API levels. -->
<declare-styleable name="ButtonBarContainerTheme">
<attr name="metaButtonBarStyle" format="reference" />
<attr name="metaButtonBarButtonStyle" format="reference" />
</declare-styleable>
<attr name="metaButtonBarStyle" format="reference" />
<attr name="metaButtonBarButtonStyle" format="reference" />
</resources>

View File

@ -1,11 +1,202 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#f1680d</color>
<color name="colorPrimaryDark">#E64A19</color>
<color name="colorAccent">#FF4081</color>
<color name="viewBg">#f1f5f8</color>
<color name="album_title">#4c4c4c</color>
<color name="black_overlay">#66000000</color>
<color name="black">#000000</color>
<color name="themeDeselected">#d69b9b9b</color>
<color name="themeSelected">#e300aaff</color>
<color name="seperator">#7ca6a6a6</color>
<color name="videoBackgroundColor">#000000</color>
<!-- RED Theme -->
<color name="primaryColorRed">#F44336</color>
<color name="primaryLightColorRed">#FFCDD2</color>
<color name="primaryDarkColorRed">#D32F2F</color>
<color name="secondaryColorRed">#FFC107</color>
<color name="secondaryLightColorRed">#fccf4a</color>
<color name="secondaryDarkColorRed">#e1a902</color>
<color name="primaryTextColorRed">#ffffff</color>
<color name="secondaryTextColorRed">#000000</color>
<!-- PINK Theme -->
<color name="primaryColorPink">#E91E63</color>
<color name="primaryLightColorPink">#F8BBD0</color>
<color name="primaryDarkColorPink">#C2185B</color>
<color name="secondaryColorPink">#448AFF</color>
<color name="secondaryLightColorPink">#89b3f8</color>
<color name="secondaryDarkColorPink">#1a62da</color>
<color name="primaryTextColorPink">#000000</color>
<color name="secondaryTextColorPink">#000000</color>
<!-- PURPLE Theme -->
<color name="primaryColorPurple">#9C27B0</color>
<color name="primaryLightColorPurple">#E1BEE7</color>
<color name="primaryDarkColorPurple">#7B1FA2</color>
<color name="secondaryColorPurple">#CDDC39</color>
<color name="secondaryLightColorPurple">#e1ea86</color>
<color name="secondaryDarkColorPurple">#b4c320</color>
<color name="primaryTextColorPurple">#ffffff</color>
<color name="secondaryTextColorPurple">#000000</color>
<!-- DEEPPURPLE Theme -->
<color name="primaryColorDeepPurple">#673AB7</color>
<color name="primaryLightColorDeepPurple">#D1C4E9</color>
<color name="primaryDarkColorDeepPurple">#512DA8</color>
<color name="secondaryColorDeepPurple">#FFEB3B</color>
<color name="secondaryLightColorDeepPurple">#fff599</color>
<color name="secondaryDarkColorDeepPurple">#e0cd24</color>
<color name="primaryTextColorDeepPurple">#ffffff</color>
<color name="secondaryTextColorDeepPurple">#000000</color>
<!-- INDIGO Theme -->
<color name="primaryColorIndigo">#3F51B5</color>
<color name="primaryLightColorIndigo">#C5CAE9</color>
<color name="primaryDarkColorIndigo">#303F9F</color>
<color name="secondaryColorIndigo">#FF9800</color>
<color name="secondaryLightColorIndigo">#feba56</color>
<color name="secondaryDarkColorIndigo">#cf7b00</color>
<color name="primaryTextColorIndigo">#ffffff</color>
<color name="secondaryTextColorIndigo">#000000</color>
<!-- BLUE Theme -->
<color name="primaryColorBlue">#1e88e5</color>
<color name="primaryLightColorBlue">#6ab7ff</color>
<color name="primaryDarkColorBlue">#005cb2</color>
<color name="secondaryColorBlue">#607D8B</color>
<color name="secondaryLightColorBlue">#CFD8DC</color>
<color name="secondaryDarkColorBlue">#455A64</color>
<color name="primaryTextColorBlue">#000000</color>
<color name="secondaryTextColorBlue">#000000</color>
<!-- LIGHTBLUE Theme -->
<color name="primaryColorLightBlue">#039be5</color>
<color name="primaryLightColorLightBlue">#63ccff</color>
<color name="primaryDarkColorLightBlue">#006db3</color>
<color name="secondaryColorLightBlue">#CDDC39</color>
<color name="secondaryLightColorLightBlue">#F0F4C3</color>
<color name="secondaryDarkColorLightBlue">#AFB42B</color>
<color name="primaryTextColorLightBlue">#000000</color>
<color name="secondaryTextColorLightBlue">#000000</color>
<!-- CYAN Theme -->
<color name="primaryColorCyan">#00acc1</color>
<color name="primaryLightColorCyan">#5ddef4</color>
<color name="primaryDarkColorCyan">#007c91</color>
<color name="secondaryColorCyan">#f50057</color>
<color name="secondaryLightColorCyan">#ff5983</color>
<color name="secondaryDarkColorCyan">#bb002f</color>
<color name="primaryTextColorCyan">#000000</color>
<color name="secondaryTextColorCyan">#000000</color>
<!-- TEAL Theme -->
<color name="primaryColorTeal">#00796b</color>
<color name="primaryLightColorTeal">#48a999</color>
<color name="primaryDarkColorTeal">#004c40</color>
<color name="secondaryColorTeal">#ffd180</color>
<color name="secondaryLightColorTeal">#ffffb1</color>
<color name="secondaryDarkColorTeal">#caa052</color>
<color name="primaryTextColorTeal">#ffffff</color>
<color name="secondaryTextColorTeal">#000000</color>
<!-- GREEN Theme -->
<color name="primaryColorGreen">#4CAF50</color>
<color name="primaryLightColorGreen">#C8E6C9</color>
<color name="primaryDarkColorGreen">#388E3C</color>
<color name="secondaryColorGreen">#00BCD4</color>
<color name="secondaryLightColorGreen">#6cd1de</color>
<color name="secondaryDarkColorGreen">#0197ab</color>
<color name="primaryTextColorGreen">#ffffff</color>
<color name="secondaryTextColorGreen">#000000</color>
<!-- LIGHTGREEN Theme -->
<color name="primaryColorLightGreen">#8BC34A</color>
<color name="primaryLightColorLightGreen">#DCEDC8</color>
<color name="primaryDarkColorLightGreen">#689F38</color>
<color name="secondaryColorLightGreen">#448AFF</color>
<color name="secondaryLightColorLightGreen">#83affa</color>
<color name="secondaryDarkColorLightGreen">#1e58b8</color>
<color name="primaryTextColorLightGreen">#ffffff</color>
<color name="secondaryTextColorLightGreen">#000000</color>
<!-- Lime Theme -->
<color name="primaryColorLime">#CDDC39</color>
<color name="primaryLightColorLime">#F0F4C3</color>
<color name="primaryDarkColorLime">#AFB42B</color>
<color name="secondaryColorLime">#7C4DFF</color>
<color name="secondaryLightColorLime">#ae94f5</color>
<color name="secondaryDarkColorLime">#4f2cb3</color>
<color name="primaryTextColorLime">#ffffff</color>
<color name="secondaryTextColorLime">#000000</color>
<!-- YELLOW Theme -->
<color name="primaryColorYellow">#FFEB3B</color>
<color name="primaryLightColorYellow">#FFF9C4</color>
<color name="primaryDarkColorYellow">#FBC02D</color>
<color name="secondaryColorYellow">#536DFE</color>
<color name="secondaryLightColorYellow">#8799fd</color>
<color name="secondaryDarkColorYellow">#3751e1</color>
<color name="primaryTextColorYellow">#ffffff</color>
<color name="secondaryTextColorYellow">#000000</color>
<!-- AMBER Theme -->
<color name="primaryColorAmber">#FFC107</color>
<color name="primaryLightColorAmber">#FFECB3</color>
<color name="primaryDarkColorAmber">#FFA000</color>
<color name="secondaryColorAmber">#03A9F4</color>
<color name="secondaryLightColorAmber">#65c4ef</color>
<color name="secondaryDarkColorAmber">#1e87b6</color>
<color name="primaryTextColorAmber">#ffffff</color>
<color name="secondaryTextColorAmber">#000000</color>
<!-- ORANGE Theme -->
<color name="primaryColorOrange">#FF9800</color>
<color name="primaryLightColorOrange">#FFE0B2</color>
<color name="primaryDarkColorOrange">#F57C00</color>
<color name="secondaryColorOrange">#8BC34A</color>
<color name="secondaryLightColorOrange">#b4e67a</color>
<color name="secondaryDarkColorOrange">#649131</color>
<color name="primaryTextColorOrange">#ffffff</color>
<color name="secondaryTextColorOrange">#000000</color>
<!-- DEEPORANGE Theme -->
<color name="primaryColorDeepOrange">#FF5722</color>
<color name="primaryLightColorDeepOrange">#FFCCBC</color>
<color name="primaryDarkColorDeepOrange">#E64A19</color>
<color name="secondaryColorDeepOrange">#00BCD4</color>
<color name="secondaryLightColorDeepOrange">#75e8f6</color>
<color name="secondaryDarkColorDeepOrange">#2a9cab</color>
<color name="primaryTextColorDeepOrange">#ffffff</color>
<color name="secondaryTextColorDeepOrange">#000000</color>
<!-- BROWN Theme -->
<color name="primaryColorBrown">#795548</color>
<color name="primaryLightColorBrown">#D7CCC8</color>
<color name="primaryDarkColorBrown">#5D4037</color>
<color name="secondaryColorBrown">#FFC107</color>
<color name="secondaryLightColorBrown">#f6c83f</color>
<color name="secondaryDarkColorBrown">#cf9c02</color>
<color name="primaryTextColorBrown">#ffffff</color>
<color name="secondaryTextColorBrown">#000000</color>
<!-- GRAY Theme -->
<color name="primaryColorGray">#9E9E9E</color>
<color name="primaryLightColorGray">#F5F5F5</color>
<color name="primaryDarkColorGray">#616161</color>
<color name="secondaryColorGray">#536DFE</color>
<color name="secondaryLightColorGray">#94a5ff</color>
<color name="secondaryDarkColorGray">#2c44c9</color>
<color name="primaryTextColorGray">#ffffff</color>
<color name="secondaryTextColorGray">#000000</color>
<!-- BLUEGRAY Theme -->
<color name="primaryColorBlueGray">#607D8B</color>
<color name="primaryLightColorBlueGray">#CFD8DC</color>
<color name="primaryDarkColorBlueGray">#455A64</color>
<color name="secondaryColorBlueGray">#CDDC39</color>
<color name="secondaryLightColorBlueGray">#e3f15c</color>
<color name="secondaryDarkColorBlueGray">#a6b320</color>
<color name="primaryTextColorBlueGray">#ffffff</color>
<color name="secondaryTextColorBlueGray">#000000</color>
</resources>

View File

@ -60,6 +60,37 @@
<string name="menu_share">Share</string>
<string name="playback_channel_name">PeerTube</string>
<string name="invalid_url">Invalid Url!</string>
<string name="pref_title_dark_mode">Dark Mode</string>
<string name="pref_description_dark_mode">Restart App for Dark Mode to take effect.</string>
<string name="pref_title_app_theme">App Theme</string>
<string name="pref_description_app_theme">Restart App for theme to take effect.</string>
<string name="red">Red</string>
<string name="pink">Pink</string>
<string name="purple">Purple</string>
<string name="deeppurple">Deep Purple</string>
<string name="indigo">Indigo</string>
<string name="blue">Blue</string>
<string name="lightblue">Light Blue</string>
<string name="cyan">Cyan</string>
<string name="teal">Teal</string>
<string name="green">Green</string>
<string name="lightgreen">Light Green</string>
<string name="lime">Lime</string>
<string name="yellow">Yellow</string>
<string name="amber">Amber</string>
<string name="orange">Orange</string>
<string name="deeporange">Deep Orange</string>
<string name="brown">Brown</string>
<string name="gray">Gray</string>
<string name="bluegray">Bluegray</string>
<string name="video_speed_05">0.5x</string>
<string name="video_speed_10">Normal</string>
<string name="video_speed_15">1.5x</string>
<string name="video_speed_20">2x</string>
<string name="video_speed_active_icon">{faw-check}</string>
<string name="pref_token_access">pref_token_access</string>
<string name="pref_token_refresh">pref_token_refresh</string>
<string name="pref_token_expiration">pref_token_expiration</string>

View File

@ -1,26 +1,174 @@
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<style name="AppTheme" parent="Theme.AppCompat.DayNight.DarkActionBar">
</style>
<style name="FullscreenTheme" parent="AppTheme">
<item name="android:actionBarStyle">@style/FullscreenActionBarStyle</item>
<item name="android:windowActionBarOverlay">true</item>
<item name="android:windowBackground">@null</item>
<item name="metaButtonBarStyle">?android:attr/buttonBarStyle</item>
<item name="metaButtonBarButtonStyle">?android:attr/buttonBarButtonStyle</item>
<style name="AppTheme.NoActionBar" parent="AppTheme">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="FullscreenActionBarStyle" parent="Widget.AppCompat.ActionBar">
<item name="android:background">@color/black_overlay</item>
<style name="AppTheme.RED" parent="AppTheme.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/primaryColorRed</item>
<item name="colorPrimaryDark">@color/primaryDarkColorRed</item>
<item name="colorAccent">@color/secondaryColorRed</item>
</style>
<style name="AppTheme.PINK" parent="AppTheme.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/primaryColorPink</item>
<item name="colorPrimaryDark">@color/primaryDarkColorPink</item>
<item name="colorAccent">@color/secondaryColorPink</item>
</style>
<style name="AppTheme.PURPLE" parent="AppTheme.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/primaryColorPurple</item>
<item name="colorPrimaryDark">@color/primaryDarkColorPurple</item>
<item name="colorAccent">@color/secondaryColorPurple</item>
</style>
<style name="AppTheme.DEEPPURPLE" parent="AppTheme.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/primaryColorDeepPurple</item>
<item name="colorPrimaryDark">@color/primaryDarkColorDeepPurple</item>
<item name="colorAccent">@color/secondaryColorDeepPurple</item>
</style>
<style name="AppTheme.INDIGO" parent="AppTheme.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/primaryColorIndigo</item>
<item name="colorPrimaryDark">@color/primaryDarkColorIndigo</item>
<item name="colorAccent">@color/secondaryColorIndigo</item>
</style>
<style name="AppTheme.BLUE" parent="AppTheme.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/primaryColorBlue</item>
<item name="colorPrimaryDark">@color/primaryDarkColorBlue</item>
<item name="colorAccent">@color/secondaryColorBlue</item>
</style>
<style name="AppTheme.LIGHTBLUE" parent="AppTheme.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/primaryColorLightBlue</item>
<item name="colorPrimaryDark">@color/primaryDarkColorLightBlue</item>
<item name="colorAccent">@color/secondaryColorLightBlue</item>
</style>
<style name="AppTheme.CYAN" parent="AppTheme.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/primaryColorCyan</item>
<item name="colorPrimaryDark">@color/primaryDarkColorCyan</item>
<item name="colorAccent">@color/secondaryColorCyan</item>
</style>
<style name="AppTheme.TEAL" parent="AppTheme.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/primaryColorTeal</item>
<item name="colorPrimaryDark">@color/primaryDarkColorTeal</item>
<item name="colorAccent">@color/secondaryColorTeal</item>
</style>
<style name="AppTheme.GREEN" parent="AppTheme.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/primaryColorGreen</item>
<item name="colorPrimaryDark">@color/primaryDarkColorGreen</item>
<item name="colorAccent">@color/secondaryColorGreen</item>
</style>
<style name="AppTheme.LIGHTGREEN" parent="AppTheme.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/primaryColorLightGreen</item>
<item name="colorPrimaryDark">@color/primaryDarkColorLightGreen</item>
<item name="colorAccent">@color/secondaryColorLightGreen</item>
</style>
<style name="AppTheme.LIME" parent="AppTheme.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/primaryColorLime</item>
<item name="colorPrimaryDark">@color/primaryDarkColorLime</item>
<item name="colorAccent">@color/secondaryColorLime</item>
</style>
<style name="AppTheme.YELLOW" parent="AppTheme.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/primaryColorYellow</item>
<item name="colorPrimaryDark">@color/primaryDarkColorYellow</item>
<item name="colorAccent">@color/secondaryColorYellow</item>
</style>
<style name="AppTheme.AMBER" parent="AppTheme.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/primaryColorAmber</item>
<item name="colorPrimaryDark">@color/primaryDarkColorAmber</item>
<item name="colorAccent">@color/secondaryColorAmber</item>
</style>
<style name="AppTheme.ORANGE" parent="AppTheme.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/primaryColorOrange</item>
<item name="colorPrimaryDark">@color/primaryDarkColorOrange</item>
<item name="colorAccent">@color/secondaryColorOrange</item>
</style>
<style name="AppTheme.DEEPORANGE" parent="AppTheme.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/primaryColorDeepOrange</item>
<item name="colorPrimaryDark">@color/primaryDarkColorDeepOrange</item>
<item name="colorAccent">@color/secondaryColorDeepOrange</item>
</style>
<style name="AppTheme.BROWN" parent="AppTheme.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/primaryColorBrown</item>
<item name="colorPrimaryDark">@color/primaryDarkColorBrown</item>
<item name="colorAccent">@color/secondaryColorBrown</item>
</style>
<style name="AppTheme.GRAY" parent="AppTheme.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/primaryColorGray</item>
<item name="colorPrimaryDark">@color/primaryDarkColorGray</item>
<item name="colorAccent">@color/secondaryColorGray</item>
</style>
<style name="AppTheme.BLUEGRAY" parent="AppTheme.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/primaryColorBlueGray</item>
<item name="colorPrimaryDark">@color/primaryDarkColorBlueGray</item>
<item name="colorAccent">@color/secondaryColorBlueGray</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
<!-- Text styles -->
<style name="Text" parent="TextAppearance.AppCompat"></style>
<style name="Text.Caption" parent="TextAppearance.AppCompat.Caption"></style>
<style name="Text.Small" parent="TextAppearance.AppCompat.Small"></style>
<style name="Text.Body1" parent="TextAppearance.AppCompat.Body1"></style>
<style name="Text.Body2" parent="TextAppearance.AppCompat.Body2"></style>
<style name="Text.Medium" parent="TextAppearance.AppCompat.Medium"></style>
<style name="Text.Large" parent="TextAppearance.AppCompat.Large"></style>
<style name="Text.Headline" parent="TextAppearance.AppCompat.Headline"></style>
<style name="Text.Title" parent="TextAppearance.AppCompat.Title"></style>
<style name="Text.Display1" parent="TextAppearance.AppCompat.Display1"></style>
<style name="Text.Subhead" parent="TextAppearance.AppCompat.Subhead"></style>
<style name="Text.Button" parent="TextAppearance.AppCompat.Button"></style>
<!-- Button Styles-->
<style name="Buton" parent="Widget.AppCompat.Button"></style>
<style name="Buton.Small" parent="Widget.AppCompat.Button.Small"></style>
<style name="Buton.Colored" parent="Widget.AppCompat.Button.Colored"></style>
<style name="Buton.Borderless" parent="Widget.AppCompat.Button.Borderless"></style>
<style name="Buton.Borderless.Colored" parent="Widget.AppCompat.Button.Borderless.Colored"></style>
</resources>

View File

@ -16,6 +16,20 @@
android:summary="@string/pref_description_show_nsfw"
android:defaultValue="false" />
<ListPreference
android:title="@string/pref_title_app_theme"
android:summary="@string/pref_description_app_theme"
android:key="pref_theme"
android:defaultValue="AppTheme.ORANGE"
android:entries="@array/themeArray"
android:entryValues="@array/themeValues" />
<SwitchPreference
android:key="pref_dark_mode"
android:title="@string/pref_title_dark_mode"
android:summary="@string/pref_description_dark_mode"
android:defaultValue="false" />
<SwitchPreference
android:key="pref_torrent_player"
android:title="@string/pref_title_torrent_player"

View File

@ -9,6 +9,8 @@
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
android.enableJetifier=true
android.useAndroidX=true
org.gradle.jvmargs=-Xmx1536m
# When configured, Gradle will run in incubating parallel mode.