[android] some convince methods.
This commit is contained in:
parent
6e8b696023
commit
4654442ef2
1 changed files with 27 additions and 0 deletions
27
android/src/com/example/travelguide/util/Utils.java
Normal file
27
android/src/com/example/travelguide/util/Utils.java
Normal file
|
@ -0,0 +1,27 @@
|
|||
package com.example.travelguide.util;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
public class Utils
|
||||
{
|
||||
public static View hideView(View view)
|
||||
{
|
||||
view.setVisibility(View.GONE);
|
||||
return view;
|
||||
}
|
||||
|
||||
public static View showView(View view)
|
||||
{
|
||||
view.setVisibility(View.VISIBLE);
|
||||
return view;
|
||||
}
|
||||
|
||||
public static View hideIf(boolean condition, View view)
|
||||
{
|
||||
if (condition)
|
||||
hideView(view);
|
||||
else
|
||||
showView(view);
|
||||
return view;
|
||||
}
|
||||
}
|
Reference in a new issue