Android Facebook login Using Facebook sdk3.0

First we check Facebook session in open or not Useing this

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mCurrContext = this;
setContentView(R.layout.fb_activity_main);
facebook_button = (Button) findViewById(R.id.LikeFB_Button);

Settings.addLoggingBehavior(LoggingBehavior.INCLUDE_ACCESS_TOKENS);
        fb_session = Session.openActiveSessionFromCache(mCurrContext);

If Your Facebook session in null and not open state click this button to login facebook

          Button button =(Button) findViewById(R.id.button_share);
button.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (fb_session != null && fb_session.isOpened()) {
makeMeRequest(fb_session);
Log.i("Facebook Login State == >", "Facebook Login State");
} else {
if (fb_session == null) {
fb_session = new Session(mCurrContext);          
       }
Session.setActiveSession(fb_session);
ConnectToFacebook();
  Log.i("Facebook not Login State == >", "Facebook Not login State");
}
}
});
   }

This methods used for Login to Facebook Session

  private void ConnectToFacebook(){
Session session = Session.getActiveSession();
        if (!session.isOpened() && !session.isClosed()) {
        Log.i("ConnectToFacebook  if == >", "ConnectToFacebook if");
        OpenRequest newSession = new Session.OpenRequest(this);
        newSession.setCallback(callback);
        session.openForRead(newSession);          
        try {
        Session.OpenRequest request = new Session.OpenRequest(this);
        request.setPermissions(Arrays.asList("email"));
        } catch (Exception e) {
        e.printStackTrace();
        }
        } else {
        Log.i("ConnectToFacebook  else == >", "ConnectToFacebook else");
            Session.openActiveSession(this, true, callback);        
        }
}

private Session.StatusCallback callback = new Session.StatusCallback() {
       public void call(final Session session, final SessionState state, final Exception exception) {
           onSessionStateChange(session, state, exception);
       }
   };
 
   private void onSessionStateChange(final Session session, SessionState state, Exception exception) {
       if (session != null && session.isOpened()) {
        makeMeRequest(session);
       }
   }
 
   private void makeMeRequest(final Session session) {
     Request request = Request.newMeRequest(session, new Request.GraphUserCallback() {
    public void onCompleted(GraphUser user, Response response) {
    try{
      //UserInfoDisplay(user);
    //FrieddsInfoDisplay(session);
       } catch (Exception e) {
    e.printStackTrace();
    }
    }
    });              
       request.executeAsync();
   }

NOTE:

InManifestfile you Implement facebook login activity like this

  <activity
            android:name="com.facebook.LoginActivity"
            android:label="@string/app_name"
            android:theme="@android:style/Theme.Translucent.NoTitleBar" />        

        <meta-data
            android:name="com.facebook.sdk.ApplicationId"
            android:value="@string/app_id" />

And your App id create create in  res/values/string
  Like this

<resources>   
    <string name="app_id">FACEBOOKAPPLICATIONID</string> 
</resources> 

Android Store data and Image to server?

First Declare file to global like this
private File file;
After that convert to Drawable Image to Bitmap usein this two lines

Drawable myDrawable = getResources().getDrawable(R.drawable.logo);
Bitmap myLogo = ((BitmapDrawable) myDrawable).getBitmap();
After that call your method where we want  "SaveImage_State" and give String name by default

SaveImage_State(myLogo, "name");


private String SaveImage_State(Bitmap finalBitmap, String name) {
String root = Environment.getExternalStorageDirectory().toString() + "/pm";
File myDir = new File(root);
myDir.mkdirs();
Random generator = new Random();
int n = 10000;
n = generator.nextInt(n);
String fname = name + ".jpg";
file = new File(myDir, fname);
if (file.exists())
file.delete();
try {
FileOutputStream out = new FileOutputStream(file);
finalBitmap.compress(Bitmap.CompressFormat.JPEG, 90, out);
out.flush();
out.close();
} catch (Exception e) {
e.printStackTrace();
}
return file.toString();
}


Call this where you want button on click like ......


