Skip to content

Commit

Permalink
sync to lastest
Browse files Browse the repository at this point in the history
sync to lastest
  • Loading branch information
Trinea committed Sep 16, 2013
1 parent 1538fb8 commit 5dbd4ca
Show file tree
Hide file tree
Showing 22 changed files with 549 additions and 49 deletions.
2 changes: 1 addition & 1 deletion .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<classpath>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
37 changes: 25 additions & 12 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="cn.trinea.android.demo"
android:installLocation="preferExternal"
android:versionCode="28"
android:versionName="2.9.4" >
android:versionCode="32"
android:versionName="2.9.8" >

<uses-sdk android:minSdkVersion="14" />

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.BROADCAST_STICKY" />
<uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" />
Expand All @@ -28,7 +29,7 @@
android:name=".DemoList"
android:configChanges="orientation|keyboardHidden"
android:label="@string/app_name"
android:theme="@android:style/Theme.Holo.Light.DialogWhenLarge" >
android:theme="@android:style/Theme.Holo.Light" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand All @@ -39,7 +40,7 @@
android:name=".DownloadManagerDemo"
android:configChanges="orientation|keyboardHidden"
android:label="@string/download_manager_demo_activity_title"
android:theme="@android:style/Theme.Holo.Light.DialogWhenLarge" >
android:theme="@android:style/Theme.Holo.Light" >
<intent-filter>
<action android:name="android.intent.action.VIEW" />

Expand All @@ -48,53 +49,65 @@
<data android:mimeType="application/cn.trinea.download.file" />
</intent-filter>
</activity>
<activity
android:name=".ImageSDCardCacheDemo"
android:configChanges="orientation|keyboardHidden"
android:label="@string/imagesdcardcache_demo_activity_title"
android:theme="@android:style/Theme.Holo.Light" >
</activity>
<activity
android:name=".ImageCacheDemo"
android:configChanges="orientation|keyboardHidden"
android:label="@string/imagecache_demo_activity_title"
android:theme="@android:style/Theme.Holo.Light" >
</activity>
<activity
android:name=".DropDownListViewDemo"
android:configChanges="orientation|keyboardHidden"
android:label="@string/dropdownlistview_demo_activity_title"
android:theme="@android:style/Theme.Holo.Light.DialogWhenLarge" >
android:theme="@android:style/Theme.Holo.Light" >
</activity>
<activity
android:name=".BorderScrollViewDemo"
android:configChanges="orientation|keyboardHidden"
android:label="@string/borderscrollview_demo_activity_title"
android:theme="@android:style/Theme.Holo.Light.DialogWhenLarge" >
android:theme="@android:style/Theme.Holo.Light" >
</activity>
<activity
android:name=".SearchViewDemo"
android:configChanges="orientation|keyboardHidden"
android:label="@string/search_view_demo_activity_title"
android:theme="@android:style/Theme.Holo.Light.DialogWhenLarge" >
android:theme="@android:style/Theme.Holo.Light" >
</activity>
<activity
android:name=".ViewPagerMulTiFragmentDemo"
android:configChanges="orientation|keyboardHidden"
android:label="@string/view_pager_multi_fragment_demo_activity_title"
android:theme="@android:style/Theme.Holo.Light.DialogWhenLarge" >
android:theme="@android:style/Theme.Holo.Light" >
</activity>
<activity
android:name=".SlideOnePageGalleryDemo"
android:configChanges="orientation|keyboardHidden"
android:label="@string/slide_one_page_gallery_demo_activity_title"
android:theme="@android:style/Theme.Holo.Light.DialogWhenLarge" >
android:theme="@android:style/Theme.Holo.Light" >
</activity>
<activity
android:name=".ViewPagerDemo"
android:configChanges="orientation|keyboardHidden"
android:label="@string/view_pager_demo_activity_title"
android:theme="@android:style/Theme.Holo.Light.DialogWhenLarge" >
android:theme="@android:style/Theme.Holo.Light" >
</activity>
<activity
android:name=".BroadcastReceiverDemo"
android:configChanges="orientation|keyboardHidden"
android:label="@string/broadcastreceiver_demo_activity_title"
android:theme="@android:style/Theme.Holo.Light.DialogWhenLarge" >
android:theme="@android:style/Theme.Holo.Light" >
</activity>
<activity
android:name=".ServiceDemo"
android:configChanges="orientation|keyboardHidden"
android:label="@string/service_demo_activity_title"
android:theme="@android:style/Theme.Holo.Light.DialogWhenLarge" >
android:theme="@android:style/Theme.Holo.Light" >
</activity>
</application>

