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());
|
||||
}
|
||||
if(i == 0)
|
||||
{
|
||||
populateLayouts();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
populateLayouts();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -104,11 +100,6 @@ implements View.OnClickListener, DialogInterface.OnClickListener, SharedPreferen
|
||||
layoutsEditor.commit();
|
||||
}
|
||||
|
||||
protected void addLine(LinearLayout parent)
|
||||
{
|
||||
addLine(parent, "Name", "ICO");
|
||||
}
|
||||
|
||||
protected void addLine(LinearLayout parent, String name, String icon)
|
||||
{
|
||||
final LinearLayout layoutLine = new LinearLayout(getApplicationContext());
|
||||
@ -169,13 +160,9 @@ implements View.OnClickListener, DialogInterface.OnClickListener, SharedPreferen
|
||||
if(layoutNameValue != "")
|
||||
{
|
||||
if(layoutIconValue != "")
|
||||
{
|
||||
layoutsEditor.putString(layoutNameValue, layoutIconValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
layoutsEditor.putString(layoutNameValue, "??");
|
||||
}
|
||||
}
|
||||
}
|
||||
layoutsEditor.commit();
|
||||
@ -261,9 +248,9 @@ implements View.OnClickListener, DialogInterface.OnClickListener, SharedPreferen
|
||||
updateLayouts();
|
||||
}
|
||||
|
||||
private boolean isPackageInstalled(String packagename, PackageManager packageManager) {
|
||||
private boolean isPackageInstalled(String packageName, PackageManager packageManager) {
|
||||
try {
|
||||
packageManager.getPackageInfo(packagename, 0);
|
||||
packageManager.getPackageInfo(packageName, 0);
|
||||
return true;
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
return false;
|
||||
@ -272,6 +259,7 @@ implements View.OnClickListener, DialogInterface.OnClickListener, SharedPreferen
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface dialogInterface, int i) {
|
||||
//There is only one potential dialog
|
||||
this.finish();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user