diff --git a/app/build.gradle b/app/build.gradle index 266f7fadb..536d304c8 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -32,10 +32,10 @@ android { dependencies { testCompile 'junit:junit:4.12' - compile 'com.android.support:appcompat-v7:25.1.0' - compile 'com.android.support:support-v4:25.1.0' - compile 'com.android.support:design:25.1.0' - compile 'com.android.support:recyclerview-v7:25.1.0' + compile 'com.android.support:appcompat-v7:25.0.0' + compile 'com.android.support:support-v4:25.0.0' + compile 'com.android.support:design:25.0.0' + compile 'com.android.support:recyclerview-v7:25.0.0' compile 'org.jsoup:jsoup:1.8.3' compile 'org.mozilla:rhino:1.7.7' compile 'info.guardianproject.netcipher:netcipher:1.2' diff --git a/app/src/main/java/org/schabi/newpipe/MainActivity.java b/app/src/main/java/org/schabi/newpipe/MainActivity.java index 2e94443f9..9472d5903 100644 --- a/app/src/main/java/org/schabi/newpipe/MainActivity.java +++ b/app/src/main/java/org/schabi/newpipe/MainActivity.java @@ -47,7 +47,6 @@ public class MainActivity extends Themer { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); - setVolumeControlStream(AudioManager.STREAM_MUSIC); mainFragment = getSupportFragmentManager() .findFragmentById(R.id.search_fragment); diff --git a/app/src/main/java/org/schabi/newpipe/Themer.java b/app/src/main/java/org/schabi/newpipe/Themer.java index 07a9f89a4..048837cec 100644 --- a/app/src/main/java/org/schabi/newpipe/Themer.java +++ b/app/src/main/java/org/schabi/newpipe/Themer.java @@ -2,19 +2,20 @@ package org.schabi.newpipe; import android.os.Bundle; import android.preference.PreferenceManager; -import android.support.annotation.Nullable; import android.support.v7.app.AppCompatActivity; import java.util.Objects; +import static org.schabi.newpipe.R.attr.theme; + public class Themer extends AppCompatActivity { @Override - protected void onCreate(@Nullable Bundle savedInstanceState) { + protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (Objects.equals(PreferenceManager.getDefaultSharedPreferences(this) - .getString("theme", "1"), "0")) { + .getString("theme", getResources().getString(R.string.light_theme_title)), getResources().getString(R.string.dark_theme_title))) { setTheme(R.style.DarkTheme); } } -} +} \ No newline at end of file diff --git a/app/src/main/java/org/schabi/newpipe/detail/VideoItemDetailFragment.java b/app/src/main/java/org/schabi/newpipe/detail/VideoItemDetailFragment.java index a93f37654..98620b15d 100644 --- a/app/src/main/java/org/schabi/newpipe/detail/VideoItemDetailFragment.java +++ b/app/src/main/java/org/schabi/newpipe/detail/VideoItemDetailFragment.java @@ -21,6 +21,7 @@ import android.util.Log; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuInflater; +import android.view.MenuItem; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; @@ -30,7 +31,6 @@ import android.widget.LinearLayout; import android.widget.ProgressBar; import android.widget.RelativeLayout; import android.widget.TextView; -import android.view.MenuItem; import android.widget.Toast; import com.google.android.exoplayer.util.Util; @@ -39,26 +39,26 @@ import com.nostra13.universalimageloader.core.ImageLoader; import com.nostra13.universalimageloader.core.assist.FailReason; import com.nostra13.universalimageloader.core.listener.ImageLoadingListener; -import java.util.Vector; - import org.schabi.newpipe.ActivityCommunicator; import org.schabi.newpipe.ChannelActivity; -import org.schabi.newpipe.ReCaptchaActivity; -import org.schabi.newpipe.extractor.stream_info.StreamInfo; -import org.schabi.newpipe.extractor.stream_info.StreamPreviewInfo; -import org.schabi.newpipe.info_list.InfoItemBuilder; -import org.schabi.newpipe.report.ErrorActivity; import org.schabi.newpipe.ImageErrorLoadingListener; import org.schabi.newpipe.Localization; import org.schabi.newpipe.R; +import org.schabi.newpipe.ReCaptchaActivity; import org.schabi.newpipe.download.DownloadDialog; -import org.schabi.newpipe.extractor.stream_info.AudioStream; import org.schabi.newpipe.extractor.MediaFormat; import org.schabi.newpipe.extractor.NewPipe; +import org.schabi.newpipe.extractor.stream_info.AudioStream; +import org.schabi.newpipe.extractor.stream_info.StreamInfo; +import org.schabi.newpipe.extractor.stream_info.StreamPreviewInfo; import org.schabi.newpipe.extractor.stream_info.VideoStream; +import org.schabi.newpipe.info_list.InfoItemBuilder; import org.schabi.newpipe.player.BackgroundPlayer; -import org.schabi.newpipe.player.PlayVideoActivity; import org.schabi.newpipe.player.ExoPlayerActivity; +import org.schabi.newpipe.player.PlayVideoActivity; +import org.schabi.newpipe.report.ErrorActivity; + +import java.util.Vector; import static android.app.Activity.RESULT_OK; import static org.schabi.newpipe.ReCaptchaActivity.RECAPTCHA_REQUEST; @@ -650,7 +650,6 @@ public class VideoItemDetailFragment extends Fragment { public void onStart() { super.onStart(); Activity a = getActivity(); - infoItemBuilder = new InfoItemBuilder(a, a.findViewById(android.R.id.content)); if (android.os.Build.VERSION.SDK_INT < 18) { diff --git a/app/src/main/java/org/schabi/newpipe/download/DownloadActivity.java b/app/src/main/java/org/schabi/newpipe/download/DownloadActivity.java index 98e4eddd7..2f77cadb2 100644 --- a/app/src/main/java/org/schabi/newpipe/download/DownloadActivity.java +++ b/app/src/main/java/org/schabi/newpipe/download/DownloadActivity.java @@ -13,6 +13,7 @@ import android.os.IBinder; import android.preference.PreferenceManager; import android.support.v4.app.NavUtils; import android.support.v7.app.ActionBar; +import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.LayoutInflater; import android.view.Menu; @@ -27,9 +28,9 @@ import android.widget.SeekBar; import android.widget.TextView; import android.widget.Toast; -import org.schabi.newpipe.R; import org.schabi.newpipe.Themer; import org.schabi.newpipe.report.ErrorActivity; +import org.schabi.newpipe.R; import org.schabi.newpipe.settings.SettingsActivity; import java.io.File; diff --git a/app/src/main/java/org/schabi/newpipe/settings/SettingsActivity.java b/app/src/main/java/org/schabi/newpipe/settings/SettingsActivity.java index 9ca0490d4..be4dbfc03 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/SettingsActivity.java +++ b/app/src/main/java/org/schabi/newpipe/settings/SettingsActivity.java @@ -47,8 +47,8 @@ public class SettingsActivity extends PreferenceActivity { @Override protected void onCreate(Bundle savedInstanceBundle) { if (Objects.equals(PreferenceManager.getDefaultSharedPreferences(this) - .getString("theme", "1"), "0")) { - setTheme(R.style.DarkTheme); + .getString("theme", getResources().getString(R.string.light_theme_title)), getResources().getString(R.string.dark_theme_title))) { + setTheme(R.style.DarkTheme); } getDelegate().installViewFactory(); getDelegate().onCreate(savedInstanceBundle); diff --git a/app/src/main/java/org/schabi/newpipe/settings/SettingsFragment.java b/app/src/main/java/org/schabi/newpipe/settings/SettingsFragment.java index c9c7fe134..0e7e6bb0a 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/SettingsFragment.java +++ b/app/src/main/java/org/schabi/newpipe/settings/SettingsFragment.java @@ -21,6 +21,7 @@ import org.schabi.newpipe.App; import org.schabi.newpipe.R; import java.util.ArrayList; +import java.util.Objects; import info.guardianproject.netcipher.proxy.OrbotHelper; @@ -67,7 +68,7 @@ public class SettingsFragment extends PreferenceFragment private Preference downloadPathAudioPreference; private Preference themePreference; private SharedPreferences defaultPreferences; - + private Preference themePreference; @Override public void onCreate(final Bundle savedInstanceState) { @@ -86,6 +87,7 @@ public class SettingsFragment extends PreferenceFragment DOWNLOAD_PATH_AUDIO_PREFERENCE = getString(R.string.download_path_audio_key); THEME = getString(R.string.theme_key); USE_TOR_KEY = getString(R.string.use_tor_key); + THEME = getString(R.string.theme_key); // get pref objects defaultResolutionPreference = diff --git a/app/src/main/res/drawable-nodpi/thumbs_down.png b/app/src/main/res/drawable-nodpi/thumbs_down.png deleted file mode 100644 index 23c0f0487..000000000 Binary files a/app/src/main/res/drawable-nodpi/thumbs_down.png and /dev/null differ diff --git a/app/src/main/res/drawable-nodpi/thumbs_up.png b/app/src/main/res/drawable-nodpi/thumbs_up.png deleted file mode 100644 index 1fdd2293f..000000000 Binary files a/app/src/main/res/drawable-nodpi/thumbs_up.png and /dev/null differ diff --git a/app/src/main/res/drawable/splash_screen.xml b/app/src/main/res/drawable/splash_screen.xml index 96edac61b..e049c2941 100644 --- a/app/src/main/res/drawable/splash_screen.xml +++ b/app/src/main/res/drawable/splash_screen.xml @@ -2,7 +2,7 @@ + android:drawable="?android:attr/windowBackground"/> + xmlns:tools="http://schemas.android.com/tools" + xmlns:app="http://schemas.android.com/apk/res-auto" + tools:context=".detail.VideoItemDetailFragment" + android:textIsSelectable="true" + style="?android:attr/textAppearanceLarge" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:id="@+id/video_item_detail"> + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerInParent="true" + android:indeterminate="true"/> + android:contentDescription="@string/detail_thumbnail_view_description" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:scaleType="fitCenter" + android:adjustViewBounds="true" + android:layout_alignParentLeft="true" + android:layout_alignParentStart="true" + android:layout_alignParentTop="true" + android:background="@android:color/black" + android:src="@drawable/dummy_thumbnail_dark"/> + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:background="@android:color/transparent" + android:layout_centerInParent="true" + android:src="@drawable/new_play_arrow" + android:visibility="invisible"/>