Normalize theme

This commit is contained in:
Ivan Agosto 2024-03-21 17:47:54 -06:00
parent bf35a75877
commit b6ef9b8aca
11 changed files with 91 additions and 74 deletions

View File

@ -33,13 +33,14 @@
android:name=".ReproductorActivity" android:name=".ReproductorActivity"
android:configChanges="orientation|screenSize" android:configChanges="orientation|screenSize"
android:hardwareAccelerated="true" android:hardwareAccelerated="true"
android:theme="@style/P2playTheme.noBar" /> android:theme="@style/Theme.P2play.NoActionBar" />
<activity android:name=".LoginActivity" /> <activity android:name=".LoginActivity" />
<activity android:name=".RegisterActivity" /> <activity android:name=".RegisterActivity" />
<activity android:name=".AboutActivity" /> <activity android:name=".AboutActivity" />
<activity <activity
android:name=".SettingsActivity" android:name=".SettingsActivity"
android:label="@string/title_activity_settings" /> android:label="@string/title_activity_settings"
android:theme="@style/Theme.P2play"/>
</application> </application>
</manifest> </manifest>

View File

@ -2,10 +2,12 @@ package org.libre.agosto.p2play
import android.content.Intent import android.content.Intent
import android.os.AsyncTask import android.os.AsyncTask
import android.os.Build
import android.os.Bundle import android.os.Bundle
import android.os.Handler import android.os.Handler
import android.view.Menu import android.view.Menu
import android.view.MenuItem import android.view.MenuItem
import android.view.WindowManager
import androidx.appcompat.app.ActionBarDrawerToggle import androidx.appcompat.app.ActionBarDrawerToggle
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
@ -48,6 +50,8 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte
.setAction("Action", null).show() .setAction("Action", null).show()
} */ } */
val toggle = ActionBarDrawerToggle(this, drawer_layout, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close) val toggle = ActionBarDrawerToggle(this, drawer_layout, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close)
drawer_layout.addDrawerListener(toggle) drawer_layout.addDrawerListener(toggle)
toggle.syncState() toggle.syncState()

View File