AsyncTask<Void, Void, HttpEntity> editProfileTask = new AsyncTask<Void, Void, HttpEntity>() {
        
@Override
 protected HttpEntity doInBackground(Void... params) {          
 HttpClient httpclient = new DefaultHttpClient();
 HttpPost httppost = new HttpPost("Your url"); // your url

 try {                     
 MultipartEntity reqEntity = new MultipartEntity();
  reqEntity.addPart("firstname",new StringBody(firstnameEV.getText().toString(),
   "text/plain",Charset.forName("UTF-8")));
                   "text/plain",Charset.forName("UTF-8")));
 if (file != null) {
   reqEntity.addPart("image",new FileBody(((File) file),"application/zip"));
 }         
 httppost.setEntity(reqEntity);
 HttpResponse resp = httpclient.execute(httppost);          
 HttpEntity resEntity = resp.getEntity();
  return resEntity;
 } catch (ClientProtocolException e) {
  e.printStackTrace();
 } catch (IOException e) {
  e.printStackTrace();
 }return null;
 }
   @Override
   protected void onPostExecute(HttpEntity resEntity) {
     if (resEntity != null) {             
       try {
         JSONObject responseJsonObject = new JSONObject(EntityUtils.toString(resEntity));
          String status = responseJsonObject.getString("status");             
           if (status.equals("success")) {
                Toast.makeText(activity, "Your Profile is updated", Toast.LENGTH_LONG).show();
                 String data = responseJsonObject.getString("data");              
                 isUpdatedSuccessfully=true;            
           } else {
              Toast.makeText(activity, "Profile not updated", Toast.LENGTH_LONG).show();
         }
        } catch (Exception e) {
       e.printStackTrace();
      }
        }            
  }
       };
 editProfileTask.execute(null, null, null);
      



Android GridView with full Image?

GridView layout in one of the most useful layouts in android. Gridview is mainly useful when we want show data in grid layout like displaying images or icons. This layout can be used to build applications like image viewer, audio or video players in order to show elements in grid manner.




1). Create a new project by going to File ⇒ New Android Project and fill required details.  
2). Prepare your images which you want to show in grid layout and place them in res ⇒ drawable-hdpi folder.
3).Create a new XML layout under layout and name it as 


<?xml version="1.0" encoding="utf-8"?>
<GridView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/grid_view"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:numColumns="auto_fit"
    android:columnWidth="90dp"
    android:horizontalSpacing="10dp"
    android:verticalSpacing="10dp"
    android:gravity="center"
    android:stretchMode="columnWidth" >  

</GridView>

Android Disable and Enable WIFI, GORS and Mobile Data state useing Toggle Button?


Wifi_State.java

public class Wifi_State extends Activity {
private int bv;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.wifi);

bv = Build.VERSION.SDK_INT;

ToggleButton togglegps = (ToggleButton) findViewById(R.id.GpsButton);
togglegps
.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
public void onCheckedChanged(CompoundButton buttonView,
boolean isChecked) {

if (isChecked) {
turnOnDataConnection(true, Wifi_State.this);
Toast.makeText(getApplicationContext(),
"gprs Enabled!", Toast.LENGTH_LONG).show();
} else {
turnOnDataConnection(false, Wifi_State.this);
Toast.makeText(getApplicationContext(),
"gprs Disabled!", Toast.LENGTH_LONG).show();
}
}
});

ToggleButton toggle = (ToggleButton) findViewById(R.id.toggleButton);
toggle.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
public void onCheckedChanged(CompoundButton buttonView,
boolean isChecked) {
if (isChecked) {
toggleWiFi(true);
Toast.makeText(getApplicationContext(), "Wi-Fi Enabled!",
Toast.LENGTH_LONG).show();
} else {
toggleWiFi(false);
Toast.makeText(getApplicationContext(), "Wi-Fi Disabled!",
Toast.LENGTH_LONG).show();
}

if (isChecked) {
// Button is ON
Log.i("", "true");
Intent intent = new Intent(
"android.location.GPS_ENABLED_CHANGE");
intent.putExtra("enabled", true);
sendBroadcast(intent);

String provider = Settings.Secure.getString(
getContentResolver(),
Settings.Secure.LOCATION_PROVIDERS_ALLOWED);
if (!provider.contains("gps")) { // if gps is disabled
final Intent poke = new Intent();
poke.setClassName("com.android.settings",
"com.android.settings.widget.SettingsAppWidgetProvider");
poke.addCategory(Intent.CATEGORY_ALTERNATIVE);
poke.setData(Uri.parse("3"));
sendBroadcast(poke);
}
} else {
// Button is OFF
Log.i("", "false");
String provider = Settings.Secure.getString(
getContentResolver(),
Settings.Secure.LOCATION_PROVIDERS_ALLOWED);
if (provider.contains("gps")) { // if gps is enabled
final Intent poke = new Intent();
poke.setClassName("com.android.settings",
"com.android.settings.widget.SettingsAppWidgetProvider");
poke.addCategory(Intent.CATEGORY_ALTERNATIVE);
poke.setData(Uri.parse("3"));
sendBroadcast(poke);
}
}
}
});
}

   // this is used for mobile data on and off condition

