[android-developers] Re: Is there an easy way to make EditText look like TextView but still behave like EditText?

2009-05-21 Thread damnesia

Is it possible to implement style=?android:attr/textViewStyle
dynamically?


On May 20, 3:10 am, n5r11 nikolaradosavlje...@gmail.com wrote:
 This seems to be working..
 android:background=@null removes the background, but the text color
 stays the same. It takes another explicit android:textColor=@null to
 fix that. I guess those are the values that are set in the
 editTextStyle, but not in textViewStyle, so they stay the same after
 style=?android:attr/textViewStyle and need to be nulled-out
 explicitly. I'm not sure what's really going on here, but this seems
 to be a clean solution to this problem.
 The documentation should be more explaining, with more complete and
 thought-out examples..

 Thanks people - a lot!

 PS: Don't trust the layout tab in the xml editor too much..

 On 20 мај, 02:53, Jeff Sharkey jshar...@android.com wrote:

  This is probably because theEditTextstill inherits an
  android:background value from the default system Theme, because the
  textViewStyle doesn't force a @null background.

  Try adding an explicit android:background=@null, which should remove
  theEditText9-patch frame and any padding that comes with it.

  j

  On Tue, May 19, 2009 at 5:19 PM, n5r11 nikolaradosavlje...@gmail.com 
  wrote:

   I've tried all that you suggested, and nothing happens?EditTextstill
   looks the same, both in IDE and when compiled on emulator.

   EditText
      style=?android:attr/textViewStyle
      android:layout_width=fill_parent
      android:layout_height=wrap_content
      android:text=Neque porro quisquam est qui.dolorem.com ipsum /

   EditText
      style=@android:style/Widget.TextView
      android:layout_width=fill_parent
      android:layout_height=wrap_content
      android:text=Neque porro quisquam est qui.dolorem.com ipsum /

   I see I'm not the only one with this problem:
  http://groups.google.rs/group/android-developers/browse_frm/thread/29...

   n5r11

   On 19 мај, 02:05, Jeff Sharkey jshar...@android.com wrote:
   You should actually be using an attribute instead of a direct reference:

   style=?android:attr/textViewStyle

   The underlying @style reference isn't public, but the above attr is.

   j

   On Mon, May 18, 2009 at 4:30 PM, MrSnowflake mrsnowfl...@gmail.com 
   wrote:

Might be: style=@android:style/Widget.TextView

Otherwise, make a TextView and anEditTextand change the GONE state
of them.

On 18 mei, 19:33, Raphael r...@android.com wrote:
Try this:
        android:style=@android:style/Widget.TextView

R/

On Sun, May 17, 2009 at 3:31 PM, Nikola Radosavljevic

nikolaradosavlje...@gmail.com wrote:
 Note: I had troubles posting to android-beginners group, so I came 
 here
 hoping this will work.
 Hello there,

 I want anEditTextto look like TextView but still behave like
