This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Basic card layout with drawables and styles. | |
Missing icons: ic_action_remove, ic_action_accept and ic_action_cancel (all can be found in the standard android icon pack) | |
Example screenshot: https://pbs.twimg.com/media/BmTdvKhIYAAkrPa.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Compose a single request to send to the server: | |
HttpClient client = new DefaultHttpClient(); | |
HttpPost post = new HttpPost("http://www.myserver.com/apis/users/" + userId + "/profile"); | |
List<NameValuePair> bodyParams = new ArrayList<NameValuePair>(); | |
pairs.add(new NameValuePair("first_name", firstName)); | |
pairs.add(new NameValuePair("last_name", firstName)); | |
pairs.add(new NameValuePair("street1", firstName)); | |
pairs.add(new NameValuePair("street2", firstName)); | |
pairs.add(new NameValuePair("zip", firstName)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<set xmlns:android="http://schemas.android.com/apk/res/android" | |
android:interpolator="@android:anim/accelerate_interpolator" > | |
<alpha | |
android:fromAlpha="0" | |
android:toAlpha="1" | |
android:duration="2000" > | |
</alpha> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | |
<item> | |
<shape android:shape="rectangle" | |
android:dither="true"> | |
<corners android:radius="2dp"/> | |
<solid android:color="#dbdbdb" /> | |
</shape> | |
</item> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | |
<item> | |
<shape android:shape="rectangle" | |
android:dither="true"> | |
<corners android:radius="2dp"/> | |
<solid android:color="#ccc" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
========= | |
styles.xml | |
========= | |
<style name="TransparentProgressDialog" parent="@android:Theme.Holo.Light.Dialog"> | |
<item name="android:windowFrame">@null</item> | |
<item name="android:windowBackground">@android:color/transparent</item> | |
<item name="android:windowIsFloating">true</item> | |
<item name="android:windowContentOverlay">@null</item> | |
<item name="android:windowTitleStyle">@null</item> | |
<item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//in Application onCreate() | |
Timber.plant(new Timber.DebugTree()); | |
// in build gradle | |
compile 'com.jakewharton.timber:timber:2.5.0' | |
//usage | |
Timber.e("Request for questions failed."); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface AftonbladetAPI { | |
@GET("/item/{id}.json") | |
Observable<Item> item(@Path("id") long id); | |
@GET("/topstories.json") | |
Observable<List<Long>> topStories(); | |
} | |
public void onRefresh() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<animation-list android:oneshot="false"> | |
<item android:drawable="@drawable/wait_0" android:duration="50" /> | |
<item android:drawable="@drawable/wait_1" android:duration="50" /> | |
<item android:drawable="@drawable/wait_2" android:duration="50" /> | |
<item android:drawable="@drawable/wait_3" android:duration="50" /> | |
<item android:drawable="@drawable/wait_4" android:duration="50" /> | |
<item android:drawable="@drawable/wait_5" android:duration="50" /> | |
</animation-list> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<TabHost xmlns:android="http://schemas.android.com/apk/res/android" | |
android:id="@android:id/tabhost" | |
android:layout_width="fill_parent" | |
android:layout_height="fill_parent" > | |
<LinearLayout | |
android:id="@+id/tabcontainer" | |
android:layout_width="fill_parent" | |
android:layout_height="fill_parent" |
OlderNewer