Thursday 25 September 2014

Introduction screen similar to Flickr

Creating Introduction screen like Flickr or other Yahoo apps ..



Prerequisite for this  we should have the basic understand the working on Fragments and Activity working ..
Also we should have worked with animation class ..

Here we are trying to get the basic idea / getting the basic working model .


So here we go ..


MainActivity


package info.androidhive.tabsswipe;

import info.androidhive.tabsswipe.adapter.TabsPagerAdapter;

import java.util.ArrayList;

import android.animation.TypeEvaluator;
import android.animation.ValueAnimator;
import android.animation.ValueAnimator.AnimatorUpdateListener;
import android.app.ActionBar;
import android.app.ActionBar.Tab;
import android.app.FragmentTransaction;
import android.graphics.RectF;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.view.ViewPager;
import android.util.Log;
import android.view.View;
import android.view.Window;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;
import android.view.animation.AnimationSet;
import android.view.animation.ScaleAnimation;
import android.view.animation.TranslateAnimation;
import android.widget.TextView;

public class MainActivity extends FragmentActivity implements
ActionBar.TabListener {

private ViewPager viewPager;
private TabsPagerAdapter mAdapter;
private ArrayList fragments;
TopRatedFragment topRatedFragment;
GamesFragment gamesFragment;
MoviesFragment moviesFragment;
public TextView textView;
public int lastDelta = 0;

// Tab titles
private String[] tabs = { "Top Rated", "Games", "Movies" };

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_main);
topRatedFragment = new TopRatedFragment();
gamesFragment = new GamesFragment();
moviesFragment = new MoviesFragment();
textView = (TextView) findViewById(R.id.txtFirst);

// Initilization
viewPager = (ViewPager) findViewById(R.id.pager);
fragments = new ArrayList();
fragments.add(topRatedFragment);
fragments.add(gamesFragment);
// fragments.add(moviesFragmen t);

mAdapter = new TabsPagerAdapter(getSupportFragmentManager() , fragments);

viewPager.setAdapter(mAdapter);

/**
* on swiping the viewpager make respective tab selected
* */
viewPager.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {

@Override
public void onPageSelected(int position) {
// on changing the page
// make respected tab selected

}

@Override
public void onPageScrolled(int arg0, float arg1, int position) {

Log.d("arg0", ""+arg0);
Log.d("arg1", ""+arg1);
Log.d("arg2", ""+position);

if (position > 0) {



MainActivity.this.textView.startAnimation(MainActivity.this.getMaximAnim(position));

gamesFragment.graphicsView.rotateAnim = null;
gamesFragment.graphicsView.delta = position;
gamesFragment.graphicsView.invalidate();


/*ValueAnimator va = ValueAnimator.ofInt(0,500);
va.addUpdateListener(new AnimatorUpdateListener() {

@Override
public void onAnimationUpdate(ValueAnimator animation) {
// TODO Auto-generated method stub
Integer value = (Integer) animation.getAnimatedValue();
// MainActivity.this.textView.getLayoutParams().height += value.intValue();
MainActivity.this.textView.getLayoutParams().height += 100;
MainActivity.this.textView.requestLayout();
}
});

va.start();*/


}

}

@Override
public void onPageScrollStateChanged(int arg0) {

}
});
}

@Override
public void onTabReselected(Tab tab, FragmentTransaction ft) {
}

@Override
public void onTabSelected(Tab tab, FragmentTransaction ft) {
// on tab selected
// show respected fragment view
viewPager.setCurrentItem(tab.getPosition());
}

@Override
public void onTabUnselected(Tab tab, FragmentTransaction ft) {
}



public void setTypeValuator(View view){

}


public Animation getMaximAnim(int xDelta ) {

int duration = 500;
int value = xDelta/2;
TranslateAnimation slide = new TranslateAnimation(0, 0, value * -1 , lastDelta);
int xValue = (xDelta /4)/4;
int xOld = -xValue ;


Log.d("ScaleAnimation", "xValue "+xValue +" xOld " + xOld);

if ( xOld <= 0 || xValue <=0 ) {
xOld = 1;
xValue = 1;
}

ScaleAnimation scaleAnimation = new ScaleAnimation(1, 2, 1, 2,
               ScaleAnimation.RELATIVE_TO_SELF, 0.5f,
               ScaleAnimation.RELATIVE_TO_SELF,0.5f);
scaleAnimation.setDuration(100);
scaleAnimation.setFillAfter(true);
scaleAnimation.setStartOffset(0);
// scaleAnimation.setRepeatCount(Animation.INFINITE);
// scaleAnimation.setRepeatMode(Animation.REVERSE);


lastDelta = value * -1;
slide.setDuration(0);
slide.setFillAfter(true);
AnimationSet anims = new AnimationSet(true);
anims.setFillAfter(true);
// anims.addAnimation(scaleAnimation);
anims.addAnimation(slide);
anims.setAnimationListener(new AnimationListener() {

@Override
public void onAnimationStart(Animation animation) {
// TODO Auto-generated method stub
Log.d("ScaleAnimation " ,"Start");
}

@Override
public void onAnimationRepeat(Animation animation) {
// TODO Auto-generated method stub
Log.d("ScaleAnimation " ,"Repeat");
}

@Override
public void onAnimationEnd(Animation animation) {
// TODO Auto-generated method stub
Log.d("ScaleAnimation " ,"End");
}
});

return anims;
}