EditText. I've tried applying TextView style to myEditTextin my
 layout.xml file, like this:

 EditText
        android:id=@+id/lipsum
        android:text=Lorem ipsum
        android:style=@android:style/Widget_TextView
 /

 ..but I get an error within xml editor: Error: No resource found 
 that
 matches the given name (at 'style' with value '@android:style/
 Widget_TextView'). It is strange because @android:style/
 Widget_TextView definitively exists - I double checked it in code 
 via
 android.R.style.Widget_TextView. Another strange thing is that I 
 don't
 get android:style offered in the xml editor while typing? There is
 android:id, android:text and everything else.. but not
 android:style?!

 Note: I consider the hard way (makingEditTextlook like TextView) to
 be: extendingEditTextand overriding it's onDraw method.

Nikolar

 PS: Check out
http://developer.android.com/guide/topics/ui/themes.html#styles.
 Why are id and style written without android: namespace?

   --
   Jeff Sharkey
   jshar...@android.com

  --
  Jeff Sharkey
  jshar...@android.com
--~--~-~--~~~---~--~~
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: dynamically setting drawSelectorOnTop

2009-05-14 Thread damnesia

ok. it turns out that the real problem was TableRow.LayoutParams(2,
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT). i changed it to
TableRow.LayoutParams(2) and it works as expected.

thanks again.

On May 13, 11:10 pm, Romain Guy romain...@google.com wrote:
 Oops my bad, you were talking about *Spinner*. Spinner does NOT
 support android:drawSelectorOnTop, so there's no equivalent Java API.
 Setting this attribute in XML has absolutely no effect (in particular
 because a Spinner does not have a selector.)



 On Wed, May 13, 2009 at 7:59 PM, damnesia r.spencer.wh...@gmail.com wrote:

  Yeah, I saw it in the documentation online but when I do
  spinner.setDrawSelectorOnTop(true); I get The method
  setDrawSelectorOnTop(boolean) is undefined for the type Spinner.

  I am using Android android-sdk-linux_x86-1.1_r1. Do I need to upgrade?

  Thank you for your time.

  On May 13, 2:59 pm, Romain Guy romain...@google.com wrote:
  It's in the documentation :) Hint, look for setDrawSelectorOnTop(boolean).

  On Wed, May 13, 2009 at 2:53 PM, damnesia r.spencer.wh...@gmail.com 
  wrote:

   Is it possible to dynamically set the drawSelectorOnTop attribute on a
   Spinner instead of having to do it in the layout XML?

  --
  Romain Guy
  Android framework engineer
  romain...@android.com

  Note: please don't send private questions to me, as I don't have time
  to provide private support.  All such questions should be posted on
  public forums, where I and others can see and answer them

 --
 Romain Guy
 Android framework engineer
 romain...@android.com

 Note: please don't send private questions to me, as I don't have time
 to provide private support.  All such questions should be posted on
 public forums, where I and others can see and answer them
--~--~-~--~~~---~--~~
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: dynamically setting drawSelectorOnTop

2009-05-13 Thread damnesia

Yeah, I saw it in the documentation online but when I do
spinner.setDrawSelectorOnTop(true); I get The method
setDrawSelectorOnTop(boolean) is undefined for the type Spinner.

I am using Android android-sdk-linux_x86-1.1_r1. Do I need to upgrade?

Thank you for your time.


On May 13, 2:59 pm, Romain Guy romain...@google.com wrote:
 It's in the documentation :) Hint, look for setDrawSelectorOnTop(boolean).

 On Wed, May 13, 2009 at 2:53 PM, damnesia r.spencer.wh...@gmail.com wrote:

  Is it possible to dynamically set the drawSelectorOnTop attribute on a
  Spinner instead of having to do it in the layout XML?

 --
 Romain Guy
 Android framework engineer
 romain...@android.com

 Note: please don't send private questions to me, as I don't have time
 to provide private support.  All such questions should be posted on
 public forums, where I and others can see and answer them
--~--~-~--~~~---~--~~
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: RingtoneManager.ACTION_RINGTONE_PICKER

2009-03-27 Thread damnesia

thank you for your reply. I am doing that in the method named
getToneToRing(data). it is called in the code, but i did not include
the method code. i can get the result it returns, but it returns one
before I have a chance to pick any of them. Its like the setResult()
method is being called before the RingtonePicker dialog is displayed
to the screen.

On Mar 26, 10:21 pm, for android forandr...@gmail.com wrote:
 Yes you are missing in the onActivityResult

 U need to check the result code.

 Look @ the sample i have attached.

 @Override
     protected void onActivityResult(int requestCode, int resultCode, Intent
 data) {
         switch (resultCode) {
         /*
          * case RESULT_OK: this.setResult(RESULT_OK); this.finish(); break;
          */

         case RESULT_OK:
             Uri uri = data

 .getParcelableExtra(RingtoneManager.EXTRA_RINGTONE_PICKED_URI);
             Log.i(Sample, uri  + uri);
             RingtoneManager.setActualDefaultRingtoneUri(this,
                     RingtoneManager.TYPE_RINGTONE, uri);
             break;
         }
     }

 On Thu, Mar 26, 2009 at 10:00 AM, damnesia r.spencer.wh...@gmail.comwrote:



  Hello. I tried to post earlier and my browser was acting funky. I
  don't see the post, so I am adding another. I apologize if both show
  up.

  I am using Android SDK 1.1_r1. I want a user to be able to open the
  ringtone picker, select a ringtone, it the OK button and have the
  result sent back to the parent activity. When I start the ringtone
  picker as a sub-activity, it appears to call setResult() immediately.
  I could be way off and just not understand how this works. Here is the
  code that I am using to lauch the sub-activity:

  mPickRingTone.setOnClickListener(new View.OnClickListener()
  {
     public void onClick( View v )
     {
          ringMe.startRingPick();
      }
  });

  private void startRingPick()
  {
     Intent i = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER);
     startActivityForResult(i, ACTIVITY_SET_RINGTONE);
  }

  @Override
  protected void onActivityResult( int requestCode, int resultCode,
  Intent data )
  {
     switch( requestCode )
     {
         case ACTIVITY_SET_RINGTONE:
              Log.d(toString(), ACTIVITY_SET_RINGTONE DONE);
             // this method takes the data
             getToneToRing(data);
      }

     super.onActivityResult(requestCode, resultCode, data);
  }

  When I press the button the ringtone picker dialog opens and
  immediately I see ACTIVITY_SET_RINGTONE DONE via LogCat. This is on
  a physical device.

  Do I not understand something?



  Sample.zip
 34KViewDownload
