mirror of
				https://github.com/TeamNewPipe/NewPipe
				synced 2025-10-31 15:23:00 +00:00 
			
		
		
		
	put the play video button into the horizontal center
This commit is contained in:
		
							
								
								
									
										2
									
								
								.idea/misc.xml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2
									
								
								.idea/misc.xml
									
									
									
										generated
									
									
									
								
							| @@ -37,7 +37,7 @@ | |||||||
|     <ConfirmationsSetting value="0" id="Add" /> |     <ConfirmationsSetting value="0" id="Add" /> | ||||||
|     <ConfirmationsSetting value="0" id="Remove" /> |     <ConfirmationsSetting value="0" id="Remove" /> | ||||||
|   </component> |   </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" /> |     <output url="file://$PROJECT_DIR$/build/classes" /> | ||||||
|   </component> |   </component> | ||||||
|   <component name="ProjectType"> |   <component name="ProjectType"> | ||||||
|   | |||||||
| @@ -8,8 +8,8 @@ android { | |||||||
|         applicationId "org.schabi.newpipe" |         applicationId "org.schabi.newpipe" | ||||||
|         minSdkVersion 15 |         minSdkVersion 15 | ||||||
|         targetSdkVersion 23 |         targetSdkVersion 23 | ||||||
|         versionCode 3 |         versionCode 4 | ||||||
|         versionName "0.4.0" |         versionName "0.4.1" | ||||||
|     } |     } | ||||||
|     buildTypes { |     buildTypes { | ||||||
|         release { |         release { | ||||||
|   | |||||||
| @@ -12,6 +12,7 @@ import android.support.v4.app.Fragment; | |||||||
| import android.support.v7.app.ActionBar; | import android.support.v7.app.ActionBar; | ||||||
| import android.text.Html; | import android.text.Html; | ||||||
| import android.text.method.LinkMovementMethod; | import android.text.method.LinkMovementMethod; | ||||||
|  | import android.util.DisplayMetrics; | ||||||
| import android.util.Log; | import android.util.Log; | ||||||
| import android.view.LayoutInflater; | import android.view.LayoutInflater; | ||||||
| import android.view.View; | import android.view.View; | ||||||
| @@ -271,7 +272,7 @@ public class VideoItemDetailFragment extends Fragment { | |||||||
|         FloatingActionButton playVideoButton = (FloatingActionButton) getActivity().findViewById(R.id.playVideoButton); |         FloatingActionButton playVideoButton = (FloatingActionButton) getActivity().findViewById(R.id.playVideoButton); | ||||||
|  |  | ||||||
|         if(PreferenceManager.getDefaultSharedPreferences(getActivity()) |         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 oldLayout = (RelativeLayout.LayoutParams) playVideoButton.getLayoutParams(); | ||||||
|             RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams( |             RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams( | ||||||
|                     RelativeLayout.LayoutParams.WRAP_CONTENT, |                     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; | ||||||
|  |     } | ||||||
| } | } | ||||||
| @@ -141,8 +141,8 @@ | |||||||
|     </ScrollView> |     </ScrollView> | ||||||
|     <android.support.design.widget.FloatingActionButton |     <android.support.design.widget.FloatingActionButton | ||||||
|         android:id="@+id/playVideoButton" |         android:id="@+id/playVideoButton" | ||||||
|         android:layout_alignParentRight="true" |  | ||||||
|         android:layout_alignParentBottom="true" |         android:layout_alignParentBottom="true" | ||||||
|  |         android:layout_centerHorizontal="true" | ||||||
|         android:layout_width="wrap_content" |         android:layout_width="wrap_content" | ||||||
|         android:layout_height="wrap_content" |         android:layout_height="wrap_content" | ||||||
|         app:backgroundTint="@color/primaryColorYoutube" |         app:backgroundTint="@color/primaryColorYoutube" | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Christian Schabesberger
					Christian Schabesberger