Search Results

Search found 5 results on 1 pages for 'alexi'.

Page 1/1 | 1 

  • Ho to stop scrolling in a Gallery Widget?

    - by Alexi
    I loaded some images into a gallery. Now I'm able to scroll but once started scrolling the scrolling won't stop. I would like the gallery to just scroll to the next image and then stop until the user does the scroll gesture again. this is my code import android.widget.ImageView; import android.widget.Toast; import android.widget.AdapterView.OnItemClickListener; public class GalleryExample extends Activity { private Gallery gallery; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); gallery = (Gallery) findViewById(R.id.examplegallery); gallery.setAdapter(new AddImgAdp(this)); gallery.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView parent, View v, int position, long id) { Toast.makeText(GalleryExample.this, "Position=" + position, Toast.LENGTH_SHORT).show(); } }); } public class AddImgAdp extends BaseAdapter { int GalItemBg; private Context cont; private Integer[] Imgid = { R.drawable.a_1, R.drawable.a_2, R.drawable.a_3, R.drawable.a_4, R.drawable.a_5, R.drawable.a_6, R.drawable.a_7 }; public AddImgAdp(Context c) { cont = c; TypedArray typArray = obtainStyledAttributes(R.styleable.GalleryTheme); GalItemBg = typArray.getResourceId(R.styleable.GalleryTheme_android_galleryItemBackground, 0); typArray.recycle(); } public int getCount() { return Imgid.length; } public Object getItem(int position) { return position; } public long getItemId(int position) { return position; } public View getView(int position, View convertView, ViewGroup parent) { ImageView imgView = new ImageView(cont); imgView.setImageResource(Imgid[position]); i.setScaleType(ImageView.ScaleType.FIT_CENTER); imgView.setBackgroundResource(GalItemBg); return imgView; } } } and the xmlLayout file <?xml version="1.0" encoding="utf-8"?> <LinearLayout android:id="@+id/LinearLayout01" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android" > <Gallery xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/examplegallery" android:layout_width="fill_parent" android:layout_height="fill_parent" /> </LinearLayout>

    Read the article

  • Launching a modal UINavigationController

    - by Alexi Groove
    I'd like to launch a modal view controller the way one does with 'ABPeoplePickerNavigationController' and that is without having to creating a navigation controller containing the view controller. Doing something similar yields a blank screen with no title for the navigation bar and there's no associated nib file loaded for the view even though I am invoking the initWithNibName when the 'init' is called. My controller looks like: @interface MyViewController : UINavigationController @implementation MyViewController - (id)init { NSLog(@"MyViewController init invoked"); if (self = [super initWithNibName:@"DetailView" bundle:nil]) { self.title = @"All Things"; } return self; } - (void)viewDidLoad { [super viewDidLoad]; self.title = @"All Things - 2"; } @end When using the AB controller, all you do is: ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init]; picker.peoplePickerDelegate = self; [self presentModalViewController:picker animated:YES]; [picker release]; ABPeoplePickerNavigationController is declared as: @interface ABPeoplePickerNavigationController : UINavigationController The other way to create a modal view as suggested in Apple's 'View Controller Programming Guide for iPhone OS': // Create a regular view controller. MyViewController *modalViewController = [[[MyViewController alloc] initWithNibName:nil bundle:nil] autorelease]; // Create a navigation controller containing the view controller. UINavigationController *secondNavigationController = [[UINavigationController alloc] initWithRootViewController:modalViewController]; // Present the navigation controller as a modal view controller on top of an existing navigation controller [self presentModalViewController:secondNavigationController animated:YES]; I can create it this way fine (as long as I change the MyViewController to inherit from UIViewController instead of UINavigationController). What else should I be doing to MyViewController to launch the same way as ABPeoplePickerNavigationController?

    Read the article

  • Grails and PermGen issue with g:link and g:render

    - by Alexi Groove
    I've been running grails for sometime without any issues but recently after an upgrade to Grails 1.1.1, I've encountered the dreaded PermGen errors. Prior to the upgrade, no such issue. The error seems to be happening when the <g:link> and <g:render> tags are used in a GSP although I'm not sure it's indicative that this is the issue but more of the fact that it ran out of space when these tags were being rendered. Typically, everyone who encounters PermGen errors recommend increasing your java environment options -- but what maybe the source of the issue? Is it a Grails 1.1/hibernate/spring problem? The error: 2010-04-20 05:37:03,962 INFO [STDOUT] 05:37:03,961 ERROR [GroovyPagesServlet] Error processing GSP: Error executing tag <g:render>: org.codehaus.groovy.grails.web.taglib.exceptions.GrailsTagException: Error executing tag <g:link>: java.lang.OutOfMemoryError: PermGen space org.codehaus.groovy.grails.web.taglib.exceptions.GrailsTagException: Error executing tag <g:render>: org.codehaus.groovy.grails.web.taglib.exceptions.GrailsTagException: Error executing tag <g:link>: java.lang.OutOfMemoryError: PermGen space

    Read the article

  • How to Fix a Stuck Pixel on an LCD Monitor

    - by Chris Hoffman
    Have you ever noticed that a pixel – a little dot on your computer’s LCD monitor – is staying a single color all of the time? You have a stuck pixel. Luckily, stuck pixels aren’t always permanent. Stuck and dead pixels are hardware problems. They’re often caused by manufacturing flaws – pixels aren’t supposed to get stuck or die over time. Image Credit: Alexi Kostibas on Flickr How to Fix a Stuck Pixel on an LCD Monitor How to Factory Reset Your Android Phone or Tablet When It Won’t Boot Our Geek Trivia App for Windows 8 is Now Available Everywhere

    Read the article

1