public class RectFEvaluator
    implements TypeEvaluator {

@Override
public RectF evaluate(float fraction, RectF srcRect, RectF destRect) {
RectF betweenRect = new RectF();
       betweenRect.bottom = srcRect.bottom + fraction*(destRect.bottom-srcRect.bottom);
       betweenRect.top = srcRect.top + fraction*(destRect.top-srcRect.top);
       betweenRect.left = srcRect.left + fraction*(destRect.left-srcRect.left);
       betweenRect.right = srcRect.right + fraction*(destRect.right-srcRect.right);
       return betweenRect;
}

}

}








Games Fragment



package info.androidhive.tabsswipe;

import info.androidhive.tabsswipe.R;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.Path.Direction;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.AccelerateDecelerateInterpolator;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.AnimationSet;
import android.view.animation.AnimationUtils;
import android.view.animation.RotateAnimation;
import android.view.animation.TranslateAnimation;
import android.widget.TextView;

public class GamesFragment extends Fragment {

public TextView txt;
public Animation zoomin;
public int lastDelta = 0;
public GraphicsView graphicsView;

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {

View rootView = inflater.inflate(R.layout.fragment_games, container,
false);
rootView.requestLayout();
graphicsView = new GraphicsView(getActivity());
rootView = graphicsView;

txt = (TextView) rootView.findViewById(R.id.txtFirst);
zoomin = AnimationUtils.loadAnimation(getActivity(), R.anim.zoom_exit);

return rootView;
}

public static class GraphicsView extends View {
public static final String AnimatedTxt = "This is Atos Demo . This is Atos Demo .This is Atos Demo .This is Atos Demo .This is Atos Demo ." +
"This is Atos Demo .This is Atos Demo .This is Atos Demo .This is Atos Demo .";

public Animation rotateAnim;
public int delta;

public GraphicsView(Context context) {
super(context);
}

public void createAnim(Canvas canvas) {

if (delta > 0) {

rotateAnim = new RotateAnimation(delta, 360,canvas.getWidth() / 2, canvas.getHeight() / 2);
// rotateAnim.setRepeatMode(Animation.REVERSE);
rotateAnim.setRepeatCount(Animation.INFINITE);
rotateAnim.setDuration(10000L);
rotateAnim.setInterpolator(new AccelerateDecelerateInterpolator());
startAnimation(rotateAnim);
}
}

@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);

// creates the animation the first time
if (rotateAnim == null) {
createAnim(canvas);
}

Path circle = new Path();

int centerX = canvas.getWidth() / 2;
int centerY = canvas.getHeight() / 2;
int r = Math.min(centerX, centerY);

circle.addCircle(centerX, centerY, r, Direction.CW);
Paint paint = new Paint();
paint.setColor(Color.GREEN);
paint.setTextSize(30);
paint.setAntiAlias(true);

canvas.drawTextOnPath(AnimatedTxt, circle, 0, 30, paint);
}
}

}


Thursday 18 September 2014

About Me

About Blog.


This Blog is all about sharing knowledge and helping everyone , Its just like a reference center a help book ..








About Me ..

Hi m a Software Learner working on Mobility Platform and happy to help others.




Wednesday 17 September 2014

Show Dialog using Service

Hi ,

In this post lets try to display a dialog box by using a service .
It's a common problem we face while and most of the time we end up by getting Windows Bad Token exception ... as we cannot use service object to display a dialog , So what's the turn around ..


Hears the solution ..

Create an Activity and display a dialog using it , but while defining an activity in Manifest file just set the theme as dialog box .


Chalo lets C how actually its done ..



Hear's my main activity , I am using it to start the service ..