@ -45,21 +45,30 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="30dp" /> android:layout_height="30dp" />
<androidx.appcompat.widget.AppCompatEditText <com.google.android.material.textfield.TextInputLayout
android:id="@+id/hostText"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:ems="10" android:layout_margin="4dp"
android:hint="@string/hostText" android:hint="@string/instance"
android:inputType="text" /> app:expandedHintEnabled="false">
<androidx.appcompat.widget.AppCompatButton <com.google.android.material.textfield.TextInputEditText
android:id="@+id/hostText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:hint="@string/hostText"
android:inputType="text" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.button.MaterialButton
android:id="@+id/button" android:id="@+id/button"
style="@style/Widget.AppCompat.Button.Colored"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/okButton" /> android:text="@string/okButton" />
</LinearLayout> </LinearLayout>
</FrameLayout> </FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -29,7 +29,7 @@
android:contentDescription="Logo" android:contentDescription="Logo"
app:srcCompat="@drawable/icon" /> app:srcCompat="@drawable/icon" />
<Space <androidx.legacy.widget.Space
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="30dp" /> android:layout_height="30dp" />
@ -39,60 +39,62 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/loginInfo" android:text="@string/loginInfo"
android:textAlignment="center" android:textAlignment="center"
android:textAppearance="@android:style/TextAppearance.Material.Medium.Inverse" android:textAppearance="@android:style/TextAppearance.DeviceDefault.Medium"/>
android:textColor="@android:color/black" />
<Space <androidx.legacy.widget.Space
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="30dp" /> android:layout_height="30dp" />
<TextView <com.google.android.material.textfield.TextInputLayout
android:id="@+id/userTxt" android:id="@+id/userTxt"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/userTxt" /> android:layout_margin="4dp"
android:hint="@string/userTxt">
<EditText <com.google.android.material.textfield.TextInputEditText
android:id="@+id/userText" android:id="@+id/userText"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:ems="10" android:ems="10"
android:hint="@string/userText" android:hint="@string/userText"
android:inputType="text" /> android:inputType="text" />
</com.google.android.material.textfield.TextInputLayout>
<TextView <com.google.android.material.textfield.TextInputLayout
android:id="@+id/passwordTxt" android:id="@+id/passwordTxt"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/passwordTxt" /> android:layout_margin="4dp"
app:endIconMode="password_toggle"
android:hint="@string/passwordTxt" >
<EditText <EditText
android:id="@+id/passwordText" android:id="@+id/passwordText"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:ems="10" android:ems="10"
android:hint="@string/passwordText" android:inputType="textPassword"/>
android:inputType="text|textPassword" /> </com.google.android.material.textfield.TextInputLayout>
<Button <com.google.android.material.button.MaterialButton
android:id="@+id/loginBtn" android:id="@+id/loginBtn"
style="@style/Widget.AppCompat.Button.Colored"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/loginBtn" android:text="@string/loginBtn"
android:textAlignment="center" /> android:textAlignment="center" />
<Space <androidx.legacy.widget.Space
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="30dp" /> android:layout_height="30dp" />
<Button <com.google.android.material.button.MaterialButton
android:id="@+id/registerActionBtn" android:id="@+id/registerActionBtn"
style="@style/Widget.AppCompat.Button.Borderless" style="@style/Widget.MaterialComponents.Button.TextButton"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/registerActionBtn" android:text="@string/registerActionBtn"
android:visibility="visible" /> android:visibility="invisible" />
</LinearLayout> </LinearLayout>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?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:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -12,8 +12,8 @@
android:layout_height="fill_parent" android:layout_height="fill_parent"
android:layout_alignParentTop="true" android:layout_alignParentTop="true"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true" android:layout_alignParentStart="true"
android:layout_alignParentRight="true" android:layout_alignParentEnd="true"
android:visibility="gone" /> android:visibility="gone" />
<ScrollView <ScrollView
@ -37,17 +37,15 @@
<WebView <WebView
android:id="@+id/videoView" android:id="@+id/videoView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="270dp" android:layout_height="222dp"
android:layout_weight="1"> android:layout_weight="1" />
</WebView>
<TextView <TextView
android:id="@+id/tittleVideoTxt" android:id="@+id/tittleVideoTxt"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingStart="5dp" android:paddingStart="5dp"
android:textAppearance="@android:style/TextAppearance.Material.Large" android:textAppearance="@android:style/TextAppearance.Material.Display1"
android:textSize="18sp" android:textSize="18sp"
android:textStyle="bold" /> android:textStyle="bold" />
@ -59,7 +57,7 @@
android:paddingRight="5dp" android:paddingRight="5dp"
android:textSize="12sp" /> android:textSize="12sp" />
<LinearLayout <androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/actionsLayout" android:id="@+id/actionsLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="50dp" android:layout_height="50dp"
@ -67,7 +65,7 @@
android:orientation="horizontal" android:orientation="horizontal"
android:visibility="gone"> android:visibility="gone">
<LinearLayout <androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/likeLayout" android:id="@+id/likeLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
@ -94,7 +92,7 @@
android:layout_weight="1" android:layout_weight="1"
android:text="@string/likeBtn" android:text="@string/likeBtn"
android:textAlignment="center" /> android:textAlignment="center" />
</LinearLayout> </androidx.appcompat.widget.LinearLayoutCompat>
<LinearLayout <LinearLayout
android:id="@+id/dislikeLayout" android:id="@+id/dislikeLayout"
@ -179,7 +177,7 @@
android:text="@string/shareBtn" android:text="@string/shareBtn"
android:textAlignment="center" /> android:textAlignment="center" />
</LinearLayout> </LinearLayout>
</LinearLayout> </androidx.appcompat.widget.LinearLayoutCompat>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -210,7 +208,6 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textAppearance="@android:style/TextAppearance.Material.Large" android:textAppearance="@android:style/TextAppearance.Material.Large"
android:textColor="@android:color/black"
android:textSize="18sp" android:textSize="18sp"
android:textStyle="bold" /> android:textStyle="bold" />
@ -223,9 +220,8 @@
</LinearLayout> </LinearLayout>
<Button <com.google.android.material.button.MaterialButton
android:id="@+id/subscribeBtn" android:id="@+id/subscribeBtn"
style="@style/Widget.AppCompat.Button.Colored"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
@ -257,9 +253,9 @@
android:paddingLeft="10dp" android:paddingLeft="10dp"
android:paddingRight="10dp" /> android:paddingRight="10dp" />
<Button <com.google.android.material.button.MaterialButton
android:id="@+id/showMoreBtn" android:id="@+id/showMoreBtn"
style="@style/Widget.AppCompat.Button.Borderless.Colored" style="@style/Widget.MaterialComponents.Button.TextButton"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
@ -272,7 +268,7 @@
android:layout_height="1dp" android:layout_height="1dp"
android:background="?android:attr/listDivider" /> android:background="?android:attr/listDivider" />
<Space <androidx.legacy.widget.Space
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="10dp" android:layout_height="10dp"
android:layout_weight="1" /> android:layout_weight="1" />
@ -285,11 +281,11 @@
android:text="@string/commentariesTxt" android:text="@string/commentariesTxt"
android:textStyle="bold" /> android:textStyle="bold" />
<Space <androidx.legacy.widget.Space
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="20dp" /> android:layout_height="20dp" />
<LinearLayout <androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/commentaryLayout" android:id="@+id/commentaryLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -319,17 +315,16 @@
</LinearLayout> </LinearLayout>
<Button <com.google.android.material.button.MaterialButton
android:id="@+id/commentaryBtn" android:id="@+id/commentaryBtn"
style="@style/Widget.AppCompat.Button.Colored"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1"
android:text="@string/commentaryText" /> android:text="@string/commentaryText" />
</LinearLayout> </androidx.appcompat.widget.LinearLayoutCompat>
<android.support.v7.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/listCommentaries" android:id="@+id/listCommentaries"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -340,4 +335,4 @@
</LinearLayout> </LinearLayout>
</ScrollView> </ScrollView>
</android.support.constraint.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -50,7 +50,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:maxLength="70" android:maxLength="70"
android:textSize="14sp" android:textSize="14sp"
android:textStyle="bold" /> android:textStyle="bold"
android:theme="@style/MaterialAlertDialog.MaterialComponents.Title.Text"/>
<TextView <TextView
android:id="@+id/descriptionTxt" android:id="@+id/descriptionTxt"

