Skip to main content

Home/ Android Dev/ Group items matching "views" in title, tags, annotations or url

Group items matching
in title, tags, annotations or url

Sort By: Relevance | Date Filter: All | Bookmarks | Topics Simple Middle
Simon Pan

Google Map View | Android Developers - 0 views

  • degrees * 1e6
    • Simon Pan
       
      FLOAT經緯度換成INT算法︰ degrees*1e6
  • Before the addOverlay() method is called
  • Add this at the top of the HelloItemizedOverlay class
    • Simon Pan
       
      放在class的大括弧裡面。如public class HelloItemizedOverlay{ private ArrayList mOverlays = new ArrayList(); }
  • ...2 more annotations...
  • the default marker
  • You're now done
Simon Pan

Building Custom Components | Android Developers - 2 views

  • When the class is nested in the NoteEditor class, this technique will not work.
    • Simon Pan
       
      当自己复写的View写在内部类时,在xml呼叫这个新类是没有用的!
  •  
    有什么具体案例么?
  •  
    这句话是写在第4点 Use the Custom Component中∶ Notice that the MyEditText class is now a separate class file. 1.When the class is nested in the NoteEditor class, this technique will not work. 我还没真实遇到,Diigo先! 总之告诉我们如果将自己写的View写成内部类时, XML会找不到!
Vincent Tsao

commonsguy/cwac-merge - GitHub - 2 views

  • MergeAdapter accepts a mix of Adapters and Views and presents them as one contiguous whole to whatever ListView it is poured into. This is good for cases where you have multiple data sources, or if you have a handful of ordinary Views to mix in with lists of data, or the like.
Kiran Kuppa

Emojicon Android Text View library - 0 views

  •  
    "Do you like emojis in Whatsapp, iMessage? Emojicon is a library to implement such a thing for Android."
Vincent Tsao

译言网 | 如何发挥 Android 锁定屏幕的潜力 - 0 views

  • Android 的某些功能着实让人喜爱,而另一些尚需改进。我们觉得 Google 应该改进的一个地方就是 Android 的待机锁定屏幕的可用性。Android 的优秀的小工具框架能让它在一瞥之间提供不少信息。现在的这个空旷的锁定屏幕一定可以得到增强(这对于平板电脑来说非常合适),而多亏了一些应用程序,Android 可以做到这一点
Vincent Tsao

请教,使用layout_gravity属性不能垂直居中 - China Android Dev | Google Groups - 0 views

  • 按我理解,layout_gravity 属性是用于设置View 与其容器的对齐关系的,但实际使用中 却发现 似乎不是这样,请看如下代码: <?xml version="1.0" encoding="utf-8"?> <LinearLayout     xmlns:android="http://schemas.android.com/apk/res/android"     android:orientation="vertical"     android:layout_width="fill_parent"     android:layout_height="fill_parent"     android:background="#AA009988">     <TextView         android:id="@+id/my_view"         android:layout_width="220dip"         android:layout_height="100dip"         android:text="sdfasdfsdfsdf\nsdfjlwjesd"         android:background="#889900AA"         *android:layout_gravity="center"* /> </LinearLayout> 我为 TextView 设置了 *layout_gravity="center"*- ,本来它应该在父容器中 垂直和水平 居中的,但事实上只是水平居中了,垂直方向并未居中。 我再进一步通过 *layout_gravity="**center_vertical**"* ,但仍然无法垂直居中,请问这是为什么呢?
  • 你可以在最外面的 LinearLayout 加上android:gravity="center". Vertical LinearLayout中, layout_gravity 设置成center无法垂直剧中,是因 为container的排版被限制为从上到下, 试想一下,如果按照你的逻辑,假设第一个child layout_gravity设置成bottom,   第二个childlayout_gravity设置成top,  那么第一个就会跑到第二个下面了。 所以, 当你设置整个linearlayout为垂直, layout_gravity中, 只有 left, right, center_ horizontal 管用的。 tj
Vincent Tsao

Applying Styles and Themes | Android Developers - 0 views

  •  
    using style/theme to make our layout views neat and maintainable
Vincent Tsao

android-pinch - Project Hosting on Google Code - 0 views

  • Adds multi-touch zoom to; ImageViews, WebViews, and MapViews. Simply use the corresponding object in place of the default, and the "pinch" functionality will be usable. Also includes misc. Views which can be useful for development.
Vincent Tsao

Possible to change between "full screen" and "with status bar"? - Android Developers | Google Groups - 0 views

  • // go full screen WindowManager.LayoutParams attrs = mActivity.getWindow().getAttributes (); attrs.flags |= WindowManager.LayoutParams.FLAG_FULLSCREEN; mActivity.getWindow().setAttributes(attrs); // go non-full screen WindowManager.LayoutParams attrs = mActivity.getWindow().getAttributes (); attrs.flags &= (~WindowManager.LayoutParams.FLAG_FULLSCREEN); mActivity.getWindow().setAttributes(attrs);
    • Vincent Tsao
       
      these code can be simplified as below: //go full screen getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); //go non-full screen getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
  •  
    How to toggle fullscreen / non-fullscreen