--~--~-~--~~~---~--~~
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: RingtoneManager.ACTION_RINGTONE_PICKER

2009-03-27 Thread damnesia

Actually, thank you. After double checking against your code sample I
found the problem. I was looking at the search requestCode, not the
resultCode.

Thanks again.


On Mar 26, 10:21 pm, for android forandr...@gmail.com wrote:
 Yes you are missing in the onActivityResult

 U need to check the result code.

 Look @ the sample i have attached.

 @Override
     protected void onActivityResult(int requestCode, int resultCode, Intent
 data) {
         switch (resultCode) {
         /*
          * case RESULT_OK: this.setResult(RESULT_OK); this.finish(); break;
          */

         case RESULT_OK:
             Uri uri = data

 .getParcelableExtra(RingtoneManager.EXTRA_RINGTONE_PICKED_URI);
             Log.i(Sample, uri  + uri);
             RingtoneManager.setActualDefaultRingtoneUri(this,
                     RingtoneManager.TYPE_RINGTONE, uri);
             break;
         }
     }

 On Thu, Mar 26, 2009 at 10:00 AM, damnesia r.spencer.wh...@gmail.comwrote:



  Hello. I tried to post earlier and my browser was acting funky. I
  don't see the post, so I am adding another. I apologize if both show
  up.

  I am using Android SDK 1.1_r1. I want a user to be able to open the
  ringtone picker, select a ringtone, it the OK button and have the
  result sent back to the parent activity. When I start the ringtone
  picker as a sub-activity, it appears to call setResult() immediately.
  I could be way off and just not understand how this works. Here is the
  code that I am using to lauch the sub-activity:

  mPickRingTone.setOnClickListener(new View.OnClickListener()
  {
     public void onClick( View v )
     {
          ringMe.startRingPick();
      }
  });

  private void startRingPick()
  {
     Intent i = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER);
     startActivityForResult(i, ACTIVITY_SET_RINGTONE);
  }

  @Override
  protected void onActivityResult( int requestCode, int resultCode,
  Intent data )
  {
     switch( requestCode )
     {
         case ACTIVITY_SET_RINGTONE:
              Log.d(toString(), ACTIVITY_SET_RINGTONE DONE);
             // this method takes the data
             getToneToRing(data);
      }

     super.onActivityResult(requestCode, resultCode, data);
  }

  When I press the button the ringtone picker dialog opens and
  immediately I see ACTIVITY_SET_RINGTONE DONE via LogCat. This is on
  a physical device.

  Do I not understand something?



  Sample.zip
 34KViewDownload