View File

@ -1,6 +1,6 @@
<resources> <resources>
<style name="Theme.P2play" parent="Theme.MaterialComponents"> <style name="Theme.P2play" parent="Theme.MaterialComponents.DayNight">
<item name="colorPrimary">@color/md_theme_dark_primary</item> <item name="colorPrimary">@color/md_theme_dark_primary</item>
<item name="colorOnPrimary">@color/md_theme_dark_onPrimary</item> <item name="colorOnPrimary">@color/md_theme_dark_onPrimary</item>
<item name="colorSecondary">@color/md_theme_dark_secondary</item> <item name="colorSecondary">@color/md_theme_dark_secondary</item>
@ -11,7 +11,8 @@
<item name="colorOnBackground">@color/md_theme_dark_onBackground</item> <item name="colorOnBackground">@color/md_theme_dark_onBackground</item>
<item name="colorSurface">@color/md_theme_dark_surface</item> <item name="colorSurface">@color/md_theme_dark_surface</item>
<item name="colorOnSurface">@color/md_theme_dark_onSurface</item> <item name="colorOnSurface">@color/md_theme_dark_onSurface</item>
<item name="actionBarItemBackground">@color/md_theme_dark_surface</item> <item name="colorPrimaryDark">@color/colorAccent</item>
<item name="colorAccent">@color/md_theme_dark_onBackground</item>
</style> </style>
<style name="Theme.P2play.NoActionBar" parent="Theme.P2play"> <style name="Theme.P2play.NoActionBar" parent="Theme.P2play">

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<color name="colorPrimary">#3F51B5</color> <color name="colorPrimary">#9F4200</color>
<color name="colorPrimaryDark">#303F9F</color> <color name="colorPrimaryDark">#F4DED5</color>
<color name="colorAccent">#FF4081</color> <color name="colorAccent">#0f3239</color>
<color name="colorHeader">#ffffff</color> <color name="colorHeader">#ffffff</color>
<color name="colorBody">#fff</color> <color name="colorBody">#fff</color>
<color name="colorMenu">#000</color> <color name="colorMenu">#000</color>