Expand Down
5 changes: 5 additions & 0 deletions ReadMe.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
中文:
需要从https://github.com/Trinea/AndroidCommon或https://code.google.com/p/trinea-android-common/source/checkout拉下TrineaAndroidCommon工程做为android lib引入,不会的可以参考http://www.trinea.cn/?p=637

English Version:
get source code of TrineaAndroidCommon from https://github.com/Trinea/AndroidCommon or https://code.google.com/p/trinea-android-common/source/checkout, and import it as a android common lib to TrineaAndroidDemo, you can reference from http://www.trinea.cn/?p=637
Binary file added libs/android-support-v4.jar
Binary file not shown.
4 changes: 4 additions & 0 deletions lint.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<lint>
<issue id="NewApi" severity="ignore" />
</lint>
8 changes: 8 additions & 0 deletions proguard.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,11 @@
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
-libraryjars libs/android-support-v4.jar
-dontwarn android.support.v4.**
-keep class android.support.v4.** { *; }
-keep interface android.support.v4.app.** { *; }
-keep class cn.trinea.android.common.** { *; }
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
4 changes: 3 additions & 1 deletion project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@

# Project target.
target=android-14
android.library.reference.1=../trinea-android-common
android.library.reference.1=..\\trinea-android-common
proguard.config=proguard.cfg
android.library.reference.2=../../TrineaOnline/trinea-android-common
Binary file added res/drawable-hdpi/trinea.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-ldpi/trinea.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-mdpi/trinea.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions res/drawable/image_border.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >

<solid android:color="@android:color/transparent" />

<padding
android:bottom="1px"
android:left="1px"
android:right="1px"
android:top="1px" />

<stroke
android:width="1px"
android:color="@android:color/darker_gray" >
</stroke>

<corners android:radius="2px" />

</shape>
22 changes: 22 additions & 0 deletions res/layout/image_cache_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/dp_40" >

<RelativeLayout
android:id="@+id/image_cache_parent_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="left"
android:paddingLeft="@dimen/dp_4" >
</RelativeLayout>
</ScrollView>

<include layout="@layout/trinea_info" />

</RelativeLayout>
22 changes: 22 additions & 0 deletions res/layout/image_sdcard_cache_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/dp_40" >

<RelativeLayout
android:id="@+id/image_sdcard_cache_parent_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="left"
android:paddingLeft="@dimen/dp_4" >
</RelativeLayout>
</ScrollView>

<include layout="@layout/trinea_info" />

</RelativeLayout>
17 changes: 16 additions & 1 deletion res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,20 @@
<string name="tip_download_file">文件将下载到:</string>

<string name="update_at">更新于:&#160;</string>


<string name="profile">个人主页:&#160;</string>
<string name="description">更多介绍:&#160;</string>

<string name="desc_search_view">SearchView介绍及搜索提示实现</string>
<string name="desc_view_pager_multi_page">viewpager实现画廊效果</string>
<string name="desc_download_manager">系统下载管理使用</string>
<string name="desc_slide_gallery">Gallery滑动一页(一个Item)效果</string>
<string name="desc_view_pager">ViewPager、Fragment使用</string>
<string name="desc_service">Service介绍</string>
<string name="desc_broadcast_receiver">BroadcastReceiver介绍</string>
<string name="desc_border_scroll_view">BorderScrollViewDemo介绍</string>
<string name="desc_drop_down_listview">下拉刷新及底部加载更多Listview</string>
<string name="desc_image_cache">ImageCache使用</string>
<string name="desc_image_sdcard_cache">ImageSDCardCache使用</string>
<string name="desc_default">Trinea</string>
</resources>
4 changes: 0 additions & 4 deletions res/values/attrs.xml

This file was deleted.

1 change: 1 addition & 0 deletions res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

<dimen name="pager_margin">45dp</dimen>
<dimen name="page_margin">15dp</dimen>
<dimen name="dp_4">4dp</dimen>
<dimen name="dp_8">8dp</dimen>
<dimen name="dp_60">60dp</dimen>
<dimen name="dp_40">40dp</dimen>
Expand Down
18 changes: 18 additions & 0 deletions res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

<string name="app_name">Trinea Android Demo</string>

