scrollable convert fragments

This commit is contained in:
mmk2410 2015-02-16 00:55:37 +01:00
parent d2ec5b9d6a
commit 86fe38e263
10 changed files with 578 additions and 466 deletions

File diff suppressed because it is too large Load diff

View file

@ -4,7 +4,10 @@ import android.content.Intent;
import android.content.res.Resources; import android.content.res.Resources;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.support.v7.widget.CardView;
import android.view.View; import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import it.neokree.materialnavigationdrawer.MaterialNavigationDrawer; import it.neokree.materialnavigationdrawer.MaterialNavigationDrawer;
import it.neokree.materialnavigationdrawer.elements.MaterialSection; import it.neokree.materialnavigationdrawer.elements.MaterialSection;
@ -36,19 +39,43 @@ public class MainActivity extends MaterialNavigationDrawer {
} }
public void normalMorseEncode(View view){ public void normalMorseEncode(View view){
EditText text = (EditText) findViewById(R.id.editTextNormalMorse);
TextView test = (TextView) findViewById(R.id.outputNormalMorse);
CardView cardView = (CardView) findViewById(R.id.cardViewNormalMorseOutput);
if(cardView.getVisibility() == View.INVISIBLE){
cardView.setVisibility(View.VISIBLE);
}
test.setText(text.getText());
} }
public void normalMorseDecode(View view){ public void normalMorseDecode(View view){
EditText text = (EditText) findViewById(R.id.editTextNormalMorse);
TextView test = (TextView) findViewById(R.id.outputNormalMorse);
CardView cardView = (CardView) findViewById(R.id.cardViewNormalMorseOutput);
if(cardView.getVisibility() == View.INVISIBLE){
cardView.setVisibility(View.VISIBLE);
}
test.setText(text.getText());
} }
public void writtenMorseEncode(View view){ public void writtenMorseEncode(View view){
EditText text = (EditText) findViewById(R.id.editTextWrittenMorse);
TextView test = (TextView) findViewById(R.id.outputWrittenMorse);
CardView cardView = (CardView) findViewById(R.id.cardViewWrittenMorseOutput);
if(cardView.getVisibility() == View.INVISIBLE){
cardView.setVisibility(View.VISIBLE);
}
test.setText(text.getText());
} }
public void writtenMorseDecode(View view){ public void writtenMorseDecode(View view){
EditText text = (EditText) findViewById(R.id.editTextWrittenMorse);
TextView test = (TextView) findViewById(R.id.outputWrittenMorse);
CardView cardView = (CardView) findViewById(R.id.cardViewWrittenMorseOutput);
if(cardView.getVisibility() == View.INVISIBLE){
cardView.setVisibility(View.VISIBLE);
}
test.setText(text.getText());
} }
//called when clicking on the version entry in the about fragment //called when clicking on the version entry in the about fragment

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

View file

@ -1,11 +0,0 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity">
<TextView android:text="@string/hello_world" android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</RelativeLayout>

View file

