1
0
mirror of https://github.com/TeamNewPipe/NewPipe.git synced 2024-11-21 18:42:35 +01:00

put the play video button into the horizontal center

This commit is contained in:
Christian Schabesberger 2015-09-21 23:53:10 +02:00
parent d24c87c9c9
commit 4f24d61c4b
4 changed files with 12 additions and 5 deletions

View File

@ -37,7 +37,7 @@
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">

View File

@ -8,8 +8,8 @@ android {
applicationId "org.schabi.newpipe"
minSdkVersion 15
targetSdkVersion 23
versionCode 3
versionName "0.4.0"
versionCode 4
versionName "0.4.1"
}
buildTypes {
release {

View File

@ -12,6 +12,7 @@ import android.support.v4.app.Fragment;
import android.support.v7.app.ActionBar;
import android.text.Html;
import android.text.method.LinkMovementMethod;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
@ -271,7 +272,7 @@ public class VideoItemDetailFragment extends Fragment {
FloatingActionButton playVideoButton = (FloatingActionButton) getActivity().findViewById(R.id.playVideoButton);
if(PreferenceManager.getDefaultSharedPreferences(getActivity())
.getBoolean(getString(R.string.leftHandLayout), false)) {
.getBoolean(getString(R.string.leftHandLayout), false) && checkIfLandscape()) {
RelativeLayout.LayoutParams oldLayout = (RelativeLayout.LayoutParams) playVideoButton.getLayoutParams();
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(
RelativeLayout.LayoutParams.WRAP_CONTENT,
@ -289,4 +290,10 @@ public class VideoItemDetailFragment extends Fragment {
}
});
}
public boolean checkIfLandscape() {
DisplayMetrics displayMetrics = new DisplayMetrics();
getActivity().getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
return displayMetrics.heightPixels < displayMetrics.widthPixels;
}
}

View File

@ -141,8 +141,8 @@
</ScrollView>
<android.support.design.widget.FloatingActionButton
android:id="@+id/playVideoButton"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:backgroundTint="@color/primaryColorYoutube"