designing all clickable objects
This commit is contained in:
parent
1c47c45ebe
commit
d2ec5b9d6a
11 changed files with 94 additions and 56 deletions
|
@ -35,6 +35,22 @@ public class MainActivity extends MaterialNavigationDrawer {
|
||||||
this.disableLearningPattern(); //Doesn't open the drawer always when the app starts
|
this.disableLearningPattern(); //Doesn't open the drawer always when the app starts
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void normalMorseEncode(View view){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void normalMorseDecode(View view){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void writtenMorseEncode(View view){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void writtenMorseDecode(View view){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
//called when clicking on the version entry in the about fragment
|
//called when clicking on the version entry in the about fragment
|
||||||
//opens the app page (de.marcelkapfer.morseconverter)
|
//opens the app page (de.marcelkapfer.morseconverter)
|
||||||
public void versionEntry(View view){
|
public void versionEntry(View view){
|
||||||
|
|
10
app/src/main/res/drawable-v21/button_action.xml
Normal file
10
app/src/main/res/drawable-v21/button_action.xml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:color="@color/ripple_material_light">
|
||||||
|
<item>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<corners android:radius="1dp" />
|
||||||
|
<solid android:color="@color/cardview_light_background"/>
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</ripple>
|
10
app/src/main/res/drawable-v21/linearlayout_action.xml
Normal file
10
app/src/main/res/drawable-v21/linearlayout_action.xml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:color="@color/ripple_material_light">
|
||||||
|
<item>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<corners android:radius="1dp" />
|
||||||
|
<solid android:color="@color/white"/>
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</ripple>
|
5
app/src/main/res/drawable/button_action.xml
Normal file
5
app/src/main/res/drawable/button_action.xml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:drawable="@color/ripple_material_light" android:state_pressed="true"/>
|
||||||
|
<item android:drawable="@color/cardview_light_background"/>
|
||||||
|
</selector>
|
5
app/src/main/res/drawable/linearlayout_action.xml
Normal file
5
app/src/main/res/drawable/linearlayout_action.xml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:drawable="@color/ripple_material_light" android:state_pressed="true"/>
|
||||||
|
<item android:drawable="@color/white"/>
|
||||||
|
</selector>
|
|
@ -72,30 +72,16 @@
|
||||||
android:height="48dp"
|
android:height="48dp"
|
||||||
android:baselineAligned="false">
|
android:baselineAligned="false">
|
||||||
|
|
||||||
<Button
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
style="@style/TextViewButton"
|
||||||
android:layout_height="36dp"
|
android:layout_marginRight="6dp"
|
||||||
android:layout_marginRight="8dp"
|
android:onClick="writtenMorseDecode"
|
||||||
android:minWidth="64dp"
|
android:text="@string/button_decode" />
|
||||||
android:height="36dp"
|
|
||||||
android:onClick="decode"
|
|
||||||
android:text="@string/button_decode"
|
|
||||||
android:background="@color/cardview_light_background"
|
|
||||||
android:textColor="#2196F3"
|
|
||||||
android:gravity="center|right"
|
|
||||||
style="?android:attr/borderlessButtonStyle" />
|
|
||||||
|
|
||||||
<Button
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
style="@style/TextViewButton"
|
||||||
android:layout_height="36dp"
|
android:onClick="writtenMorseEncode"
|
||||||
android:minWidth="64dp"
|
android:text="@string/button_encode" />
|
||||||
android:height="36dp"
|
|
||||||
android:onClick="encode"
|
|
||||||
android:text="@string/button_encode"
|
|
||||||
android:textColor="#2196F3"
|
|
||||||
android:gravity="center|right"
|
|
||||||
style="?android:attr/borderlessButtonStyle"
|
|
||||||
android:background="@color/cardview_light_background" />
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -72,30 +72,17 @@
|
||||||
android:height="48dp"
|
android:height="48dp"
|
||||||
android:baselineAligned="false">
|
android:baselineAligned="false">
|
||||||
|
|
||||||
<Button
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
style="@style/TextViewButton"
|
||||||
android:layout_height="36dp"
|
android:onClick="normalMorseDecode"
|
||||||
android:layout_marginRight="8dp"
|
android:layout_marginRight="6dp"
|
||||||
android:minWidth="64dp"
|
android:text="@string/button_decode" />
|
||||||
android:height="36dp"
|
|
||||||
android:onClick="decode"
|
<TextView
|
||||||
android:text="@string/button_decode"
|
style="@style/TextViewButton"
|
||||||
android:background="@color/cardview_light_background"
|
android:onClick="normalMorseEncode"
|
||||||
android:textColor="#2196F3"
|
android:text="@string/button_encode" />
|
||||||
android:gravity="center|right"
|
|
||||||
style="?android:attr/borderlessButtonStyle" />
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="36dp"
|
|
||||||
android:minWidth="64dp"
|
|
||||||
android:height="36dp"
|
|
||||||
android:onClick="encode"
|
|
||||||
android:text="@string/button_encode"
|
|
||||||
android:textColor="#2196F3"
|
|
||||||
android:gravity="center|right"
|
|
||||||
style="?android:attr/borderlessButtonStyle"
|
|
||||||
android:background="@color/cardview_light_background" />
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -27,8 +27,8 @@
|
||||||
<string name="app_name">Morse Converter</string>
|
<string name="app_name">Morse Converter</string>
|
||||||
<string name="action_settings">Einstellungen</string>
|
<string name="action_settings">Einstellungen</string>
|
||||||
<string name="edit_message">Geben Sie einen Text ein</string>
|
<string name="edit_message">Geben Sie einen Text ein</string>
|
||||||
<string name="button_decode">Verschlüsseln</string>
|
<string name="button_decode">VERSCHLÜSSELN</string>
|
||||||
<string name="button_encode">Entschlüsseln</string>
|
<string name="button_encode">ENTSCHLÜSSELN</string>
|
||||||
<string name="title_activity_display_message">Ihr Text</string>
|
<string name="title_activity_display_message">Ihr Text</string>
|
||||||
<string name="hello_world">Hallo Welt</string>
|
<string name="hello_world">Hallo Welt</string>
|
||||||
<string name="action_search">Suche</string>
|
<string name="action_search">Suche</string>
|
||||||
|
|
6
app/src/main/res/values/colors.xml
Normal file
6
app/src/main/res/values/colors.xml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<color name="white">#ffffff</color>
|
||||||
|
<color name="colorPrimary">#2196F3</color>
|
||||||
|
<color name="colorPrimaryDark">#1976D2</color>
|
||||||
|
</resources>
|
|
@ -25,8 +25,8 @@
|
||||||
<string name="app_name">Morse Converter</string>
|
<string name="app_name">Morse Converter</string>
|
||||||
<string name="action_settings">Settings</string>
|
<string name="action_settings">Settings</string>
|
||||||
<string name="edit_message">Enter a Message</string>
|
<string name="edit_message">Enter a Message</string>
|
||||||
<string name="button_decode">Encrypt</string>
|
<string name="button_decode">ENCRYPT</string>
|
||||||
<string name="button_encode">Decrypt</string>
|
<string name="button_encode">DECRYPT</string>
|
||||||
<string name="title_activity_display_message">Your Message</string>
|
<string name="title_activity_display_message">Your Message</string>
|
||||||
<string name="hello_world">Hello world!</string>
|
<string name="hello_world">Hello world!</string>
|
||||||
<string name="action_search">Search</string>
|
<string name="action_search">Search</string>
|
||||||
|
|
|
@ -3,9 +3,9 @@
|
||||||
<!-- Base application theme. -->
|
<!-- Base application theme. -->
|
||||||
<style name="AppTheme" parent="MaterialNavigationDrawerTheme.Light.DarkActionBar.TranslucentKitKatStatusBar">
|
<style name="AppTheme" parent="MaterialNavigationDrawerTheme.Light.DarkActionBar.TranslucentKitKatStatusBar">
|
||||||
<!-- Customize your theme here. -->
|
<!-- Customize your theme here. -->
|
||||||
<item name="colorPrimary">#2196F3</item>
|
<item name="colorPrimary">@color/colorPrimary</item>
|
||||||
<item name="colorPrimaryDark">#1976D2</item>
|
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||||
<item name="colorAccent">#FFFFFF</item>
|
<item name="colorAccent">@color/white</item>
|
||||||
<item name="drawerType">@integer/DRAWERTYPE_IMAGE</item>
|
<item name="drawerType">@integer/DRAWERTYPE_IMAGE</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
@ -14,8 +14,12 @@
|
||||||
<item name="android:layout_height">wrap_content</item>
|
<item name="android:layout_height">wrap_content</item>
|
||||||
<item name="android:paddingTop">16dp</item>
|
<item name="android:paddingTop">16dp</item>
|
||||||
<item name="android:paddingBottom">20dp</item>
|
<item name="android:paddingBottom">20dp</item>
|
||||||
|
<item name="android:paddingLeft">16dp</item>
|
||||||
|
<item name="android:paddingRight">16dp</item>
|
||||||
<item name="android:gravity">center</item>
|
<item name="android:gravity">center</item>
|
||||||
<item name="android:orientation">vertical</item>
|
<item name="android:orientation">vertical</item>
|
||||||
|
<item name="android:background">@drawable/linearlayout_action</item>
|
||||||
|
<item name="android:src">@color/white</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="LinearLayoutListContainer">
|
<style name="LinearLayoutListContainer">
|
||||||
|
@ -23,9 +27,7 @@
|
||||||
<item name="android:layout_height">wrap_content</item>
|
<item name="android:layout_height">wrap_content</item>
|
||||||
<item name="android:orientation">vertical</item>
|
<item name="android:orientation">vertical</item>
|
||||||
<item name="android:layout_marginTop">8dp</item>
|
<item name="android:layout_marginTop">8dp</item>
|
||||||
<item name="android:layout_marginEnd">8dp</item>
|
<item name="android:layout_marginBottom">8dp</item>
|
||||||
<item name="android:paddingLeft">16dp</item>
|
|
||||||
<item name="android:paddingRight">16dp</item>
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="Divider">
|
<style name="Divider">
|
||||||
|
@ -34,4 +36,15 @@
|
||||||
<item name="android:background">@color/ripple_material_dark</item>
|
<item name="android:background">@color/ripple_material_dark</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style name="TextViewButton">
|
||||||
|
<item name="android:layout_height">36dp</item>
|
||||||
|
<item name="android:layout_width">wrap_content</item>
|
||||||
|
<item name="android:minWidth">64dp</item>
|
||||||
|
<item name="android:height">36dp</item>
|
||||||
|
<item name="android:textColor">@color/colorPrimary</item>
|
||||||
|
<item name="android:gravity">center|right</item>
|
||||||
|
<item name="android:background">@drawable/button_action</item>
|
||||||
|
<item name="android:src">@color/cardview_light_background</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
Reference in a new issue