Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bug in custome styles #19

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions app/src/main/res/layout/fragment_draggable_tv_show.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/AppTheme.RootView">
style="@style/CustomeStyle.RootView">

<!-- ProgressBar -->

<ProgressBar
android:id="@+id/pb_loading"
style="@style/AppTheme.ProgressBar"/>
style="@style/CustomeStyle.ProgressBar"/>

<!-- DraggableView -->

Expand All @@ -29,14 +29,14 @@
<ListView
android:id="@+id/lv_chapters"
android:layout_below="@+id/iv_fan_art"
style="@style/AppTheme.ListView"/>
style="@style/CustomeStyle.ListView"/>

<!-- TvShow Fan Art -->

<ImageView
android:id="@+id/iv_fan_art"
android:layout_alignParentTop="true"
style="@style/AppTheme.Image.TvShowFranArt"/>
style="@style/CustomeStyle.Image.TvShowFranArt"/>

</com.github.pedrovgs.DraggableView>

Expand Down
10 changes: 5 additions & 5 deletions app/src/main/res/layout/fragment_tv_show.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,34 @@
android:layout_height="match_parent">

<LinearLayout
style="@style/AppTheme.RootView.Vertical">
style="@style/CustomeStyle.RootView.Vertical">

<!-- TvShow Fan Art -->

<ImageView
android:id="@+id/iv_fan_art"
style="@style/AppTheme.Image.TvShowFranArt"/>
style="@style/CustomeStyle.Image.TvShowFranArt"/>

<!-- ListView Chapters -->

<ListView
android:id="@+id/lv_chapters"
android:visibility="gone"
style="@style/AppTheme.ListView"/>
style="@style/CustomeStyle.ListView"/>

</LinearLayout>

<!-- ProgressBar -->

<ProgressBar
android:id="@+id/pb_loading"
style="@style/AppTheme.ProgressBar"/>
style="@style/CustomeStyle.ProgressBar"/>

<!-- EmptyCase -->

<ImageView
android:id="@+id/v_empty_case"
style="@style/AppTheme.EmptyCase"/>
style="@style/CustomeStyle.EmptyCase"/>


</FrameLayout>
8 changes: 4 additions & 4 deletions app/src/main/res/layout/fragment_tv_shows.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:context="com.github.pedrovgs.effectiveandroidui.ui.activity.MainActivity$PlaceholderFragment"
style="@style/AppTheme.RootView">
style="@style/CustomeStyle.RootView">

<!-- ProgressBar -->

<ProgressBar
android:id="@+id/pb_loading"
style="@style/AppTheme.ProgressBar"/>
style="@style/CustomeStyle.ProgressBar"/>

<!-- EmptyCase -->

<ImageView
android:id="@+id/v_empty_case"
style="@style/AppTheme.EmptyCase"/>
style="@style/CustomeStyle.EmptyCase"/>

<!-- GridView -->

<GridView
android:id="@+id/gv_tv_shows"
style="@style/AppTheme.GridView"/>
style="@style/CustomeStyle.GridView"/>

</RelativeLayout>
2 changes: 1 addition & 1 deletion app/src/main/res/layout/header_tv_show_chapters.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView
style="@style/AppTheme.TextListViewHeader"/>
style="@style/CustomeStyle.TextListViewHeader"/>
8 changes: 4 additions & 4 deletions app/src/main/res/layout/row_tv_show.xml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/v_row_container"
style="@style/AppTheme.TvShow">
style="@style/CustomeStyle.TvShow">

<ImageView
android:id="@+id/iv_thumbnail"
style="@style/AppTheme.Image.TvShow"
style="@style/CustomeStyle.Image.TvShow"
android:layout_alignParentTop="true"/>

<TextView
android:id="@+id/tv_title"
android:layout_below="@+id/iv_thumbnail"
style="@style/AppTheme.Title.TvShow"/>
style="@style/CustomeStyle.Title.TvShow"/>

<TextView
android:id="@+id/tv_seasons_counter"
android:layout_below="@+id/tv_title"
style="@style/AppTheme.Subtitle.TvShow"/>
style="@style/CustomeStyle.Subtitle.TvShow"/>

</RelativeLayout>
32 changes: 17 additions & 15 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,50 +6,52 @@
<style name="AppTheme" parent="Theme.AppCompat.Light">
<item name="android:windowBackground">@color/main_color</item>
</style>

<style name="CustomeStyle" />ss

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In English this word is "Custom" not custome


<style name="AppTheme.RootView">
<style name="CustomeStyle.RootView">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">match_parent</item>
</style>

<style name="AppTheme.RootView.Vertical">
<style name="CustomeStyle.RootView.Vertical">
<item name="android:orientation">vertical</item>
</style>

<style name="AppTheme.Image">
<style name="CustomeStyle.Image">
<item name="android:scaleType">centerCrop</item>
<item name="android:background">@color/main_color</item>
</style>

<style name="AppTheme.Title">
<style name="CustomeStyle.Title">
<item name="android:textStyle">bold</item>
<item name="android:textColor">@color/fourth_color</item>
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
</style>

<style name="AppTheme.Subtitle">
<style name="CustomeStyle.Subtitle">
<item name="android:textColor">@color/third_color</item>
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
</style>

<style name="AppTheme.GridView">
<style name="CustomeStyle.GridView">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">match_parent</item>
<item name="android:numColumns">@integer/tv_shows_grid_view_num_colums</item>
<item name="android:verticalSpacing">@dimen/main_margin</item>
<item name="android:horizontalSpacing">@dimen/main_margin</item>
</style>

<style name="AppTheme.ListView">
<style name="CustomeStyle.ListView">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">match_parent</item>
<item name="android:dividerHeight">@dimen/divider_height</item>
<item name="android:divider">@color/sixth_color</item>
</style>

<style name="AppTheme.ProgressBar">
<style name="CustomeStyle.ProgressBar">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_centerVertical">true</item>
Expand All @@ -58,7 +60,7 @@
<item name="android:visibility">gone</item>
</style>

<style name="AppTheme.EmptyCase">
<style name="CustomeStyle.EmptyCase">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_centerVertical">true</item>
Expand All @@ -69,36 +71,36 @@
<item name="android:src">@drawable/empty_case</item>
</style>

<style name="AppTheme.TvShow">
<style name="CustomeStyle.TvShow">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:background">@color/secondary_color</item>
</style>

<style name="AppTheme.Image.TvShow">
<style name="CustomeStyle.Image.TvShow">
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">@dimen/poster_height</item>
</style>

<style name="AppTheme.Title.TvShow">
<style name="CustomeStyle.Title.TvShow">
<item name="android:ellipsize">end</item>
<item name="android:singleLine">true</item>
<item name="android:layout_marginLeft">@dimen/secondary_margin</item>
</style>

<style name="AppTheme.Subtitle.TvShow">
<style name="CustomeStyle.Subtitle.TvShow">
<item name="android:ellipsize">end</item>
<item name="android:singleLine">true</item>
<item name="android:layout_marginLeft">@dimen/secondary_margin</item>
<item name="android:paddingBottom">@dimen/main_margin</item>
</style>

<style name="AppTheme.Image.TvShowFranArt">
<style name="CustomeStyle.Image.TvShowFranArt">
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">@dimen/fan_art_height</item>
</style>

<style name="AppTheme.TextListViewHeader">
<style name="CustomeStyle.TextListViewHeader">
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_width">match_parent</item>
<item name="android:background">@color/secondary_color</item>
Expand Down