[android-developers] How to change the RatingBar style from the code

2011-11-23 Thread yoav bbb
Hey

I have 2 styles for my RatingBar (difference is in the star image).

I have an activity with a rating bar in it. I want the ratingbar to
use one of the styles depending on the application state (e.g. flag is
true/flase).

Is there any way to do it

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Listviewitem height does not update to wrap the content

2011-11-08 Thread yoav bbb
I have a list activity with listviewitem layout. The listviewitem
contains a textview, the porblem is that if the string in the textview
is too long - e.g. 3 lines, then the listviewitem height does not
change to wrap the content. I am using adapter for the listview.

The problem happens only when inserting new items using the
adapter!!

Here are the layout and the adapter:

public class RecipeInstructionsListViewAdapter extends
ArrayAdapter
{
private Context mContext;
private ArrayList mItems;
private LayoutInflater mInflater;

public RecipeInstructionsListViewAdapter(Context context, int
textViewResourceId,ArrayList items)
{
super(context,textViewResourceId,items);

mContext=context;
mItems=items;

 
mInflater=(LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}

@Override
public View getView(int position,View convertView,ViewGroup
parent)
{
ViewHolder holder = new ViewHolder();

if(convertView == null)
{
convertView
=mInflater.inflate(R.layout.recipes_instruction_list_single_view_entry,
null);
}

  if( super.getItem(position) != null )
  {
  holder.instructionIndex   = (TextView)
convertView.findViewById( R.id.listUp_RecipeInstructionNumberTextBoxId );
  holder.instructionText= (TextView)
convertView.findViewById( R.id.listUp_RecipeInstructioTextTextBoxId );
  holder.instructionImage   =
(ImageView)convertView.findViewById( R.id.listUp_RecipeInstructionImageViewId );

  Typeface tf =
Typeface.createFromAsset(mContext.getAssets(), "Eras_Bold.ttf");
  holder.instructionIndex.setTypeface(tf);
  holder.instructionIndex.setTextSize(30);
 
holder.instructionIndex.setTextColor( GlobalDefs.GetHeadlineColor() );
 
holder.instructionIndex.setText( 
Integer.toString(mItems.get(position).getIndex() ) );

  tf = Typeface.createFromAsset(mContext.getAssets(),
"Arial.ttf");
  holder.instructionText.setTypeface(tf);
  holder.instructionText.setTextSize(14);
  holder.instructionText.setTextColor( Color.BLACK );
 
holder.instructionText.setText( mItems.get(position).getText() );

  String imageLocation =
mItems.get(position).GetInstructionImageLocation();
  if( imageLocation != null )
  {
 
holder.instructionImage.setImageURI( Uri.parse( imageLocation ) );
 
holder.instructionImage.setVisibility( View.VISIBLE );
  }
  else
  {
  holder.instructionImage.setVisibility( View.GONE );
  }

  convertView.setTag(holder);
  convertView.setLayoutParams( new
ListView.LayoutParams(LayoutParams.FILL_PARENT,
LayoutParams.WRAP_CONTENT));
  }
  else
  {
  }

  return convertView;
}

@Override
public boolean isEnabled(int position)
{
return true;
}

static class ViewHolder
{
  TextView  instructionIndex;
  TextView  instructionText;
  ImageView instructionImage;
}
}
xml:


http://schemas.android.com/apk/res/android";
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/list_up" >









-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Tab and TabsHost sharing data issue

2011-08-08 Thread yoav bbb
Someone has any ideas?
I understood there is a way all tabs under 1 activity? like view?

how to do it?

On 8 אוגוסט, 06:55, yoav bbb  wrote:
> Hello
> I have an application with 1 tabHast that runs 3 tab activities inside
> it.
> In 1 tab there are EditText boxes that user fill.
>
> In the TabHost there is a button - when user presses it - I have to
> get the text the user entered in the EditText boxes - - even if it is
> not the current tab.
>
> Any ideas?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: EditText text validation

2011-08-08 Thread yoav bbb
So.
The validate function must be called when ressing a button?
no option to call the function when user leaves the textbox - to the
backgour or to another control?

On 9 אוגוסט, 06:24, TreKing  wrote:
> On Sun, Aug 7, 2011 at 10:57 PM, yoav bbb  wrote:
> > Where is the hook for the validate function?
>
> There isn't one, AFAIK.
>
> --- 
> --
> TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
> transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] EditText text validation

2011-08-08 Thread yoav bbb
Hello
I have an EditText box that user fills with its text.
I need to run a simple Validate() function on its data when the user
leaves this text box and alert him if the input String is
incompatible.
Where is the hook for the validate function?

Thanks

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Tab and TabsHost sharing data issue

2011-08-08 Thread yoav bbb
Hello
I have an application with 1 tabHast that runs 3 tab activities inside
it.
In 1 tab there are EditText boxes that user fill.

In the TabHost there is a button - when user presses it - I have to
get the text the user entered in the EditText boxes - - even if it is
not the current tab.

Any ideas?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Create my own lock screen

2011-07-19 Thread yoav bbb
Hello,
I am trying to crate my own new lock screen, but I cannot find how to
do it, using a new unlock method instead of the regular swipe.

Someone recommended using powermanager class, but I could not find a
way to use it for this purpose.

Any ideas?

Any code to refer to?

Thanks

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] New program to answer an incoming call

2011-07-12 Thread yoav bbb
Hello,
I want to try and write a new program that will be used to answer an
incoming call, instead of the supported by the phone.
Is it possible?
Do I have to use PhoneStateListener class?
I saw there is a method onCallStateChanged with state as input
parameter - CALL_RINGING.
If I use it, how do I answer the call?

Thanks
Yoav

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Lock screen

2011-07-12 Thread yoav bbb
Hello,

Is it possible to change the default lock screen and use one of my
own? with another way to unlock it?

Yoav

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en