Skip to content

Commit 1f6eead

Browse files
committed
Merge branch 'release/0.9.6'
2 parents a5eb761 + f7b5fb3 commit 1f6eead

21 files changed

+579
-134
lines changed
113 KB
Binary file not shown.

FlipView/Demo/AndroidManifest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
<activity android:name="com.aphidmobile.flip.demo.FlipTextViewAltActivity"/>
3030
<activity android:name="com.aphidmobile.flip.demo.FlipHorizontalLayoutActivity"/>
3131
<activity android:name="com.aphidmobile.flip.demo.FlipTextViewXmlActivity"/>
32+
<activity android:name="com.aphidmobile.flip.demo.Issue5Activity"/>
33+
<activity android:name="com.aphidmobile.flip.demo.FlipFragmentActivity"/>
3234

3335
</application>
3436

FlipView/Demo/Aphid-FlipView-Demo.iml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
<option name="RES_FOLDER_RELATIVE_PATH" value="/res" />
1818
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/assets" />
1919
<option name="LIBS_FOLDER_RELATIVE_PATH" value="/libs" />
20-
<option name="REGENERATE_R_JAVA" value="true" />
21-
<option name="REGENERATE_JAVA_BY_AIDL" value="true" />
2220
<option name="USE_CUSTOM_APK_RESOURCE_FOLDER" value="false" />
2321
<option name="CUSTOM_APK_RESOURCE_FOLDER" value="" />
2422
<option name="USE_CUSTOM_COMPILER_MANIFEST" value="false" />
@@ -35,6 +33,7 @@
3533
<path>/res-overlay</path>
3634
</resOverlayFolders>
3735
<includeSystemProguardFile>true</includeSystemProguardFile>
36+
<includeAssetsFromLibraries>true</includeAssetsFromLibraries>
3837
<additionalNativeLibs />
3938
</configuration>
4039
</facet>
@@ -56,7 +55,9 @@
5655
<root url="file://$MODULE_DIR$/libs" />
5756
</CLASSES>
5857
<JAVADOC />
59-
<SOURCES />
58+
<SOURCES>
59+
<root url="file://$MODULE_DIR$/../../../../../../Develop/android-sdk-mac_86/extras/android/support/v4/src/java" />
60+
</SOURCES>
6061
<jarDirectory url="file://$MODULE_DIR$/libs" recursive="false" />
6162
</library>
6263
</orderEntry>
265 KB
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
src=/Volumes/DATA/Develop/android-sdk-mac_86/extras/android/support/v4/src/
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
3+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
4+
android:orientation="vertical"
5+
android:layout_width="fill_parent"
6+
android:layout_height="fill_parent">
7+
8+
<fragment android:name="com.aphidmobile.flip.demo.fragment.FlipTextViewFragment"
9+
android:id="@+id/flip_text_view_fragment"
10+
android:layout_height="match_parent"
11+
android:layout_width="match_parent"
12+
/>
13+
14+
</LinearLayout>
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:id="@+id/FrameLayout1"
4+
android:layout_width="fill_parent"
5+
android:layout_height="fill_parent" >
6+
7+
<ImageView
8+
android:id="@+id/gallery_flip_item_background_imageview"
9+
android:layout_width="match_parent"
10+
android:layout_height="match_parent"
11+
android:scaleType="centerCrop" />
12+
13+
<LinearLayout
14+
android:layout_width="match_parent"
15+
android:layout_height="wrap_content"
16+
android:layout_gravity="bottom"
17+
android:background="@color/transparentBlack"
18+
android:orientation="horizontal"
19+
android:padding="5dp" >
20+
21+
<ImageView
22+
android:id="@+id/imageView2"
23+
android:layout_width="40dp"
24+
android:layout_height="40dp"
25+
android:src="@android:drawable/ic_menu_info_details" />
26+
27+
<TextView
28+
android:id="@+id/gallery_flip_item_place_description_textview"
29+
android:layout_width="match_parent"
30+
android:layout_height="wrap_content"
31+
android:layout_gravity="center_vertical"
32+
android:layout_marginLeft="5dp"
33+
android:layout_marginRight="5dp"
34+
android:gravity="center_vertical"
35+
android:maxLines="2"
36+
android:textColor="@color/white"
37+
android:textSize="12sp" />
38+
</LinearLayout>
39+
40+
<LinearLayout
41+
android:id="@+id/gallery_flip_item_place_linearlayout"
42+
android:layout_width="match_parent"
43+
android:layout_height="wrap_content"
44+
android:layout_gravity="top"
45+
android:background="@color/transparentBlack"
46+
android:orientation="horizontal"
47+
android:padding="5dp" >
48+
49+
<ImageView
50+
android:id="@+id/gallery_flip_item_place_icon_imageview"
51+
android:layout_width="50dp"
52+
android:layout_height="50dp"
53+
android:layout_marginTop="3dp"
54+
android:scaleType="fitXY"
55+
android:src="@android:drawable/ic_dialog_map" />
56+
57+
<LinearLayout
58+
android:layout_width="wrap_content"
59+
android:layout_height="wrap_content"
60+
android:layout_marginLeft="5dp"
61+
android:orientation="vertical" >
62+
63+
<TextView
64+
android:id="@+id/gallery_flip_item_place_name_textview"
65+
android:layout_width="wrap_content"
66+
android:layout_height="wrap_content"
67+
android:singleLine="true"
68+
android:textColor="@color/white"
69+
android:textSize="19sp"
70+
android:textStyle="bold" />
71+
72+
<LinearLayout
73+
android:layout_width="wrap_content"
74+
android:layout_height="wrap_content"
75+
android:layout_marginBottom="3dp" >
76+
77+
<ImageView
78+
android:id="@+id/imageView1"
79+
android:layout_width="wrap_content"
80+
android:layout_height="wrap_content"
81+
/>
82+
83+
<LinearLayout
84+
android:layout_width="wrap_content"
85+
android:layout_height="wrap_content"
86+
android:layout_marginLeft="5dp"
87+
android:orientation="vertical" >
88+
89+
<TextView
90+
android:id="@+id/gallery_flip_item_place_city_textview"
91+
android:layout_width="wrap_content"
92+
android:layout_height="wrap_content"
93+
android:textColor="@color/white"
94+
android:textSize="11sp" />
95+
96+
<TextView
97+
android:id="@+id/gallery_flip_item_place_country_textview"
98+
android:layout_width="wrap_content"
99+
android:layout_height="wrap_content"
100+
android:textColor="@color/white"
101+
android:textSize="11sp" />
102+
</LinearLayout>
103+
</LinearLayout>
104+
</LinearLayout>
105+
</LinearLayout>
106+
107+
</FrameLayout>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<resources>
22