--~--~-~--~~~---~--~~
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: RingtoneManager.ACTION_RINGTONE_PICKER

2009-03-27 Thread damnesia

When I start the task I get this in the LogCat debug log:

WARN/ActivityManager(54): Activity is launching as a new task, so
cancelling activity result.

Does it look like I am starting it incorrectly?

Thank you.

On Mar 26, 10:21 pm, for android forandr...@gmail.com wrote:
 Yes you are missing in the onActivityResult

 U need to check the result code.

 Look @ the sample i have attached.

 @Override
     protected void onActivityResult(int requestCode, int resultCode, Intent
 data) {
         switch (resultCode) {
         /*
          * case RESULT_OK: this.setResult(RESULT_OK); this.finish(); break;
          */

         case RESULT_OK:
             Uri uri = data

 .getParcelableExtra(RingtoneManager.EXTRA_RINGTONE_PICKED_URI);
             Log.i(Sample, uri  + uri);
             RingtoneManager.setActualDefaultRingtoneUri(this,
                     RingtoneManager.TYPE_RINGTONE, uri);
             break;
         }
     }

 On Thu, Mar 26, 2009 at 10:00 AM, damnesia r.spencer.wh...@gmail.comwrote:



  Hello. I tried to post earlier and my browser was acting funky. I
  don't see the post, so I am adding another. I apologize if both show
  up.

  I am using Android SDK 1.1_r1. I want a user to be able to open the
  ringtone picker, select a ringtone, it the OK button and have the
  result sent back to the parent activity. When I start the ringtone
  picker as a sub-activity, it appears to call setResult() immediately.
  I could be way off and just not understand how this works. Here is the
  code that I am using to lauch the sub-activity:

  mPickRingTone.setOnClickListener(new View.OnClickListener()
  {
     public void onClick( View v )
     {
          ringMe.startRingPick();
      }
  });

  private void startRingPick()
  {
     Intent i = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER);
     startActivityForResult(i, ACTIVITY_SET_RINGTONE);
  }

  @Override
  protected void onActivityResult( int requestCode, int resultCode,
  Intent data )
  {
     switch( requestCode )
     {
         case ACTIVITY_SET_RINGTONE:
              Log.d(toString(), ACTIVITY_SET_RINGTONE DONE);
             // this method takes the data
             getToneToRing(data);
      }

     super.onActivityResult(requestCode, resultCode, data);
  }

  When I press the button the ringtone picker dialog opens and
  immediately I see ACTIVITY_SET_RINGTONE DONE via LogCat. This is on
  a physical device.

  Do I not understand something?



  Sample.zip
 34KViewDownload
--~--~-~--~~~---~--~~
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: RingtoneManager.ACTION_RINGTONE_PICKER

2009-03-27 Thread damnesia

Nevermind. You already answered it with the Sample.zip. I didn't see
the attachment.

