Skip to content

Commit

Permalink
Implemented Stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
supermar1010 committed May 8, 2018
1 parent 10e2dbf commit e16815c
Show file tree
Hide file tree
Showing 18 changed files with 46 additions and 142 deletions.
1 change: 1 addition & 0 deletions App/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ dependencies {
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
Expand Down
6 changes: 5 additions & 1 deletion App/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.thomaskoscheck.wgverwaltung">

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<application
Expand All @@ -22,6 +22,10 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".SettingsActivity"
android:label="@string/title_activity_settings_activty"
android:theme="@style/AppTheme.NoActionBar"></activity>
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package de.thomaskoscheck.wgverwaltung;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
Expand All @@ -11,6 +12,7 @@
public class MainActivity extends AppCompatActivity {
EditText product;
EditText price;
Settings settings;

@Override
protected void onCreate(Bundle savedInstanceState) {
Expand All @@ -20,6 +22,7 @@ protected void onCreate(Bundle savedInstanceState) {
setSupportActionBar(toolbar);
product = findViewById(R.id.product);
price = findViewById(R.id.price);
settings = SettingsStore.load(this);
}

@Override
Expand All @@ -38,9 +41,10 @@ public boolean onOptionsItemSelected(MenuItem item) {

//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
Intent intent = new Intent(this, SettingsActivity.class);
startActivity(intent);
return true;
}

return super.onOptionsItemSelected(item);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import android.view.View;
import android.widget.EditText;

public class settingsActivity extends AppCompatActivity {
public class SettingsActivity extends AppCompatActivity {
EditText passwordField;
EditText requesterField;
Settings settings;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
public class SettingsStore {

private static SharedPreferences getSharedPreferences(Context context){
return context.getSharedPreferences(context.getString(R.string.settings), Context.MODE_PRIVATE);
return context.getSharedPreferences(context.getString(R.string.settingsKey), Context.MODE_PRIVATE);
}

public static void addValue(String key, String value, Context context){
Expand Down
9 changes: 0 additions & 9 deletions App/app/src/main/res/drawable/ic_info_black_24dp.xml

This file was deleted.

9 changes: 0 additions & 9 deletions App/app/src/main/res/drawable/ic_notifications_black_24dp.xml

This file was deleted.

9 changes: 0 additions & 9 deletions App/app/src/main/res/drawable/ic_sync_black_24dp.xml

This file was deleted.

2 changes: 1 addition & 1 deletion App/app/src/main/res/layout/activity_settings_activty.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".settingsActivity">
tools:context=".SettingsActivity">

<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
Expand Down
10 changes: 5 additions & 5 deletions App/app/src/main/res/layout/content_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
android:layout_marginStart="16dp"
android:layout_marginTop="24dp"
android:ems="10"
android:hint="Ausgabenbezeichnung"
android:hint="@string/expenseDescription"
android:inputType="textPersonName"
android:imeOptions="actionNext"
app:layout_constraintEnd_toEndOf="parent"
Expand All @@ -31,7 +31,7 @@
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:ems="10"
android:hint="Preis"
android:hint="@string/price"
android:inputType="numberDecimal"
android:imeOptions="actionSend"
app:layout_constraintEnd_toEndOf="parent"
Expand All @@ -45,7 +45,7 @@
android:layout_marginBottom="60dp"
android:onClick="clear"
android:padding="20dp"
android:text="Form leeren"
android:text="@string/clear"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
Expand All @@ -58,7 +58,7 @@
android:layout_marginBottom="60dp"
android:onClick="send"
android:padding="20dp"
android:text="Abschicken"
android:text="@string/send"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/clear"
app:layout_constraintHorizontal_bias="0.5"
Expand All @@ -71,7 +71,7 @@
android:layout_marginEnd="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:text="WG - Management"
android:text="@string/title"
android:textSize="24sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
Expand Down
2 changes: 1 addition & 1 deletion App/app/src/main/res/layout/content_settings_activty.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context=".settingsActivity"
tools:context=".SettingsActivity"
tools:showIn="@layout/activity_settings_activty">

<Button
Expand Down
13 changes: 13 additions & 0 deletions App/app/src/main/res/values-de-rDE/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">WGVerwaltung</string>
<string name="send">Absenden</string>
<string name="save">Speichern</string>
<string name="requester">Dein Name hier</string>
<string name="price">Preis</string>
<string name="password">Du musst Thoma snach dem Passwort fragen</string>
<string name="expenseDescription">Beschreibung der Ausgabe</string>
<string name="clear">Form Leeren</string>
<string name="action_settings">Einstellungen</string>
<string name="title_activity_settings_activty">Einstellungen</string>
</resources>
4 changes: 1 addition & 3 deletions App/app/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
<resources>
<dimen name="fab_margin">16dp</dimen>
</resources>
<resources></resources>
12 changes: 12 additions & 0 deletions App/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
<resources>
<string name="app_name">WGVerwaltung</string>
<string name="action_settings">Settings</string>
<string name="title_activity_settings_activty">Settings</string>
<string name="settingsKey" translatable="false">settingsKey</string>
<string name="passwordKey" translatable="false">passwordKey</string>
<string name="requesterKey" translatable="false">requesterKey</string>
<string name="password">Ask Thomas for the password</string>
<string name="requester">Your name here</string>
<string name="save">Save</string>
<string name="expenseDescription">Description of the expense</string>
<string name="price">Price</string>
<string name="clear">Clear form</string>
<string name="send">Send</string>
<string name="title" translatable="false">WG - Management</string>
</resources>
21 changes: 0 additions & 21 deletions App/app/src/main/res/xml/pref_data_sync.xml

This file was deleted.

33 changes: 0 additions & 33 deletions App/app/src/main/res/xml/pref_general.xml

This file was deleted.

20 changes: 0 additions & 20 deletions App/app/src/main/res/xml/pref_headers.xml

This file was deleted.

27 changes: 0 additions & 27 deletions App/app/src/main/res/xml/pref_notification.xml

This file was deleted.

0 comments on commit e16815c

Please sign in to comment.