33
<style name="AppTheme" parent="android:Theme.Light" />
4+
<color name="white">#ffffff</color>
5+
<color name="transparentBlack">#55000000</color>
46

57
</resources>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package com.aphidmobile.flip.demo;
2+
3+
import android.os.Bundle;
4+
import android.support.v4.app.FragmentActivity;
5+
import com.aphidmobile.flipview.demo.R;
6+
7+
/*
8+
Copyright 2012 Aphid Mobile
9+
10+
Licensed under the Apache License, Version 2.0 (the "License");
11+
you may not use this file except in compliance with the License.
12+
You may obtain a copy of the License at
13+
14+
http://www.apache.org/licenses/LICENSE-2.0
15+
16+
Unless required by applicable law or agreed to in writing, software
17+
distributed under the License is distributed on an "AS IS" BASIS,
18+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19+
See the License for the specific language governing permissions and
20+
limitations under the License.
21+
22+
*/
23+
public class FlipFragmentActivity extends FragmentActivity {
24+
@Override
25+
protected void onCreate(Bundle savedInstanceState) {
26+
super.onCreate(savedInstanceState);
27+
setContentView(R.layout.fragment_layout);
28+
}
29+
}
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
package com.aphidmobile.flip.demo;
2+
3+
import java.util.ArrayList;
4+
import java.util.List;
5+
6+
import android.app.Activity;
7+
import android.content.Context;
8+
import android.content.Intent;
9+
import android.net.Uri;
10+
import android.os.Bundle;
11+
import android.text.Html;
12+
import android.view.LayoutInflater;
13+
import android.view.View;
14+
import android.view.ViewGroup;
15+
import android.widget.BaseAdapter;
16+
import android.widget.Button;
17+
import android.widget.ImageView;
18+
import android.widget.TextView;
19+
20+
import com.aphidmobile.flip.FlipViewController;
21+
import com.aphidmobile.flipview.demo.R;
22+
import com.aphidmobile.utils.AphidLog;
23+
import com.aphidmobile.utils.IO;
24+
import com.aphidmobile.utils.UI;
25+
26+
public class Issue5Activity extends Activity {
27+
private FlipViewController flipView;
28+
29+
/**
30+
* Called when the activity is first created.
31+
*/
32+
@Override
33+
public void onCreate(Bundle savedInstanceState) {
34+
super.onCreate(savedInstanceState);
35+
36+
setTitle(R.string.activity_title);
37+
38+
flipView = new FlipViewController(this);
39+
40+
flipView.setAdapter(new MyBaseAdapter(this));
41+
42+
setContentView(flipView);
43+
}
44+
45+
@Override
46+
protected void onResume() {
47+
super.onResume();
48+
flipView.onResume();
49+
}
50+
51+
@Override
52+
protected void onPause() {
53+
super.onPause();
54+
flipView.onPause();
55+
}
56+
57+
private static class MyBaseAdapter extends BaseAdapter {
58+
private static List<Data> IMG_DESCRIPTIONS = new ArrayList<Data>();
59+
60+
static {
61+
IMG_DESCRIPTIONS.add(new Data("Potala Palace", "potala_palace.jpg", "The <b>Potala Palace</b> is located in Lhasa, Tibet Autonomous Region, China. It is named after Mount Potalaka, the mythical abode of Chenresig or Avalokitesvara.", "China", "Lhasa"));
62+
IMG_DESCRIPTIONS.add(new Data("Drepung Monastery", "drepung_monastery.jpg", "<b>Drepung Monastery</b>, located at the foot of Mount Gephel, is one of the \"great three\" Gelukpa university monasteries of Tibet.", "China", "Lhasa"));
63+
IMG_DESCRIPTIONS.add(new Data("Sera Monastery", "sera_monastery.jpg", "<b>Sera Monastery</b> is one of the 'great three' Gelukpa university monasteries of Tibet, located 1.25 miles (2.01 km) north of Lhasa.", "China", "Lhasa"));
64+
IMG_DESCRIPTIONS.add(new Data("Samye Monastery", "samye_monastery.jpg", "<b>Samye Monastery</b> is the first Buddhist monastery built in Tibet, was most probably first constructed between 775 and 779 CE.", "China", "Samye"));
65+
IMG_DESCRIPTIONS.add(new Data("Tashilunpo Monastery", "tashilunpo_monastery.jpg", "<b>Tashilhunpo Monastery</b>, founded in 1447 by Gendun Drup, the First Dalai Lama, is a historic and culturally important monastery next to Shigatse, the second-largest city in Tibet.", "China", "Shigatse"));
66+
IMG_DESCRIPTIONS.add(new Data("Zhangmu Port", "zhangmu_port.jpg", "<b>Zhangmu/Dram</b> is a customs town and port of entry located in Nyalam County on the Nepal-China border, just uphill and across the Bhote Koshi River from the Nepalese town of Kodari.", "China", "Zhangmu"));
67+
IMG_DESCRIPTIONS.add(new Data("Kathmandu", "kathmandu.jpg", "<b>Kathmandu</b> is the capital and, with more than one million inhabitants, the largest metropolitan city of Nepal.", "Nepal", "Kathmandu"));
68+
IMG_DESCRIPTIONS.add(new Data("Pokhara", "pokhara.jpg", "<b>Pokhara Sub-Metropolitan City</b> is the second largest city of Nepal with approximately 250,000 inhabitants and is situated about 200 km west of the capital Kathmandu.", "Nepal", "Pokhara"));
69+
IMG_DESCRIPTIONS.add(new Data("Patan", "patan.jpg", "<b>Patan</b>, officially Lalitpur Sub-Metropolitan City, is one of the major cities of Nepal located in the south-central part of Kathmandu Valley.", "Nepal", "Patan"));
70+
}
71+
72+
private LayoutInflater inflater;
73+
74+
private MyBaseAdapter(Context context) {
75+
inflater = LayoutInflater.from(context);
76+
}
77+
78+
@Override
79+
public int getCount() {
80+
return IMG_DESCRIPTIONS.size();
81+
}
82+
83+
@Override
84+
public Object getItem(int position) {
85+
return position;
86+
}
87+
88+
@Override
89+
public long getItemId(int position) {
90+
return position;
91+
}
92+
93+
@Override
94+
public View getView(int position, View convertView, ViewGroup parent) {
95+
View layout = convertView;
96+
if (convertView == null)
97+
layout = inflater.inflate(R.layout.issue5, null);
98+
99+
final Data data = IMG_DESCRIPTIONS.get(position);
100+
101+
UI
102+
.<TextView>findViewById(layout, R.id.gallery_flip_item_place_name_textview)
103+
.setText(AphidLog.format("%d. %s", position, data.title));
104+
105+
UI
106+
.<ImageView>findViewById(layout, R.id.gallery_flip_item_background_imageview)
107+
.setImageBitmap(IO.readBitmap(inflater.getContext().getAssets(), data.imageFilename));
108+
109+
UI
110+
.<TextView>findViewById(layout, R.id.gallery_flip_item_place_description_textview)
111+
.setText(Html.fromHtml(data.description));
112+
113+
UI
114+
.<TextView>findViewById(layout, R.id.gallery_flip_item_place_city_textview)
115+
.setText(data.city);
116+
117+
UI
118+
.<TextView>findViewById(layout, R.id.gallery_flip_item_place_country_textview)
119+
.setText(data.country);
120+
121+
return layout;
122+
}
123+
124+
private static class Data {
125+
public final String title;
126+
public final String imageFilename;
127+
public final String description;
128+
public final String country;
129+
public final String city;
130+
131+
private Data(String title, String imageFilename, String description, String country, String city) {
132+
this.title = title;
133+
this.imageFilename = imageFilename;
134+
this.description = description;
135+
this.country = country;
136+
this.city = city;
137+
}
138+
}
139+
}
140+
}

0 commit comments

Comments
 (0)