package com.android.servicedialog;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MainActivity extends Activity  implements OnClickListener{

Button btnStart;
Button btnStop;
private Intent intent;

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


btnStart = (Button) findViewById(R.id.btnStartService);
btnStop = (Button) findViewById(R.id.btnStopService);

btnStart.setOnClickListener(this);
btnStop.setOnClickListener(this);
intent = new Intent(MainActivity.this , DemoService.class);


}

@Override
public void onClick(View v) {

if (v.getId() == R.id.btnStartService) {

MainActivity.this.startService(intent);


}else if(v .getId() == R.id.btnStopService){

MainActivity.this.stopService(intent);

}
}


}





Here come's the service code ...
A simple service which starts a activity on its onStart method



package com.android.servicedialog;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;

public class DemoService extends Service {

@Override
public IBinder onBind(Intent intent) {

return null;
}


@Override
public int onStartCommand(Intent intent, int flags, int startId) {

intent = new Intent(DemoService.this , DialogActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
this.startActivity(intent);
return super.onStartCommand(intent, flags, startId);
}

@Override
public void onDestroy() {
super.onDestroy();
}



}



This is the Activity code .. from here we are going to show the Dialog box . 

package com.android.servicedialog;

import android.app.Activity;
import android.os.Bundle;
import android.view.Window;

public class DialogActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
Utils.showAlertDialogBox("Sample Msg from Service", DialogActivity.this);
}

}


This is the Util's class .. here we have created a Custom Dialog Box 


package com.android.servicedialog;

import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.view.View;
import android.view.Window;
import android.view.View.OnClickListener;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.TextView;

public class Utils {
/*
 * Display alert dialog box as per the parameter
 */
public static void showAlertDialogBox(String msg, final Activity activity) {
final Dialog dialog = new Dialog(activity);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(R.layout.custom_dialog);

TextView title = (TextView) dialog.findViewById(R.id.textTitle);
title.setText("BreakDown!!");

TextView txtSubTitle = (TextView) dialog
.findViewById(R.id.textSubTitle);
txtSubTitle.setText(msg);

Button dialogButton = (Button) dialog.findViewById(R.id.btnOk);
// if button is clicked, close the custom dialog
dialogButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
activity.finish();
}
});

dialog.show();
}
}


Here comes the MOST IMP part .. The manifest file .. Here we have defined the activity and then set the style to Dialog ..


      < service
            android:name="com.android.servicedialog.DemoService">
       
        < /service>
   
       < activity
            android:name="com.android.servicedialog.DialogActivity"
            android:theme="@style/Theme.AppCompat.CompactMenu.Dialog">
       
      < /activity>
   





Wednesday 5 February 2014

Android Butterknife

Android Butterknife


I came across butterknife few weeks back when I was going through the resumes and I started reading about dependency injections in android. Butterknife injects code at compile time and almost similar to the java annotations .
I have found it very useful and easy to use in android but very few of us know about it .  So lets try and use it and try to understand if it is helpful or not .

WHY SHOULD WE USE IT ??
It reduces code and make developer life easy . Also help in maintain code readability. 

Prerequisites 

Download the jar 
Click here to download jar

If link dose not work do drop mail or comment so that I can share  the latest version 4.0.1

Create a Android project and the lib as the usual process 




Add annotaions 







Add Factory Path Jar 




Once we are done till here we are full set to use butter knief
Now here comes the main QUESTION 



Lets take a look at normal way we code in Android till now .


Declaring variables

ImageView mTeamOne;
ImageView mTeamTwo;
Button mButton;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

View view = inflater.inflate(R.layout.fragment_current_matched, container, false);
mTeamOne = (ImageView) view.findViewById(R.id.imageview_teamone);
mTeamTwo = (ImageView) view.findViewById(R.id.imageview_teamtwo);
mButton = (ImageView)  view.findViewById( R.id.imageview_button);


}


But there's a smart way butter knife provides 

public class MainActivity extends Activity {

@InjectView(R.id.button1) Button button_one;
@InjectView(R.id.button2) Button button_two;

protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main);
ButterKnife.inject(this);

}
}


Setting onClickListeners

Normal way to do it.

button_one.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View v) {

}
});


button_two.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View v) {

}
});


ButterKnief Smater way

@OnClick(R.id.button1)
public void attemptLogin() {
         // Logic
}

Now lets see how we can set listeners for multiple views 

@OnClick({R.id.button1 , R.id.button2})
public void doOnClick(View v){

switch (v.getId()) {
case R.id.button1:
showToast(v, "One");
break;

case R.id.button2:
showToast(v, "Two");
break;
default:
break;
}

}


Performance 

RoboGuice and Dagger does the same thing but make a performance impact as it's done on runtime using reflection and in ButterKnief its done at compiletime .


