Skip to content

Instantly share code, notes, and snippets.

@amirul12
Created November 19, 2019 09:56
Show Gist options
  • Select an option

  • Save amirul12/f625eee4779b8733ec0d5188d19ed8b4 to your computer and use it in GitHub Desktop.

Select an option

Save amirul12/f625eee4779b8733ec0d5188d19ed8b4 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.main.MainActivity">
<android.support.v7.widget.CardView
android:id="@+id/card_news"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:clickable="true"
android:focusable="true"
android:foreground="?attr/selectableItemBackground"
app:layout_constraintBottom_toTopOf="@+id/card_search"
app:layout_constraintEnd_toStartOf="@+id/card_archive"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorRed">
<TextView
android:id="@+id/txt_main_news"
style="@style/MainMenuTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableTop="@drawable/ic_format_list_bulleted_white_48dp"
android:text="@string/main_menu_news" />
</FrameLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:id="@+id/card_archive"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_marginTop="8dp"
android:clickable="true"
android:focusable="true"
android:foreground="?attr/selectableItemBackground"
app:layout_constraintBottom_toTopOf="@+id/card_settings"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/card_news"
app:layout_constraintTop_toTopOf="parent">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorBlue">
<TextView
android:id="@+id/txt_main_archive"
style="@style/MainMenuTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableTop="@drawable/ic_bookmark_border_white_48dp"
android:text="@string/main_menu_archive" />
</FrameLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:id="@+id/card_search"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginStart="8dp"
android:clickable="true"
android:focusable="true"
android:foreground="?attr/selectableItemBackground"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/card_settings"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/card_news">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorGreen">
<TextView
android:id="@+id/txt_main_search"
style="@style/MainMenuTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableTop="@drawable/ic_search_white_48dp"
android:text="@string/main_menu_search" />
</FrameLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:id="@+id/card_settings"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:clickable="true"
android:focusable="true"
android:foreground="?attr/selectableItemBackground"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/card_search"
app:layout_constraintTop_toBottomOf="@+id/card_archive">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorYellow">
<TextView
android:id="@+id/txt_main_settings"
style="@style/MainMenuTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableTop="@drawable/ic_tune_white_48dp"
android:text="@string/main_menu_settings" />
</FrameLayout>
</android.support.v7.widget.CardView>
</android.support.constraint.ConstraintLayout>
@amirul12

Copy link
Copy Markdown
Author
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
</style>

<style name="RedTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorRed</item>
    <item name="colorPrimaryDark">@color/colorRedDark</item>
    <item name="colorAccent">@color/colorAccent</item>
</style>

<style name="GreenTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorGreen</item>
    <item name="colorPrimaryDark">@color/colorGreenDark</item>
    <item name="colorAccent">@color/colorGreen</item>
</style>

<style name="BlueTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorBlue</item>
    <item name="colorPrimaryDark">@color/colorBlueDark</item>
    <item name="colorAccent">@color/colorBlue</item>
</style>

<style name="MainMenuTextView">
    <item name="android:textColor">#FFFFFF</item>
    <item name="android:textAllCaps">true</item>
    <item name="android:textSize">18sp</item>
    <item name="android:layout_gravity">center</item>
</style>

<style name="SelectableItemTheme">
    <item name="colorControlHighlight">@color/colorPrimaryDark</item>
</style>

<style name="SelectableItemBackground">
    <item name="android:theme">@style/SelectableItemTheme</item>
    <item name="android:background">?attr/selectableItemBackground</item>
</style>

<style name="FullscreenTheme" parent="AppTheme">
    <item name="android:windowActionBarOverlay">true</item>
    <item name="android:windowBackground">@null</item>
    <item name="metaButtonBarStyle">?android:attr/buttonBarStyle</item>
    <item name="metaButtonBarButtonStyle">?android:attr/buttonBarButtonStyle</item>
</style>

@amirul12

Copy link
Copy Markdown
Author
#808080 #4d4d4d #D32F2F
<color name="colorTextPrimary">#212121</color>
<color name="colorTextSecondary">#757575</color>
<color name="colorYellow">#FFC107</color>
<color name="colorYellowDark">#FFA000</color>
<color name="colorGreen">#4CAF50</color>
<color name="colorGreenDark">#388E3C</color>
<color name="colorBlue">#536DFE</color>
<color name="colorBlueDark">#303F9F</color>
<color name="colorRed">#D32F2F</color>
<color name="colorRedDark">#a00c0c</color>

@amirul12

Copy link
Copy Markdown
Author
News Digest News Digest - Archive ArticleActivity News Digest - Search News Digest - Sources
<string name="action_menu_search">Search</string>
<string name="action_menu_clear">Clear</string>
<string name="action_menu_archive">Go to Archive</string>
<string name="action_yes">Yes</string>
<string name="action_no">No</string>
<string name="action_undo">Undo</string>
<string name="msg_clear">Are you sure you want to delete all archived articles?</string>
<string name="msg_removed">Article removed.</string>
<string name="msg_archived">Article archived.</string>
<string name="msg_already_archived">Already in archive!</string>
<string name="main_menu_settings">Settings</string>
<string name="main_menu_search">Search</string>
<string name="main_menu_archive">Archive</string>
<string name="main_menu_news">News</string>
<string name="hint_query">Enter query…</string>
<string name="msg_query_short">query too short!</string>
<string name="sources_category">Category:</string>
<string name="error_network">Error! Please check your network connection.</string>
<string name="title_dialog">Caution!</string>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment