- Cleaned up

This commit is contained in:
Stefan Schueller 2019-01-06 14:13:05 +01:00
parent 3f0c275cdc
commit f94eb12f27
6 changed files with 20 additions and 33 deletions

View File

@ -55,7 +55,7 @@ import retrofit2.Response;
import static net.schueller.peertube.helper.Constants.DEFAULT_THEME; import static net.schueller.peertube.helper.Constants.DEFAULT_THEME;
import static net.schueller.peertube.helper.Constants.THEME_PREF_KEY; import static net.schueller.peertube.helper.Constants.THEME_PREF_KEY;
public class AccountActivity extends AppCompatActivity { public class AccountActivity extends CommonActivity {
private static final String TAG = "AccountActivity"; private static final String TAG = "AccountActivity";
@ -104,17 +104,8 @@ public class AccountActivity extends AppCompatActivity {
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(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_account); setContentView(R.layout.activity_account);
// Attaching the layout to the toolbar object // Attaching the layout to the toolbar object
Toolbar toolbar = findViewById(R.id.tool_bar_user); Toolbar toolbar = findViewById(R.id.tool_bar_user);
// Setting toolbar as the ActionBar with setSupportActionBar() call // Setting toolbar as the ActionBar with setSupportActionBar() call

View File

@ -1,3 +1,21 @@
/*
* Copyright 2018 Stefan Schüller <sschueller@techdroid.com>
*
* License: GPL-3.0+
* 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.
*
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.schueller.peertube.activity; package net.schueller.peertube.activity;
import android.content.SharedPreferences; import android.content.SharedPreferences;

View File

@ -49,7 +49,7 @@ import retrofit2.Response;
import static net.schueller.peertube.helper.Constants.DEFAULT_THEME; import static net.schueller.peertube.helper.Constants.DEFAULT_THEME;
import static net.schueller.peertube.helper.Constants.THEME_PREF_KEY; import static net.schueller.peertube.helper.Constants.THEME_PREF_KEY;
public class LoginActivity extends AppCompatActivity { public class LoginActivity extends CommonActivity {
private String TAG = "LoginActivity"; private String TAG = "LoginActivity";
@ -61,14 +61,6 @@ public class LoginActivity extends AppCompatActivity {
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(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); setContentView(R.layout.activity_login);
// bind button click // bind button click

View File

@ -32,10 +32,8 @@ import com.google.android.material.bottomnavigation.BottomNavigationView;
import com.google.android.material.bottomnavigation.LabelVisibilityMode; import com.google.android.material.bottomnavigation.LabelVisibilityMode;
import androidx.core.app.ActivityCompat; import androidx.core.app.ActivityCompat;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle; import android.os.Bundle;
import androidx.appcompat.app.AppCompatDelegate;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import androidx.appcompat.widget.SearchView; import androidx.appcompat.widget.SearchView;
@ -68,9 +66,6 @@ import retrofit2.Call;
import retrofit2.Callback; import retrofit2.Callback;
import retrofit2.Response; 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 CommonActivity { public class VideoListActivity extends CommonActivity {
private String TAG = "VideoListActivity"; private String TAG = "VideoListActivity";

View File

@ -42,7 +42,6 @@ import net.schueller.peertube.fragment.VideoPlayerFragment;
import java.util.Objects; import java.util.Objects;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentManager;

View File

@ -34,7 +34,6 @@ import android.view.LayoutInflater;
import android.view.Surface; import android.view.Surface;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ProgressBar; import android.widget.ProgressBar;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
@ -193,10 +192,7 @@ public class VideoPlayerFragment extends Fragment implements VideoRendererEventL
private void playVideo(Video video) { private void playVideo(Video video) {
Context context = getContext(); Context context = getContext();
Activity activity = getActivity();
// video Meta fragment // video Meta fragment
assert getFragmentManager() != null; assert getFragmentManager() != null;
@ -206,10 +202,6 @@ public class VideoPlayerFragment extends Fragment implements VideoRendererEventL
assert videoMetaDataFragment != null; assert videoMetaDataFragment != null;
videoMetaDataFragment.updateVideoMeta(video, mService); videoMetaDataFragment.updateVideoMeta(video, mService);
Log.v(TAG, "url : " + video.getFiles().get(0).getFileUrl()); Log.v(TAG, "url : " + video.getFiles().get(0).getFileUrl());
mService.setCurrentStreamUrl(video.getFiles().get(0).getFileUrl()); mService.setCurrentStreamUrl(video.getFiles().get(0).getFileUrl());