Thanks for reading and hope it helped U..
Happy Coding...



Sunday 6 October 2013

Android Air Gesture Example

Hi ...
Today I learned something about Air gestures and was thinking of sharing it.

Air Gestures is included in android since API level 14 which is Android 4.0... In market we have devices like Samsung S4 and many more about to launch .....

So lets try to understand the Air Gestures and try to implement it.

We need to overwrite the "setOnHoverListener" method of view where we need hover gestures .

Here is an example where I have tried to implement  onHover change on a listview

listView.setOnHoverListener( new OnHoverListener() {



@Override
public boolean onHover(View v, MotionEvent event) {
try {

switch (event.getAction()) {

// THIS IS POINT WHERE HAND WAS DETECTED
                case MotionEvent.ACTION_HOVER_ENTER:                    
               
                      x_enter = event.getX();
                    y_enter = event.getY();
                 
                    break;
// THESE ARE THE POINTS WHICH U WILL GET WHEN THE MOVEMENT IS GOING ON
                case MotionEvent.ACTION_HOVER_MOVE:                    
                 
                      event.getX();
                     event.getY();
                 
                    break;
// THESE ARE THE END POINTS WHERE THE HAND MOVEMENT FINISHED
                case MotionEvent.ACTION_HOVER_EXIT:
                 
                    x_exit = event.getX();
                    y_exit = event.getY();
                   
//ALGORITHM TO CALCULATE LEFT OR RIGHT MOVEMENT
                    decideMovement(x_enter, y_enter, x_exit, y_exit);
                    break;
            }

} catch (Exception e) {
// TODO: handle exception
}

return true;
}
});

public void decideMovement(float x_enter,float y_enter,float x_exit,float y_exit ){

// NOW WE CAN DO THE GESTURE DETECTION CALCULATIONS TO FIND OUT ANY MOVEMENTS WE WANT EG TOP,BOTTOM,RIGHT,LEFT

    float diffY = y_exit - y_enter;
    float diffX = x_exit - x_enter;
     
       if (diffX > 0) {
           slideLeft();
       } else {
           slideRight();
       }
     
   
}

Thanks for reading and hope it helped U..
Happy Coding...

Tuesday 11 December 2012

Android Emulator Keyboard Shortcuts

  Android Emulator Keyboard Shortcuts


Hi following is the list of key that we can use to control android emulator.


Emulator Key
Keyboard Key
Home
Home
Menu (left softkey)
F2 or Page-up button
Star (right softkey)
Shift-F2 or Page Down
Back
ESC
Call/dial button
F3
Hangup/end call button
F4
Search
F5
Power button
F7
Audio volume up button
KEYPAD_PLUS, Ctrl-5
Audio volume down button
KEYPAD_MINUS, Ctrl-F6
Camera button
Ctrl-KEYPAD_5, Ctrl-F3
Switch to previous layout orientation
KEYPAD_7, Ctrl-F11
Switch to next layout orientation
KEYPAD_9, Ctrl-F12
Toggle cell networking on/off
F8
Toggle code profiling
F9 (only with -trace startup option)
Toggle fullscreen mode
Alt-Enter
Toggle trackball mode
F6
Enter trackball mode temporarily
Delete
DPad left/up/right/down
KEYPAD_4/8/6/2
DPad center click
KEYPAD_5
Onion alpha increase/decrease
KEYPAD_MULTIPLY(*) / KEYPAD_DIVIDE(/)

Thanks for reading and hope it helped U..
Happy Coding...


Wednesday 24 October 2012

Android ListView with Radio Buttons and Selected items

Hi Guys ,

Lets try to create a List View in Android which has a Radio button so we can choose from the options .

To create a list view we have to define it in xml file . But if we want to make the list view with radio buttons then we have set choice mode property .

for eg :


<ListView
        android:id="@+id/lstDemo"
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content"
        android:choiceMode="singleChoice">
     
    </ListView>

Then once our xml is ready we can create the List view object in Activity .

ListView listView;
ArrayList< String>arrayList; // list of the strings that should appear in ListView
ArrayAdapter arrayAdapter; // a middle man to bind ListView and array list 

In addition to list view we need objects of ArrayList and ArrayAdapter .

now we have to initialize all objects in Oncreate() method .

 listView = (ListView) findViewById(R.id.lstDemo);


// LIST OF STRINGS / DATA THAT SHOULD APPEAR IN LISTVIEW HERE WE HAVE HARD CODED IT WE CAN TAKE THIS INPUT FROM USER AS WELL