boolean turnOnDataConnection(boolean ON, Context context) {

try {
if (bv == Build.VERSION_CODES.FROYO)

{
Method dataConnSwitchmethod;
Class<?> telephonyManagerClass;
Object ITelephonyStub;
Class<?> ITelephonyClass;

TelephonyManager telephonyManager = (TelephonyManager) context
.getSystemService(Context.TELEPHONY_SERVICE);

telephonyManagerClass = Class.forName(telephonyManager
.getClass().getName());
Method getITelephonyMethod = telephonyManagerClass
.getDeclaredMethod("getITelephony");
getITelephonyMethod.setAccessible(true);
ITelephonyStub = getITelephonyMethod.invoke(telephonyManager);
ITelephonyClass = Class.forName(ITelephonyStub.getClass()
.getName());

if (ON) {
dataConnSwitchmethod = ITelephonyClass
.getDeclaredMethod("enableDataConnectivity");
} else {
dataConnSwitchmethod = ITelephonyClass
.getDeclaredMethod("disableDataConnectivity");
}
dataConnSwitchmethod.setAccessible(true);
dataConnSwitchmethod.invoke(ITelephonyStub);

} else {
final ConnectivityManager conman = (ConnectivityManager) context
.getSystemService(Context.CONNECTIVITY_SERVICE);
final Class<?> conmanClass = Class.forName(conman.getClass()
.getName());
final Field iConnectivityManagerField = conmanClass
.getDeclaredField("mService");
iConnectivityManagerField.setAccessible(true);
final Object iConnectivityManager = iConnectivityManagerField
.get(conman);
final Class<?> iConnectivityManagerClass = Class
.forName(iConnectivityManager.getClass().getName());
final Method setMobileDataEnabledMethod = iConnectivityManagerClass
.getDeclaredMethod("setMobileDataEnabled", Boolean.TYPE);
setMobileDataEnabledMethod.setAccessible(true);
setMobileDataEnabledMethod.invoke(iConnectivityManager, ON);
}
return true;
} catch (Exception e) {
Log.e("TAG", "error turning on/off data");
return false;
}
}

public void toggleWiFi(boolean status) {
WifiManager wifiManager = (WifiManager) this
.getSystemService(Context.WIFI_SERVICE);
if (status == true && !wifiManager.isWifiEnabled()) {
wifiManager.setWifiEnabled(true);
} else if (status == false && wifiManager.isWifiEnabled()) {
wifiManager.setWifiEnabled(false);
}
}
}

XML

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity" >

    <ToggleButton
        android:id="@+id/toggleButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_above="@+id/imageView1"
        android:layout_alignLeft="@+id/imageView1"
        android:layout_marginBottom="37dp"
        android:text="ToggleButton" />
</RelativeLayout>

And give this permissions to You `Androidmanifest.xml`

   <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
    <uses-permission android:name="android.permission.WAKE_LOCK"/>

Android Check GPS State On and Off condition useing Toggle Button?

MainActivity.java

public class MainActivity extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

final ToggleButton tB = (ToggleButton) findViewById(R.id.toggleButton);
tB.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View arg0) {
if (tB.isChecked()) {
// Button is ON
Log.i("", "true");
Intent intent = new Intent(
"android.location.GPS_ENABLED_CHANGE");
intent.putExtra("enabled", true);
sendBroadcast(intent);

String provider = Settings.Secure.getString(
getContentResolver(),
Settings.Secure.LOCATION_PROVIDERS_ALLOWED);
if (!provider.contains("gps")) { // if gps is disabled
final Intent poke = new Intent();
poke.setClassName("com.android.settings",
"com.android.settings.widget.SettingsAppWidgetProvider");
poke.addCategory(Intent.CATEGORY_ALTERNATIVE);
poke.setData(Uri.parse("3"));
sendBroadcast(poke);
}
} else {
// Button is OFF
Log.i("", "false");
String provider = Settings.Secure.getString(
getContentResolver(),
Settings.Secure.LOCATION_PROVIDERS_ALLOWED);
if (provider.contains("gps")) { // if gps is enabled
final Intent poke = new Intent();
poke.setClassName("com.android.settings",
"com.android.settings.widget.SettingsAppWidgetProvider");
poke.addCategory(Intent.CATEGORY_ALTERNATIVE);
poke.setData(Uri.parse("3"));
sendBroadcast(poke);
}
}
}
});
}
}

