Csengetés format javítva, long press elkezdve
This commit is contained in:
parent
34ede81265
commit
f4fc6d9278
5 changed files with 42 additions and 2 deletions
|
@ -362,7 +362,7 @@ namespace Orarend
|
||||||
int x = (int)DateTime.Today.DayOfWeek - 1;
|
int x = (int)DateTime.Today.DayOfWeek - 1;
|
||||||
Óra óra;
|
Óra óra;
|
||||||
var (innen, ide) = HelyettesítésInnenIde(Órarend, x, i);
|
var (innen, ide) = HelyettesítésInnenIde(Órarend, x, i);
|
||||||
Func<TimeSpan, string> óraperc = ts => ts.Hours > 0 ? ts.ToString("h\\ómm\\p") : ts.ToString("m") + " perc";
|
Func<TimeSpan, string> óraperc = ts => ts.Hours > 0 ? ts.ToString("h\\ómm\\p") : ts.ToString("%m") + " perc";
|
||||||
if (x != -1 && x < 6 && (óra = ide != null ? ide.ÚjÓra : innen != null ? innen.EredetiNap != innen.ÚjNap || innen.EredetiSorszám != innen.ÚjSorszám ? null : innen.ÚjÓra : Órarend.Órák[x][i]) != null)
|
if (x != -1 && x < 6 && (óra = ide != null ? ide.ÚjÓra : innen != null ? innen.EredetiNap != innen.ÚjNap || innen.EredetiSorszám != innen.ÚjSorszám ? null : innen.ÚjÓra : Órarend.Órák[x][i]) != null)
|
||||||
{ //-1: Vasárnap
|
{ //-1: Vasárnap
|
||||||
if (most > Órarend.Órakezdetek[i])
|
if (most > Órarend.Órakezdetek[i])
|
||||||
|
|
|
@ -99,6 +99,9 @@ namespace OrarendAndroidApp
|
||||||
textview.Tag = tag.HasValue ? new JavaTuple<int, int>(tag.Value) : null;
|
textview.Tag = tag.HasValue ? new JavaTuple<int, int>(tag.Value) : null;
|
||||||
textview.Clickable = true;
|
textview.Clickable = true;
|
||||||
textview.Click += ÓraClick;
|
textview.Click += ÓraClick;
|
||||||
|
//textview.LongClick += ÓraLongClick;
|
||||||
|
RegisterForContextMenu(textview);
|
||||||
|
textview.ContextMenuCreated += ÓraContextMenuCreated;
|
||||||
tr1.AddView(textview);
|
tr1.AddView(textview);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -250,7 +253,7 @@ namespace OrarendAndroidApp
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else //TODO: Metódus tv --> óra
|
||||||
{
|
{
|
||||||
deselect();
|
deselect();
|
||||||
return;
|
return;
|
||||||
|
@ -293,6 +296,21 @@ namespace OrarendAndroidApp
|
||||||
hely.Visibility = ViewStates.Visible;
|
hely.Visibility = ViewStates.Visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ÓraContextMenuCreated(object sender, View.CreateContextMenuEventArgs e)
|
||||||
|
{
|
||||||
|
//Toast.MakeText(this, "Ye! " + sender, ToastLength.Long).Show();
|
||||||
|
switch (sender)
|
||||||
|
{
|
||||||
|
case TextView tv:
|
||||||
|
var ij = (JavaTuple<int, int>)tv.Tag;
|
||||||
|
e.Menu.Add("")
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
Hiba("Ismeretlen küldő a menühöz!");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public override bool OnCreateOptionsMenu(IMenu menu)
|
public override bool OnCreateOptionsMenu(IMenu menu)
|
||||||
{
|
{
|
||||||
MenuInflater.Inflate(Resource.Menu.main_menu_light, menu);
|
MenuInflater.Inflate(Resource.Menu.main_menu_light, menu);
|
||||||
|
|
|
@ -81,6 +81,7 @@
|
||||||
<AndroidResource Include="Resources\layout\EditLayout.axml">
|
<AndroidResource Include="Resources\layout\EditLayout.axml">
|
||||||
<SubType>AndroidResource</SubType>
|
<SubType>AndroidResource</SubType>
|
||||||
</AndroidResource>
|
</AndroidResource>
|
||||||
|
<AndroidResource Include="Resources\menu\ora_menu.axml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<AndroidResource Include="Resources\values\Strings.xml" />
|
<AndroidResource Include="Resources\values\Strings.xml" />
|
||||||
|
|
3
OrarendAndroidApp/Resources/Resource.Designer.cs
generated
3
OrarendAndroidApp/Resources/Resource.Designer.cs
generated
|
@ -212,6 +212,9 @@ namespace OrarendAndroidApp
|
||||||
// aapt resource value: 0x7f060000
|
// aapt resource value: 0x7f060000
|
||||||
public const int main_menu_light = 2131099648;
|
public const int main_menu_light = 2131099648;
|
||||||
|
|
||||||
|
// aapt resource value: 0x7f060001
|
||||||
|
public const int ora_menu = 2131099649;
|
||||||
|
|
||||||
static Menu()
|
static Menu()
|
||||||
{
|
{
|
||||||
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
|
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
|
||||||
|
|
18
OrarendAndroidApp/Resources/menu/ora_menu.axml
Normal file
18
OrarendAndroidApp/Resources/menu/ora_menu.axml
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item
|
||||||
|
android:id="@+id/menu_refresh"
|
||||||
|
android:title="Frissítés" />
|
||||||
|
<item
|
||||||
|
android:id="@+id/menu_add"
|
||||||
|
android:title="Hozzáadás" />
|
||||||
|
<item
|
||||||
|
android:id="@+id/menu_edit"
|
||||||
|
android:title="Szerkesztés" />
|
||||||
|
<item
|
||||||
|
android:id="@+id/menu_preferences"
|
||||||
|
android:title="Beállítások" />
|
||||||
|
<item
|
||||||
|
android:id="@+id/menu_fullrefresh"
|
||||||
|
android:title="Órarendfrissítés" />
|
||||||
|
</menu>
|
Loading…
Reference in a new issue