arrayList = new ArrayList();
        arrayList.add("India");
        arrayList.add("USA");
        arrayList.add("England");
        arrayList.add("Singapur");
        arrayList.add("China");
        arrayList.add("Canada");
        arrayList.add("Srilanka");
        arrayList.add("SouthAfrica");
        



 arrayAdapter = new ArrayAdapter(getApplicationContext(),android.R.layout.simple_list_item_single_choice,arrayList);
 listView.setAdapter(arrayAdapter);


Thats it if we run the application we will be able to see a list view with radio buttons. 
Now that we have list view with radio buttons lets try to highlight the selected items.

For doing this we should get the selected items in list view , for this we have to implement 
onitemClick listener in listview so here goes the code.

   listView.setOnItemClickListener(new OnItemClickListener() {

@Override
public void onItemClick(AdapterView arg0, View view, int position,
long arg3) {
}
});


      When we click on item on list view we can get it catch item selected in itemClickedListener.
So view is the item clicked in list view and position is the position of that item in list view which is clicked.
      Now that we know which item is click we can easily change the color of text but when we click on next item we we have to deselect the old selected item means recolor it back to default , and then hight the new selected item by coloring it .
      Lets C how to do it .


 listView.setOnItemClickListener(new OnItemClickListener() {

@Override
public void onItemClick(AdapterView arg0, View view, int position,
long itemId) {
/*  
*  when we click on item on list view we can get it catch item here.
* so view is the item clicked in list view and position is the position 
* of that item in list view which was clicked.
* Now that we know which item is click we can easily change the color
* of text but when we click on next item we we have to deselect the old 
* selected item means recolor it back to default , and then hight the 
* new selected item by coloring it .
* So here's the code of doing it.
* */
CheckedTextView textView = (CheckedTextView) view;
for (int i = 0; i < listView.getCount(); i++) {
textView= (CheckedTextView) listView.getChildAt(i);
if (textView != null) {
textView.setTextColor(Color.WHITE);
}
}
listView.invalidate();
textView = (CheckedTextView) view;
if (textView != null) {
textView.setTextColor(Color.BLUE);
}

}
});


You can take a look of code here 

XML code


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" >

    <ListView
        android:id="@+id/lstDemo"
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content"
        android:choiceMode="singleChoice">
     
    </ListView>

</LinearLayout>




Activity Code


package com.android.demo.listview;

import java.text.ChoiceFormat;
import java.util.ArrayList;

import android.app.Activity;
import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.CheckedTextView;
import android.widget.ListView;

public class BlogListVIewActivity extends Activity {
ListView listView;
ArrayList< String>arrayList; // list of the strings that should appear in ListView
ArrayAdapter arrayAdapter; // a middle man to bind ListView and array list 
   
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        listView = (ListView) findViewById(R.id.lstDemo);
        
        
        // LIST OF STRINGS / DATA THAT SHOULD APPEAR IN LISTVIEW HERE WE HAVE HARD CODED IT WE CAN TAKE THIS INPUT FROM USER AS WELL
        
        arrayList = new ArrayList();
        arrayList.add("India");
        arrayList.add("USA");
        arrayList.add("England");
        arrayList.add("Singapur");
        arrayList.add("China");
        arrayList.add("Canada");
        arrayList.add("Srilanka");
        arrayList.add("SouthAfrica");
        
       
        
        
        arrayAdapter = new ArrayAdapter(getApplicationContext(), android.R.layout.simple_list_item_single_choice,arrayList);
        listView.setAdapter(arrayAdapter);
        
        
        //  LETS HIGHLIGHT SELECTED ITEMS
        
        listView.setOnItemClickListener(new OnItemClickListener() {

@Override
public void onItemClick(AdapterView arg0, View view, int position,
long itemId) {
/*  
*  when we click on item on list view we can get it catch item here.
* so view is the item clicked in list view and position is the position 
* of that item in list view which was clicked.
* Now that we know which item is click we can easily change the color
* of text but when we click on next item we we have to deselect the old 
* selected item means recolor it back to default , and then hight the 
* new selected item by coloring it .
* So here's the code of doing it.
* */
CheckedTextView textView = (CheckedTextView) view;
for (int i = 0; i < listView.getCount(); i++) {
textView= (CheckedTextView) listView.getChildAt(i);
if (textView != null) {
textView.setTextColor(Color.WHITE);
}
}
listView.invalidate();
textView = (CheckedTextView) view;
if (textView != null) {
textView.setTextColor(Color.BLUE);
}

}
});
        
        
     
        
    }
}









Thanks for reading and hope it helped U..
Happy Coding...