activity.xml

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <LinearLayout
        android:id="@+id/toggleButton1"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal" >

        <ToggleButton
            android:id="@+id/toggleButton"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="50dp"
            android:layout_marginRight="50dp"
            android:layout_marginTop="50dp"
            android:text="ToggleButton" />
    </LinearLayout>

</RelativeLayout>

and give permissions to in  `Androidmanifest.xml ` like this 

      <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.WRITE_SETTINGS" />    
    <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>

Android Orientation changes With out reload Activity?

In API level 13 or above, the screen size changes when the orientation changes, so this still causes the activity to be destroyed and started when orientation changes.
Simply add the "screenSize" attribute  in `Androidmanifest.xml`
<activity
    android:name=".YourActivityName"
    android:configChanges="orientation|screenSize">
</activity>
Now, when your change orientation (and screen size changes), the activity keeps its state and onConfigurationChanged() is called. This will keep whatever is on the screen.  

Reference: See this Articals
And here is Another way see picture 


Android Select image from gallery and display in imageview?

GallerysampleActivity.java  
 

  public class GallerysampleActivity extends Activity {
private static Bitmap Image = null;
private static Bitmap rotateImage = null;
private ImageView imageView;
private static final int GALLERY = 1;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

imageView = (ImageView) findViewById(R.id.imageView1);

Button gallery = (Button) findViewById(R.id.button1);
gallery.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View v) {

imageView.setImageBitmap(null);
if (Image != null)Image.recycle();
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select Picture"), GALLERY);
}
});
}

protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == GALLERY && resultCode != 0) {
Uri mImageUri = data.getData();
try {

Image = Media.getBitmap(this.getContentResolver(), mImageUri);
if (getOrientation(getApplicationContext(), mImageUri) != 0) {
Matrix matrix = new Matrix();
matrix.postRotate(getOrientation(getApplicationContext(), mImageUri));
if (rotateImage != null)
rotateImage.recycle();
rotateImage = Bitmap.createBitmap(Image, 0, 0, Image.getWidth(), Image.getHeight(), matrix,
true);
imageView.setImageBitmap(rotateImage);
} else
imageView.setImageBitmap(Image);
} catch (FileNotFoundException e) {

e.printStackTrace();
} catch (IOException e) {

e.printStackTrace();
}
}
}

public static int getOrientation(Context context, Uri photoUri) {
/* it's on the external media. */
Cursor cursor = context.getContentResolver().query(photoUri,
new String[] { MediaStore.Images.ImageColumns.ORIENTATION }, null, null, null);

if (cursor.getCount() != 1) {
return -1;
}

cursor.moveToFirst();
return cursor.getInt(0);
}
}

main.xml 

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:gravity="center"
    android:orientation="vertical" >

    <Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginBottom="100dp"
        android:layout_marginTop="20dp"
        android:text="Go to gallery" />


    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

</LinearLayout>

Output Images






Android : The Connection To Adb Is Down, And A Severe Error Has Occurred.

Problem
- Example] The connection to adb is down, and a severe error has occured.
- Example] You must restart adb and Eclipse.
- Example] Please ensure that adb is correctly located at 
Solution
In some cases, Android project may get crashed or shutdown abnormally, and caused the “adb.exe” to function abnormally.
To solve it, just restart the “adb.exe” process. Restart the Eclipse will not shut down the “adb.exe” process automatically, you need to kill it manually.
Try below steps:
  1. Close the Eclipse if running
  2. Go to the Android SDK platform-tools directory in Command Prompt
  3. type adb kill-server
  4. then type adb start-server
  5. No error message is thrown while starting ADB server, then adb is started successfully.
  6. Now you can start Eclipse again.
it worked for me this way, Eclipse should be closed before issuing these commands.
Restart your phone as well!

PHP Alert Dialog in webview

Activity.jave
here is onpagefinished() method
http://developer.android.com/reference/android/webkit/WebViewClient.html#onPageFinished(android.webkit.WebView, java.lang.String)

protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

String ss = "sdffffffffffffffffffffffff rgfvdg dfgh";
web = (WebView) findViewById(R.id.webView1);

web.setWebViewClient(new WebViewClient() {
@Override
public void onPageFinished(WebView view, String url) {

web.loadUrl("javascript:(function() { alert('hai'); })()");
}
});

web.setWebChromeClient(new WebChromeClient());
web.getSettings().setJavaScriptEnabled(true);
web.loadDataWithBaseURL("", ss, "text/html", "UTF-8", " ");
}