@ -20,15 +20,24 @@
Version 1.1.0 Version 1.1.0
--> -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main" android:id="@+id/main"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:gravity="top"
android:orientation="vertical" android:orientation="vertical"
tools:context=".MainActivity"> tools:context=".MainActivity"
android:animateLayoutChanges="true">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/scrollView2">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.CardView <android.support.v7.widget.CardView
xmlns:card_view="http://schemas.android.com/apk/res-auto" xmlns:card_view="http://schemas.android.com/apk/res-auto"
@ -43,38 +52,45 @@
android:id="@+id/linearLayout1" android:id="@+id/linearLayout1"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="24dp" android:layout_marginTop="24dp"
android:layout_marginBottom="8dp"
android:gravity="center" android:gravity="center"
android:minHeight="48dp" android:minHeight="48dp"
android:orientation="vertical" android:orientation="vertical"
> >
<EditText <EditText
android:id="@+id/edit_message" android:id="@+id/editTextWrittenMorse"
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:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:hint="@string/edit_message" android:hint="@string/edit_message"
android:scrollbars="vertical" android:scrollbars="vertical"
android:minLines="5"> android:minLines="5"
</EditText> android:singleLine="false"
android:background="@color/cardview_light_background"
android:textCursorDrawable="@color/colorPrimary"/>
<View
style="@style/Divider"
/>
<LinearLayout <LinearLayout
android:orientation="horizontal" android:orientation="horizontal"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="48dp"
android:layout_marginTop="16dp" android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:gravity="center" android:gravity="center"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:layout_gravity="right" android:layout_gravity="right"
android:height="48dp"
android:baselineAligned="false"> android:baselineAligned="false">
<TextView <TextView
style="@style/TextViewButton" style="@style/TextViewButton"
android:layout_marginRight="6dp" android:layout_marginRight="8dp"
android:onClick="writtenMorseDecode" android:onClick="writtenMorseDecode"
android:text="@string/button_decode" /> android:text="@string/button_decode" />
@ -88,4 +104,70 @@
</LinearLayout> </LinearLayout>
</android.support.v7.widget.CardView> </android.support.v7.widget.CardView>
</RelativeLayout>
<android.support.v7.widget.CardView
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="@+id/cardViewWrittenMorseOutput"
android:layout_margin="8dp"
card_view:cardCornerRadius="2dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="invisible">
<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="24dp"
android:gravity="center"
android:minHeight="48dp"
android:orientation="vertical"
>
<TextView
android:id="@+id/outputWrittenMorse"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="16sp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginBottom="8dp"
android:hint="@string/output_message"
android:singleLine="false"
android:background="@color/cardview_light_background"/>
<View
style="@style/Divider"
/>
<LinearLayout
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="48dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:gravity="center"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:layout_gravity="right"
android:baselineAligned="false">
<TextView
style="@style/TextViewButton"
android:layout_marginRight="8dp"
android:onClick="writtenMorseDecode"
android:text="@string/button_copy" />
<TextView
style="@style/TextViewButton"
android:onClick="writtenMorseEncode"
android:text="@string/button_share" />
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
</ScrollView>
</LinearLayout>

View file

@ -20,15 +20,26 @@
Version 1.1.0 Version 1.1.0
--> -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main" android:id="@+id/main"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:gravity="top" android:gravity="top"
android:orientation="vertical" android:orientation="vertical"
tools:context=".MainActivity"> tools:context=".MainActivity"
android:animateLayoutChanges="true"
android:scrollbars="vertical">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/scrollView3">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<android.support.v7.widget.CardView <android.support.v7.widget.CardView
xmlns:card_view="http://schemas.android.com/apk/res-auto" xmlns:card_view="http://schemas.android.com/apk/res-auto"
@ -43,39 +54,44 @@
android:id="@+id/linearLayout1" android:id="@+id/linearLayout1"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="24dp" android:layout_marginTop="24dp"
android:layout_marginBottom="8dp"
android:gravity="center" android:gravity="center"
android:minHeight="48dp" android:minHeight="48dp"
android:orientation="vertical" android:orientation="vertical"
> >
<EditText <EditText
android:id="@+id/edit_message" android:id="@+id/editTextNormalMorse"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:ems="10" android:ems="10"
android:hint="@string/edit_message" android:hint="@string/edit_message"
android:scrollbars="vertical" android:background="@color/cardview_light_background"
android:minLines="5"> android:minLines="5"
android:textCursorDrawable="@color/colorPrimary">
</EditText> </EditText>
<View
style="@style/Divider" />
<LinearLayout <LinearLayout
android:orientation="horizontal" android:orientation="horizontal"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="48dp"
android:layout_marginTop="16dp" android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:gravity="center" android:gravity="center"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:layout_gravity="right" android:layout_gravity="right"
android:height="48dp"
android:baselineAligned="false"> android:baselineAligned="false">
<TextView <TextView
style="@style/TextViewButton" style="@style/TextViewButton"
android:onClick="normalMorseDecode" android:onClick="normalMorseDecode"
android:layout_marginRight="6dp" android:layout_marginRight="8dp"
android:text="@string/button_decode" /> android:text="@string/button_decode" />
<TextView <TextView
@ -89,4 +105,71 @@
</LinearLayout> </LinearLayout>
</android.support.v7.widget.CardView> </android.support.v7.widget.CardView>
</RelativeLayout>
<android.support.v7.widget.CardView
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="@+id/cardViewNormalMorseOutput"
android:layout_margin="8dp"
card_view:cardCornerRadius="2dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="invisible">
<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="24dp"
android:gravity="center"
android:minHeight="48dp"
android:orientation="vertical"
>
<TextView
android:id="@+id/outputNormalMorse"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="16sp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginBottom="8dp"
android:hint="@string/output_message"
android:scrollbars="vertical"
android:singleLine="false"
android:background="@color/cardview_light_background"/>
<View
style="@style/Divider"
/>
<LinearLayout
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="48dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:gravity="center"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:layout_gravity="right"
android:baselineAligned="false">
<TextView
style="@style/TextViewButton"
android:layout_marginRight="8dp"
android:onClick="writtenMorseDecode"
android:text="@string/button_copy" />
<TextView
style="@style/TextViewButton"
android:onClick="writtenMorseEncode"
android:text="@string/button_share" />
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
</ScrollView>
</LinearLayout>

