diff --git a/app/src/main/java/com/git/amarradi/palatschinkencounter/AboutActivity.java b/app/src/main/java/com/git/amarradi/palatschinkencounter/AboutActivity.java index b2ebcbe..33f4d88 100644 --- a/app/src/main/java/com/git/amarradi/palatschinkencounter/AboutActivity.java +++ b/app/src/main/java/com/git/amarradi/palatschinkencounter/AboutActivity.java @@ -1,9 +1,13 @@ package com.git.amarradi.palatschinkencounter; import android.annotation.SuppressLint; +import android.content.Intent; import android.graphics.Typeface; import android.os.Bundle; import android.text.method.LinkMovementMethod; +import android.view.Menu; +import android.view.MenuInflater; +import android.view.MenuItem; import android.widget.TextView; import androidx.annotation.Nullable; @@ -38,4 +42,21 @@ protected void onCreate(@Nullable Bundle savedInstanceState) { appVersion.setText(version); } + @Override + public boolean onCreateOptionsMenu(Menu menu) { + MenuInflater inflater = getMenuInflater(); + inflater.inflate(R.menu.menu, menu); + return true; + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + if (item.getItemId() == R.id.item_setting) { + Intent intentSetting = new Intent(this, SettingActivity.class); + startActivity(intentSetting); + return true; + } + return super.onOptionsItemSelected(item); + } + } diff --git a/app/src/main/java/com/git/amarradi/palatschinkencounter/ChangelogActivity.java b/app/src/main/java/com/git/amarradi/palatschinkencounter/ChangelogActivity.java index 512a86c..3f7a0b2 100644 --- a/app/src/main/java/com/git/amarradi/palatschinkencounter/ChangelogActivity.java +++ b/app/src/main/java/com/git/amarradi/palatschinkencounter/ChangelogActivity.java @@ -1,7 +1,11 @@ package com.git.amarradi.palatschinkencounter; +import android.content.Intent; import android.os.Bundle; -import android.widget.EditText; +import android.view.Menu; +import android.view.MenuInflater; +import android.view.MenuItem; +import android.widget.ImageView; import android.widget.TextView; import androidx.appcompat.app.AppCompatActivity; @@ -14,6 +18,7 @@ public class ChangelogActivity extends AppCompatActivity { TextView tv_changelog, et_changelog; + ImageView birthday; @Override protected void onCreate(Bundle savedInstanceState) { @@ -23,10 +28,29 @@ protected void onCreate(Bundle savedInstanceState) { tv_changelog = findViewById(R.id.tvChangeloghead); et_changelog = findViewById(R.id.etChangelog); + birthday = findViewById(R.id.birthday); + readChangelog(); } + @Override + public boolean onCreateOptionsMenu(Menu menu) { + MenuInflater inflater = getMenuInflater(); + inflater.inflate(R.menu.menu, menu); + return true; + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + if (item.getItemId() == R.id.item_setting) { + Intent intentSetting = new Intent(this, SettingActivity.class); + startActivity(intentSetting); + return true; + } + return super.onOptionsItemSelected(item); + } + private void readChangelog() { try { InputStream inputStream = getResources().openRawResource(R.raw.changelog); diff --git a/app/src/main/java/com/git/amarradi/palatschinkencounter/MainActivity.java b/app/src/main/java/com/git/amarradi/palatschinkencounter/MainActivity.java index 35bae81..97a279e 100644 --- a/app/src/main/java/com/git/amarradi/palatschinkencounter/MainActivity.java +++ b/app/src/main/java/com/git/amarradi/palatschinkencounter/MainActivity.java @@ -52,16 +52,7 @@ protected void onCreate(Bundle savedInstanceState) { Button counterTextButton = findViewById(R.id.counter_text_button); counterTextButton.setTypeface(getResources().getFont(R.font.opensans_bold)); -/* - imageViewShare = findViewById(R.id.share); - imageViewShare.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - Toast.makeText(MainActivity.this, "share now", Toast.LENGTH_SHORT).show(); - } - }); - */ textView = findViewById(R.id.textview); TextView textView_start = findViewById(R.id.tv_startpage); textView.setTypeface(typeface); diff --git a/app/src/main/java/com/git/amarradi/palatschinkencounter/RecipeActivity.java b/app/src/main/java/com/git/amarradi/palatschinkencounter/RecipeActivity.java index 2f3563e..2742f7f 100644 --- a/app/src/main/java/com/git/amarradi/palatschinkencounter/RecipeActivity.java +++ b/app/src/main/java/com/git/amarradi/palatschinkencounter/RecipeActivity.java @@ -1,6 +1,11 @@ package com.git.amarradi.palatschinkencounter; +import android.annotation.SuppressLint; +import android.content.Intent; import android.os.Bundle; +import android.view.Menu; +import android.view.MenuInflater; +import android.view.MenuItem; import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; @@ -17,6 +22,7 @@ public class RecipeActivity extends AppCompatActivity { ArrayList ingredientsModels = new ArrayList<>(); ArrayList preparationModels = new ArrayList<>(); + @SuppressLint("ResourceAsColor") @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -42,6 +48,23 @@ protected void onCreate(@Nullable Bundle savedInstanceState) { recyclerView_Preparation.setLayoutManager(new LinearLayoutManager(this)); } + @Override + public boolean onCreateOptionsMenu(Menu menu) { + MenuInflater inflater = getMenuInflater(); + inflater.inflate(R.menu.menu, menu); + return true; + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + if (item.getItemId() == R.id.item_setting) { + Intent intentSetting = new Intent(this, SettingActivity.class); + startActivity(intentSetting); + return true; + } + return super.onOptionsItemSelected(item); + } + private void setupPreparationModels() { String[] strings_preparation = getResources().getStringArray(R.array.preparation_array); for (String s : strings_preparation) { diff --git a/app/src/main/res/layout-land/activity_main.xml b/app/src/main/res/layout-land/activity_main.xml index a44e133..09f144a 100644 --- a/app/src/main/res/layout-land/activity_main.xml +++ b/app/src/main/res/layout-land/activity_main.xml @@ -18,7 +18,7 @@ android:layout_alignParentStart="true" android:layout_alignParentTop="true" android:layout_gravity="center" - android:layout_marginTop="8dp" + android:layout_marginTop="4dp" android:text="@string/textviewComplain" android:textAppearance="?android:attr/textAppearanceMedium" /> @@ -35,7 +35,6 @@ android:layout_gravity="center" - android:text="@string/txViewCounterState" android:textAlignment="center" android:textAppearance="@style/TextAppearance.AppCompat.Medium" /> @@ -56,7 +55,7 @@ android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center" - android:layout_marginBottom="4dp" + android:layout_marginBottom="2dp" android:layout_alignParentBottom="true"> diff --git a/app/src/main/res/layout-land/activity_recipe.xml b/app/src/main/res/layout-land/activity_recipe.xml index 65ce56f..a83c3b5 100644 --- a/app/src/main/res/layout-land/activity_recipe.xml +++ b/app/src/main/res/layout-land/activity_recipe.xml @@ -5,7 +5,10 @@ android:layout_height="match_parent" android:fillViewport="true" android:overScrollMode="always" - android:layout_margin="5dp"> + android:layout_marginLeft="16dp" + android:layout_marginRight="16dp" + android:layout_marginTop="4dp" + android:layout_marginBottom="4dp"> - + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index d628bd3..2a8867b 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -56,24 +56,24 @@ android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center" - android:layout_marginBottom="16dp" + android:layout_marginBottom="2dp" android:layout_alignParentBottom="true"> +