XML R.layout.activity_main

   <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/tabhost"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >

    <WebView
        android:id="@+id/webView1"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</LinearLayout>

output




High lite Specific text in Android Webview

this is main activity class


public class HighliteActivity extends Activity {

@SuppressLint("SetJavaScriptEnabled")
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

final WebView webView = (WebView) findViewById(R.id.webView);
webView.loadUrl("http://polamreddyn.blogspot.in/2013/01/android-text-links-using-linkify.html");

webView.setWebViewClient(new WebViewClient() {
@Override
public void onPageFinished(WebView view, String url) {
Log.i("", "" +url);

@SuppressWarnings("deprecation")
                              // here by default "of" selected
int i = webView.findAll("of"); // is not supposed to crash
Toast.makeText(getApplicationContext(), "Found " + i + " results !", Toast.LENGTH_SHORT).show();
try {
Method m = WebView.class.getMethod("setFindIsUp",Boolean.TYPE);
m.invoke(webView, true);
} catch (Throwable ignored) {
} }
});
}
}

Here `OF` word is selected





Button Animation Example

Android Button Animation Example

MainActivity .java


public class MainActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

final Animation animTranslate = AnimationUtils.loadAnimation(this,R.anim.anim_translate);
final Animation animAlpha = AnimationUtils.loadAnimation(this,R.anim.anim_alpha);
final Animation animScale = AnimationUtils.loadAnimation(this,R.anim.anim_scale);
final Animation animRotate = AnimationUtils.loadAnimation(this,R.anim.anim_rotate);

Button btnTranslate = (Button) findViewById(R.id.translate);
Button btnAlpha = (Button) findViewById(R.id.alpha);
Button btnScale = (Button) findViewById(R.id.scale);
Button btnRotate = (Button) findViewById(R.id.rotate);

btnTranslate.setOnClickListener(new Button.OnClickListener() {
@Override
public void onClick(View v) {
v.startAnimation(animTranslate);
}
});
btnAlpha.setOnClickListener(new Button.OnClickListener() {
@Override
public void onClick(View v) {
v.startAnimation(animAlpha);
}
});
btnScale.setOnClickListener(new Button.OnClickListener() {
@Override
public void onClick(View v) {
v.startAnimation(animScale);
}
});
btnRotate.setOnClickListener(new Button.OnClickListener() {
@Override
public void onClick(View v) {
v.startAnimation(animRotate);
}
});
}
XML 


<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <Button
        android:id="@+id/translate"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_margin="10dp"
        android:text="Translate Animation" />

    <Button
        android:id="@+id/alpha"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_margin="10dp"
        android:text="Alpha Animation" />

    <Button
        android:id="@+id/scale"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_margin="10dp"
        android:text="Scale Animation" />

    <Button
        android:id="@+id/rotate"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_margin="10dp"
        android:text="Rotate Animation" />

</LinearLayout>

Create new fili in
  /res/anim/anim_alpha.xml


<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
    android:interpolator="@android:anim/linear_interpolator" >

    <alpha
        android:duration="500"
        android:fromAlpha="1.0"
        android:repeatCount="1"
        android:repeatMode="reverse"
        android:toAlpha="0.1" />
</set>
 /res/anim/anim_rotate.xml

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
   android:interpolator="@android:anim/linear_interpolator">
   <rotate
       android:fromDegrees="0"
       android:toDegrees="360"
       android:pivotX="50%"
       android:pivotY="50%"
       android:duration="500"
       android:startOffset="0"
       android:repeatCount="1"
       android:repeatMode="reverse" />
</set>

 /res/anim/anim_scale.xml


<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
   android:interpolator="@android:anim/linear_interpolator">
   <scale
       android:fromXScale="1.0"
       android:toXScale="3.0"
       android:fromYScale="1.0"
       android:toYScale="3.0"
       android:pivotX="50%"
       android:pivotY="50%"
       android:duration="500"
       android:repeatCount="1"
       android:repeatMode="reverse" />
</set>


 /res/anim/anim_translate.xml


<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
    android:interpolator="@android:anim/linear_interpolator" >

    <translate

        android:duration="500"
        android:fromXDelta="0"
        android:repeatCount="1"
        android:repeatMode="reverse"
        android:toXDelta="100%p" />
</set>

Select DateRange UsingRangePicker.

  /* * This Method is for select range from picker. * */ private fun selectDateRangeUsingRangePicker () { pageNumber = 1 val displ...