View File

@ -1,6 +1,6 @@
<resources> <resources>
<style name="Theme.P2play" parent="Theme.MaterialComponents"> <style name="Theme.P2play" parent="Theme.MaterialComponents.DayNight">
<item name="colorPrimary">@color/md_theme_light_primary</item> <item name="colorPrimary">@color/md_theme_light_primary</item>
<item name="colorOnPrimary">@color/md_theme_light_onPrimary</item> <item name="colorOnPrimary">@color/md_theme_light_onPrimary</item>
<item name="colorSecondary">@color/md_theme_light_secondary</item> <item name="colorSecondary">@color/md_theme_light_secondary</item>
@ -11,7 +11,8 @@
<item name="colorOnBackground">@color/md_theme_light_onBackground</item> <item name="colorOnBackground">@color/md_theme_light_onBackground</item>
<item name="colorSurface">@color/md_theme_light_surface</item> <item name="colorSurface">@color/md_theme_light_surface</item>
<item name="colorOnSurface">@color/md_theme_light_onSurface</item> <item name="colorOnSurface">@color/md_theme_light_onSurface</item>
<item name="actionBarItemBackground">@color/md_theme_light_surface</item> <item name="colorPrimaryDark">@color/md_theme_light_primary</item>
<item name="colorAccent">@color/md_theme_light_onPrimary</item>
</style> </style>
<style name="Theme.P2play.NoActionBar" parent="Theme.P2play"> <style name="Theme.P2play.NoActionBar" parent="Theme.P2play">

View File

@ -5,7 +5,7 @@
<EditTextPreference <EditTextPreference
android:capitalize="words" android:capitalize="words"
android:defaultValue="@string/pref_hostname_error" android:defaultValue="@string/pref_hostname_error"
android:inputType="textCapWords" android:inputType="text"
android:key="hostP2play" android:key="hostP2play"
android:maxLines="1" android:maxLines="1"
android:selectAllOnFocus="true" android:selectAllOnFocus="true"

View File

@ -1,11 +1,14 @@
<preference-headers xmlns:android="http://schemas.android.com/apk/res/android"> <preference-headers xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto">
<!-- These settings headers are only used on tablets. --> <!-- These settings headers are only used on tablets. -->
<header <header
android:fragment="org.libre.agosto.p2play.SettingsActivity$GeneralPreferenceFragment" android:fragment="org.libre.agosto.p2play.SettingsActivity$GeneralPreferenceFragment"
android:icon="@drawable/ic_info_black_24dp" android:icon="@drawable/ic_info_black_24dp"
android:title="@string/pref_header_general" /> android:title="@string/pref_header_general"
android:textColor="@color/md_theme_light_secondary"/>
<!-- <header <!-- <header
android:fragment="org.libre.agosto.p2play.SettingsActivity$NotificationPreferenceFragment" android:fragment="org.libre.agosto.p2play.SettingsActivity$NotificationPreferenceFragment"