<string name="imagesdcardcache_demo_activity_title">ImageSDCardCache Demo</string>
<string name="imagecache_demo_activity_title">ImageCache Demo</string>
<string name="dropdownlistview_demo_activity_title">Drop Down And Load More ListView Demo</string>
<string name="borderscrollview_demo_activity_title">onBottom onTop ScrollView Demo</string>
<string name="search_view_demo_activity_title">SearchView Demo</string>
Expand Down Expand Up @@ -42,4 +44,20 @@
<string name="tip_download_file">file will be saved to sdcard, the path is: </string>

<string name="update_at">updated at:&#160;</string>

<string name="profile">Profile:&#160;</string>
<string name="description">Description:&#160;</string>

<string name="desc_search_view">SearchView Desc And Implement Search Tip</string>
<string name="desc_view_pager_multi_page">Viewpager With Multi Page</string>
<string name="desc_download_manager">Download Manager Usage</string>
<string name="desc_slide_gallery">Slide One Page Gallery Usage</string>
<string name="desc_view_pager">ViewPager And Fragment Usage</string>
<string name="desc_service">Android Service Usage</string>
<string name="desc_broadcast_receiver">Android BroadcastReceiver Usage</string>
<string name="desc_border_scroll_view">BorderScrollView Usage</string>
<string name="desc_drop_down_listview">Drop Down And On Bottom Listview</string>
<string name="desc_image_cache">ImageCache Usage</string>
<string name="desc_image_sdcard_cache">ImageSDCardCache Usage</string>
<string name="desc_default">Trinea</string>
</resources>
37 changes: 30 additions & 7 deletions src/cn/trinea/android/demo/DemoList.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
import java.util.Arrays;
import java.util.LinkedList;

import cn.trinea.android.common.service.impl.ImageCache;

import android.app.ActionBar;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
Expand All @@ -24,9 +21,10 @@ public class DemoList extends BaseActivity {

public static final String TAG = "DemoList";

private static final String[] mStrings = { "DropDownListViewDemo", "onBottom onTop ScrollView Demo",
"DownloadManager Demo", "SearchView Demo", "ViewPager Multi Fragment Demo\r\n(ViewPager一屏多Fragment)",
"Slide One Page Gallery Demo", "ViewPager Demo", "Service Demo", "BroadcastReceiver Demo" };
private static final String[] mStrings = { "ImageSDCardCache Demo", "ImageCache Demo", "DropDownListView Demo",
"onBottom onTop ScrollView Demo", "DownloadManager Demo", "SearchView Demo",
"ViewPager Multi Fragment Demo", "Slide One Page Gallery Demo", "ViewPager Demo", "Service Demo",
"BroadcastReceiver Demo" };

private static final int total = mStrings.length - 1;

Expand All @@ -47,7 +45,13 @@ public void onCreate(Bundle savedInstanceState) {

@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
if (position == total - 8) {
if (position == total - 10) {
Intent intent = new Intent(DemoList.this, ImageSDCardCacheDemo.class);
startActivity(intent);
} else if (position == total - 9) {
Intent intent = new Intent(DemoList.this, ImageCacheDemo.class);
startActivity(intent);
} else if (position == total - 8) {
Intent intent = new Intent(DemoList.this, DropDownListViewDemo.class);
startActivity(intent);
} else if (position == total - 7) {
Expand Down Expand Up @@ -77,5 +81,24 @@ public void onItemClick(AdapterView<?> parent, View view, int position, long id)
}
}
});
// startActivity(new Intent(getApplicationContext(), ImageCacheDemo.class));
// startActivity(new Intent("android.intent.action.VIEW_DOWNLOADS"));
// Intent i = new Intent(Intent.ACTION_VIEW);
// i.setData(Uri.parse("http://122.193.23.191/down.myapp.com/android/48157/1176342/com.tencent.mm_261.apk?mkey=51cc3a56ba89d0cf&f=a821&p=.apk"));
// startActivity(i);
// final Context context = getApplicationContext();
// new Thread() {
//
// public void run() {
// DownloadManager.Request request = new Request(
// Uri.parse("http://122.193.23.191/down.myapp.com/android/48157/1176342/com.tencent.mm_261.apk?mkey=51cc3a56ba89d0cf&f=a821&p=.apk"));
// DownloadManager manager = (DownloadManager)context.getSystemService(Context.DOWNLOAD_SERVICE);
// manager.enqueue(request);
//
// Intent i = new Intent(DownloadManager.ACTION_VIEW_DOWNLOADS);
// i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
// startActivity(i);
// }
// }.start();
}
}
Loading

0 comments on commit 5dbd4ca

Please sign in to comment.