On Mar 26, 10:21 pm, for android forandr...@gmail.com wrote:
 Yes you are missing in the onActivityResult

 U need to check the result code.

 Look @ the sample i have attached.

 @Override
     protected void onActivityResult(int requestCode, int resultCode, Intent
 data) {
         switch (resultCode) {
         /*
          * case RESULT_OK: this.setResult(RESULT_OK); this.finish(); break;
          */

         case RESULT_OK:
             Uri uri = data

 .getParcelableExtra(RingtoneManager.EXTRA_RINGTONE_PICKED_URI);
             Log.i(Sample, uri  + uri);
             RingtoneManager.setActualDefaultRingtoneUri(this,
                     RingtoneManager.TYPE_RINGTONE, uri);
             break;
         }
     }

 On Thu, Mar 26, 2009 at 10:00 AM, damnesia r.spencer.wh...@gmail.comwrote:



  Hello. I tried to post earlier and my browser was acting funky. I
  don't see the post, so I am adding another. I apologize if both show
  up.

  I am using Android SDK 1.1_r1. I want a user to be able to open the
  ringtone picker, select a ringtone, it the OK button and have the
  result sent back to the parent activity. When I start the ringtone
  picker as a sub-activity, it appears to call setResult() immediately.
  I could be way off and just not understand how this works. Here is the
  code that I am using to lauch the sub-activity:

  mPickRingTone.setOnClickListener(new View.OnClickListener()
  {
     public void onClick( View v )
     {
          ringMe.startRingPick();
      }
  });

  private void startRingPick()
  {
     Intent i = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER);
     startActivityForResult(i, ACTIVITY_SET_RINGTONE);
  }

  @Override
  protected void onActivityResult( int requestCode, int resultCode,
  Intent data )
  {
     switch( requestCode )
     {
         case ACTIVITY_SET_RINGTONE:
              Log.d(toString(), ACTIVITY_SET_RINGTONE DONE);
             // this method takes the data
             getToneToRing(data);
      }

     super.onActivityResult(requestCode, resultCode, data);
  }

  When I press the button the ringtone picker dialog opens and
  immediately I see ACTIVITY_SET_RINGTONE DONE via LogCat. This is on
  a physical device.

  Do I not understand something?



  Sample.zip
 34KViewDownload
--~--~-~--~~~---~--~~
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] RingtoneManager.ACTION_RINGTONE_PICKER

2009-03-26 Thread damnesia

Hello. I tried to post earlier and my browser was acting funky. I
don't see the post, so I am adding another. I apologize if both show
up.

I am using Android SDK 1.1_r1. I want a user to be able to open the
ringtone picker, select a ringtone, it the OK button and have the
result sent back to the parent activity. When I start the ringtone
picker as a sub-activity, it appears to call setResult() immediately.
I could be way off and just not understand how this works. Here is the
code that I am using to lauch the sub-activity:


mPickRingTone.setOnClickListener(new View.OnClickListener()
{
public void onClick( View v )
{
ringMe.startRingPick();
}
});


private void startRingPick()
{
Intent i = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER);
startActivityForResult(i, ACTIVITY_SET_RINGTONE);
}


@Override
protected void onActivityResult( int requestCode, int resultCode,
Intent data )
{
switch( requestCode )
{
case ACTIVITY_SET_RINGTONE:
Log.d(toString(), ACTIVITY_SET_RINGTONE DONE);
// this method takes the data
getToneToRing(data);
}

super.onActivityResult(requestCode, resultCode, data);
}


When I press the button the ringtone picker dialog opens and
immediately I see ACTIVITY_SET_RINGTONE DONE via LogCat. This is on
a physical device.

Do I not understand something?

--~--~-~--~~~---~--~~
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] RingtoneManager.ACTION_RINGTONE_PICKER

2009-03-26 Thread damnesia

Hello. I am trying to allow someone to choose a ringtone and to get
the URI or order number of this and pass it back to the parent
Activity. Maybe I am going about this the wrong way. The problem that
I am having is startActivityForResult() launches the ringtone picker
but immediately
call setResult(). However the ringtone picker seems to work fine, i
just cannot capture the value of the picked tone(that part of the code
is not here because it never gets that far).

Here is how I am trying to do this:

calling it from a listener:

mPickRingTone.setOnClickListener(new View.OnClickListener()
{
public void onClick( View v )
{
startRingPick();
}
});

private void startRingPick()
{
Intent i = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER);
startActivityForResult(i, ACTIVITY_SET_RINGTONE);
}

@Override
protected void onActivityResult( int requestCode, int resultCode,
Intent data )
{
switch( requestCode )
{
case ACTIVITY_SET_RINGTONE:
Log.d(toString(), ACTIVITY_SET_RINGTONE =  +
ACTIVITY_SET_RINGTONE);

}

super.onActivityResult(requestCode, resultCode, data);
}

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