Vincent Tsao

List view with textviews and imageview, best practices - Android Developers | Google Groups - 0 views

  • 1. you can look at the video from Google IO conference 2009, called Turbo charging your UI's by Romain Guy; he discussed some of the optimizations you can do when working with ListViews. 2. You can read Mark Murphy's series of ListView tutorials at android guys titled Fancy ListViews: http://www.google.co.in/url?sa=t&source=web&ct=res&cd=4&ved=0CBYQFjAD...
Vincent Tsao

spinner :: anddev.org - Android Development Community | Android Tutorials - 0 views

  • spnCountries.setAdapter(aspnCountries); spnCountries.setOnItemSelectedListener(spnCountriesListener); private Spinner.OnItemSelectedListener spnCountriesListener =   new Spinner.OnItemSelectedListener() {     public void onItemSelected(AdapterView parent, View v, int position, long id) {       Log.i("print", parent.getSelectedItem().toString());     }     public void onNothingSelected(AdapterView parent) { }              };
Vincent Tsao

Exploring the world of Android :: Part 2 « JTeam Blog / JTeam: Enterprise Java, Open Source, software solutions, Amsterdam - 1 views

  • But in practice, you will notice that the AsyncTask is limited to 10 threads. This number is hardcoded somewhere in the Android SDK so we cannot change this. In this case it’s a limitation we cannot live with, because often more than 10 images are loaded at the same time.
    • Vincent Tsao
       
      使用AsyncTask类开辟的线程还有数量限制?必须小于10,这个倒是以前没有注意到的,要看看源代码怎么实现的
  • I’ve shown you how to improve performance of a ListView in three different ways: By loading images in a seperate thread By reusing rows in the list By caching views within a row
  • ...1 more annotation...
  • Notice that I used a SoftReference for caching images, to allow the garbage collector to clean the images from the cache when needed. How it works: Call loadDrawable(imageUrl, imageCallback) providing an anonymous implementation of the ImageCallback interface If the image doesn’t exist in the cache yet, the image is downloaded in a separate thread and the ImageCallback is called as soon as the download is complete. If the image DOES exist in the cache, it is immediately returned and the ImageCallback is never called.
  •  
    这个帖子完美解决了Image lazy load的性能问题, it works~
Vincent Tsao

Avoiding Memory Leaks | Android Developers - 0 views

  • As part of my job, I ran into memory leaks issues in Android applications and they are most of the time due to the same mistake: keeping a long-lived reference to a Context.
  • There are two easy ways to avoid context-related memory leaks. The most obvious one is to avoid escaping the context outside of its own scope. The example above showed the case of a static reference but inner classes and their implicit reference to the outer class can be equally dangerous. The second solution is to use the Application context. This context will live as long as your application is alive and does not depend on the activities life cycle. If you plan on keeping long-lived objects that need a context, remember the application object. You can obtain it easily by calling Context.getApplicationContext() or Activity.getApplication().
  • In summary, to avoid context-related memory leaks, remember the following: Do not keep long-lived references to a context-activity (a reference to an activity should have the same life cycle as the activity itself) Try using the context-application instead of a context-activity Avoid non-static inner classes in an activity if you don't control their life cycle, use a static inner class and make a weak reference to the activity inside. The solution to this issue is to use a static inner class with a WeakReference to the outer class, as done in ViewRoot and its W inner class for instance A garbage collector is not an insurance against memory leaks
Vincent Tsao

Window Backgrounds & UI Speed | Android Developers - 0 views

  • Removing the window's background can be achieved very easily by using a custom theme. To do so, first create a file called res/values/theme.xml containing the following:
  • <resources>    <style name="Theme.NoBackground" parent="android:Theme">        <item name="android:windowBackground">@null</item>    </style></resources>
  • You then need to apply the theme to your activity by adding the attribute android:theme="@style/Theme.NoBackground" to your <activity /> or <application /> tag. This trick comes in very handy for any app that uses a MapView, a WebView or any other full screen opaque view.
Vincent Tsao

Android - Detect The Phone Orientation « Eureka! - 0 views

  • // Get display for detecting the phone orientation display = ((WindowManager) getSystemService(WINDOW_SERVICE)).getDefaultDisplay(); // Get the orientation int orientation = display.getOrientation();
  • android.view.Display class provide a simple way to determine the phone orientation.
‹ Previous 21 - 40 of 43 Next ›
Showing 20 items per page