Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

Added fling support. #10

Merged
merged 3 commits into from
Dec 7, 2012
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use scaled pixels for text size in demo
The previous text size was too big to be seen on devices like Galaxy Nexus.
  • Loading branch information
Paul Burke committed Nov 23, 2012
commit 68b1acc243a5fd4eaba3a5704cb8f6b8b6838375
3 changes: 3 additions & 0 deletions FlipView/Demo/res/values/dimensions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<resources>
<dimen name="textSize">128sp</dimen>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@
package com.aphidmobile.flip.demo;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.*;
import android.widget.BaseAdapter;
import com.aphidmobile.flip.FlipViewController;
import com.aphidmobile.flip.demo.views.NumberButton;
import com.aphidmobile.flip.demo.views.NumberTextView;
import com.aphidmobile.flipview.demo.R;

public class FlipButtonActivity extends Activity {
Expand Down Expand Up @@ -58,8 +60,9 @@ public long getItemId(int position) {
public View getView(int position, View convertView, ViewGroup parent) {
NumberButton button;
if (convertView == null) {
button = new NumberButton(parent.getContext(), position);
button.setTextSize(360);
final Context context = parent.getContext();
button = new NumberButton(context, position);
button.setTextSize(context.getResources().getDimension(R.dimen.textSize));
}
else {
button = (NumberButton) convertView;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.aphidmobile.flip.demo;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
Expand Down Expand Up @@ -44,8 +45,9 @@ public long getItemId(int position) {
public View getView(int position, View convertView, ViewGroup parent) {
NumberTextView view;
if (convertView == null) {
view = new NumberTextView(parent.getContext(), position);
view.setTextSize(360);
final Context context = parent.getContext();
view = new NumberTextView(context, position);
view.setTextSize(context.getResources().getDimension(R.dimen.textSize));
}
else {
view = (NumberTextView) convertView;
Expand Down