mirror of
https://gitlab.com/neothefox/LayTray
synced 2026-03-23 21:54:54 +03:00
Code cleanup
This commit is contained in:
parent
a2779d2585
commit
6599166077
@ -82,14 +82,10 @@ implements View.OnClickListener, DialogInterface.OnClickListener, SharedPreferen
|
|||||||
addLine(layoutLister, entry.getKey(), entry.getValue().toString());
|
addLine(layoutLister, entry.getKey(), entry.getValue().toString());
|
||||||
}
|
}
|
||||||
if(i == 0)
|
if(i == 0)
|
||||||
{
|
|
||||||
populateLayouts();
|
populateLayouts();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
populateLayouts();
|
populateLayouts();
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -104,11 +100,6 @@ implements View.OnClickListener, DialogInterface.OnClickListener, SharedPreferen
|
|||||||
layoutsEditor.commit();
|
layoutsEditor.commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void addLine(LinearLayout parent)
|
|
||||||
{
|
|
||||||
addLine(parent, "Name", "ICO");
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void addLine(LinearLayout parent, String name, String icon)
|
protected void addLine(LinearLayout parent, String name, String icon)
|
||||||
{
|
{
|
||||||
final LinearLayout layoutLine = new LinearLayout(getApplicationContext());
|
final LinearLayout layoutLine = new LinearLayout(getApplicationContext());
|
||||||
@ -169,15 +160,11 @@ implements View.OnClickListener, DialogInterface.OnClickListener, SharedPreferen
|
|||||||
if(layoutNameValue != "")
|
if(layoutNameValue != "")
|
||||||
{
|
{
|
||||||
if(layoutIconValue != "")
|
if(layoutIconValue != "")
|
||||||
{
|
|
||||||
layoutsEditor.putString(layoutNameValue, layoutIconValue);
|
layoutsEditor.putString(layoutNameValue, layoutIconValue);
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
layoutsEditor.putString(layoutNameValue, "??");
|
layoutsEditor.putString(layoutNameValue, "??");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
layoutsEditor.commit();
|
layoutsEditor.commit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -261,9 +248,9 @@ implements View.OnClickListener, DialogInterface.OnClickListener, SharedPreferen
|
|||||||
updateLayouts();
|
updateLayouts();
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isPackageInstalled(String packagename, PackageManager packageManager) {
|
private boolean isPackageInstalled(String packageName, PackageManager packageManager) {
|
||||||
try {
|
try {
|
||||||
packageManager.getPackageInfo(packagename, 0);
|
packageManager.getPackageInfo(packageName, 0);
|
||||||
return true;
|
return true;
|
||||||
} catch (PackageManager.NameNotFoundException e) {
|
} catch (PackageManager.NameNotFoundException e) {
|
||||||
return false;
|
return false;
|
||||||
@ -272,6 +259,7 @@ implements View.OnClickListener, DialogInterface.OnClickListener, SharedPreferen
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialogInterface, int i) {
|
public void onClick(DialogInterface dialogInterface, int i) {
|
||||||
|
//There is only one potential dialog
|
||||||
this.finish();
|
this.finish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user