View file

@ -1,6 +0,0 @@
<menu 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" tools:context=".MainActivity">
<item android:id="@+id/action_settings" android:title="@string/action_settings"
android:orderInCategory="100" app:showAsAction="never" />
</menu>

View file

@ -47,4 +47,7 @@
<string name="sectionHow">Anleitung</string> <string name="sectionHow">Anleitung</string>
<string name="sectionLicense">Lizens</string> <string name="sectionLicense">Lizens</string>
<string name="sectionMissing">Fehlender Code</string> <string name="sectionMissing">Fehlender Code</string>
<!--Output Text Buttons-->
<string name="button_share">TEILEN</string>
<string name="button_copy">KOPIEREN</string>
</resources> </resources>

View file

@ -54,4 +54,7 @@
<!--Drawer Titles--> <!--Drawer Titles-->
<string name="about">About</string> <string name="about">About</string>
<string name="normalMorse">Normal Morse</string> <string name="normalMorse">Normal Morse</string>
<!--Output Text Buttons-->
<string name="button_share">SHARE</string>
<string name="button_copy">COPY</string>
</resources> </resources>

View file

@ -32,17 +32,21 @@
<style name="Divider"> <style name="Divider">
<item name="android:layout_width">fill_parent</item> <item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">0.5dp</item> <item name="android:layout_height">1dp</item>
<item name="android:background">@color/ripple_material_dark</item> <item name="android:height">1dp</item>
<item name="android:background">@color/ripple_material_light</item>
</style> </style>
<style name="TextViewButton"> <style name="TextViewButton">
<item name="android:layout_height">36dp</item> <item name="android:layout_height">36dp</item>
<item name="android:layout_width">wrap_content</item> <item name="android:layout_width">wrap_content</item>
<item name="android:minWidth">64dp</item> <item name="android:minWidth">64dp</item>
<item name="android:height">36dp</item> <item name="android:layout_marginLeft">4dp</item>
<item name="android:layout_marginRight">4dp</item>
<item name="android:paddingRight">8dp</item>
<item name="android:paddingLeft">8dp</item>
<item name="android:textColor">@color/colorPrimary</item> <item name="android:textColor">@color/colorPrimary</item>
<item name="android:gravity">center|right</item> <item name="android:gravity">center</item>
<item name="android:background">@drawable/button_action</item> <item name="android:background">@drawable/button_action</item>
<item name="android:src">@color/cardview_light_background</item> <item name="android:src">@color/cardview_light_background</item>
</style> </style>