Skip to content

Commit

Permalink
1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ackhack committed May 15, 2021
1 parent 43de0d0 commit f1e7628
Show file tree
Hide file tree
Showing 42 changed files with 292 additions and 273 deletions.
10 changes: 9 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
1.1.0: 14.05.2021
1.2.0: 15.05.2021
-App now has its own Icon
-Version gets updated now
-List can be filtered by Manufactorer
-New Drawer Icons
-Manufactorers have Autocomplete
-Decided to remove Images

1.1.0: 14.05.2021
-List is sorted by name/manufactorer
-Names will be trimmed before saving
-If there is no Rater, show Rater Change Fragment
Expand Down
14 changes: 13 additions & 1 deletion Fragment_Tabacco_list.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using AndroidX.Fragment.App;
using AndroidX.AppCompat.View.Menu;
using System;
using System.Collections.Generic;

namespace ShishaBacon
{
Expand All @@ -21,6 +22,17 @@ public override View OnCreateView(LayoutInflater inflater, ViewGroup container,
var view = inflater.Inflate(Resource.Layout.layout_tabacco_list, container, false);

ListView list = view.FindViewById<ListView>(Resource.Id.tl_list);
Spinner spinner = view.FindViewById<Spinner>(Resource.Id.tl_spinner);
var manList = new List<string>();
manList.Add("All");
manList.AddRange(TabaccoList.GetManufactorers());
spinner.Adapter = new ArrayAdapter(Activity, Resource.Layout.sb_listitem, manList);

spinner.ItemSelected += (sender, e) =>
{
list.Adapter = new ArrayAdapter<Tabacco>(Context, Resource.Layout.tl_listitem, TabaccoList.GetFilteredList(spinner.GetItemAtPosition(e.Position).ToString()));
list.Invalidate();
};

list.Adapter = new ArrayAdapter<Tabacco>(Context, Resource.Layout.tl_listitem, TabaccoList.GetList());
list.TextFilterEnabled = true;
Expand All @@ -35,7 +47,7 @@ public override View OnCreateView(LayoutInflater inflater, ViewGroup container,
}
}

public class TabaccoListEventArgs: EventArgs
public class TabaccoListEventArgs : EventArgs
{
public Tabacco Tabacco { get; set; }

Expand Down
5 changes: 3 additions & 2 deletions Fragment_Tabacco_menu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ public override View OnCreateView(LayoutInflater inflater, ViewGroup container,
view.FindViewById<EditText>(Resource.Id.tm_name).Text = tabacco.Name;

//Manufactorer
view.FindViewById<EditText>(Resource.Id.tm_manufacturer).Text = tabacco.Manufactorer;
view.FindViewById<AutoCompleteTextView>(Resource.Id.tm_manufactorer).Text = tabacco.Manufactorer;
view.FindViewById<AutoCompleteTextView>(Resource.Id.tm_manufactorer).Adapter = new ArrayAdapter(Activity, Resource.Layout.sb_listitem, TabaccoList.GetManufactorers());

//Rating
view.FindViewById<SeekBar>(Resource.Id.tm_rating).Progress = tabacco.GetOwnRating();
Expand All @@ -55,7 +56,7 @@ public override View OnCreateView(LayoutInflater inflater, ViewGroup container,
Tabacco newT = new Tabacco(tabacco);
newT.Name = view.FindViewById<EditText>(Resource.Id.tm_name).Text;
newT.Manufactorer = view.FindViewById<EditText>(Resource.Id.tm_manufacturer).Text;
newT.Manufactorer = view.FindViewById<EditText>(Resource.Id.tm_manufactorer).Text;
int rating = view.FindViewById<SeekBar>(Resource.Id.tm_rating).Progress;
newT.UpdateRating(new Rating(RaterSaved.GetRater(), rating));
Expand Down
4 changes: 2 additions & 2 deletions Fragment_Tabacco_new.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ public override View OnCreateView(LayoutInflater inflater, ViewGroup container,
{

var view = inflater.Inflate(Resource.Layout.layout_tabacco_new, container, false);

view.FindViewById<AutoCompleteTextView>(Resource.Id.tn_manufactorer).Adapter = new ArrayAdapter(Activity, Resource.Layout.sb_listitem, TabaccoList.GetManufactorers());
view.FindViewById<Button>(Resource.Id.tn_btn).Click += (sender, e) =>
{
Tabacco tb = new Tabacco
{
Name = view.FindViewById<EditText>(Resource.Id.tn_name).Text.Trim(),
Manufactorer = view.FindViewById<EditText>(Resource.Id.tn_manufactorer).Text.Trim()
Manufactorer = view.FindViewById<MultiAutoCompleteTextView>(Resource.Id.tn_manufactorer).Text.Trim()
};
TabaccoList.AddTabacco(tb);
finished(this, null);
Expand Down
31 changes: 9 additions & 22 deletions MainActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

namespace ShishaBacon
{
[Activity(Label = "@string/app_name", Theme = "@style/AppTheme.NoActionBar", MainLauncher = true)]
[Activity(Label = "@string/app_name", Theme = "@style/AppTheme.NoActionBar", MainLauncher = true, Icon = "@mipmap/ic_launcher", RoundIcon = "@mipmap/ic_launcher_round")]
public class MainActivity : AppCompatActivity, NavigationView.IOnNavigationItemSelectedListener
{
private bool finishedInit = false;
Expand Down Expand Up @@ -110,9 +110,9 @@ public bool OnNavigationItemSelected(IMenuItem item)
ShowRaterChange();
break;

case Resource.Id.nav_bluetooth:
//ShowSyncBluetooth();
break;
//case Resource.Id.nav_bluetooth:
// ShowSyncBluetooth();
// break;

case Resource.Id.nav_file:
ShowSyncFile();
Expand Down Expand Up @@ -140,11 +140,6 @@ private void ShowTabaccoNew()

f.finished += (sender, e) =>
{
InputMethodManager imm = (InputMethodManager)GetSystemService(Context.InputMethodService);
if (imm != null && CurrentFocus != null && CurrentFocus.WindowToken != null)
{
imm.HideSoftInputFromWindow(CurrentFocus.WindowToken, 0);
}
ShowTabaccoHome();
};

Expand All @@ -153,19 +148,18 @@ private void ShowTabaccoNew()

private void ShowTabaccoHome()
{
InputMethodManager imm = (InputMethodManager)GetSystemService(Context.InputMethodService);
if (imm != null && CurrentFocus != null && CurrentFocus.WindowToken != null)
{
imm.HideSoftInputFromWindow(CurrentFocus.WindowToken, 0);
}
Fragment_Tabacco_list list = new Fragment_Tabacco_list();

list.itemClicked += (sender, e) =>
{
Fragment_Tabacco_menu f = new Fragment_Tabacco_menu(e.Tabacco);
f.finished += (sender, e) =>
{
InputMethodManager imm = (InputMethodManager)GetSystemService(Context.InputMethodService);
if (imm != null && CurrentFocus != null && CurrentFocus.WindowToken != null)
{
imm.HideSoftInputFromWindow(CurrentFocus.WindowToken, 0);
}
ShowTabaccoHome();
};
SupportFragmentManager.BeginTransaction().Replace(Resource.Id.mainFragment, f).Commit();
Expand All @@ -180,14 +174,7 @@ private void ShowRaterChange()

f.finished += (sender, e) =>
{
InputMethodManager imm = (InputMethodManager)GetSystemService(Context.InputMethodService);
if (imm != null && CurrentFocus != null && CurrentFocus.WindowToken != null)
{
imm.HideSoftInputFromWindow(CurrentFocus.WindowToken, 0);
}
updateUsername();
ShowTabaccoHome();
};

Expand Down
2 changes: 1 addition & 1 deletion Properties/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.ackhack.shishabacon" android:installLocation="preferExternal">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.2.0" package="com.ackhack.shishabacon" android:installLocation="preferExternal">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="30" />
<application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme"></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
Expand Down
11 changes: 1 addition & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
# ShishaBacon

Small Android App to rate Shisha Tobacco. App Language is German.

#TODO

- New App Icon
- Image Implmentation
- Drawer Icons
- Show App Version
- Filter List by Manufactorer
- Have Manufactorer Suggestions
Small Android App to rate Shisha Tobacco. App Language is German.
Loading

0 comments on commit f1e7628

Please sign in to comment.