Skip to content

Commit

Permalink
fix no github icon on viewpager activity
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinea committed Jan 5, 2014
1 parent 47b479b commit b2aa318
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 435,197 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ target/*
.svn
gen
bin/*
proguard/*

*.pydevproject
.project
Expand All @@ -19,6 +20,7 @@ local.properties
.classpath
.settings/
.loadpath
*analytics.xml

# External tool builders
.externalToolBuilders/
Expand Down
420,558 changes: 0 additions & 420,558 deletions proguard/dump.txt

This file was deleted.

6,886 changes: 0 additions & 6,886 deletions proguard/mapping.txt

This file was deleted.

7,100 changes: 0 additions & 7,100 deletions proguard/seeds.txt

This file was deleted.

650 changes: 0 additions & 650 deletions proguard/usage.txt

This file was deleted.

22 changes: 19 additions & 3 deletions src/cn/trinea/android/demo/ViewPagerDemo.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
import java.util.ArrayList;
import java.util.List;

import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager;
import android.view.Menu;
import android.view.MenuItem;
import cn.trinea.android.demo.utils.AppUtils;

Expand All @@ -21,18 +23,22 @@
*/
public class ViewPagerDemo extends FragmentActivity {

List<Fragment> fragmentList = new ArrayList<Fragment>();
List<String> titleList = new ArrayList<String>();
private static int TOTAL_COUNT = 3;

private Context context;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.view_pager_demo);

context = getApplicationContext();
AppUtils.init(this);

ViewPager vp = (ViewPager)findViewById(R.id.view_pager);
for (int i = 0; i < 3; i++) {
List<Fragment> fragmentList = new ArrayList<Fragment>();
List<String> titleList = new ArrayList<String>();
for (int i = 0; i < TOTAL_COUNT; i++) {
ViewPagerFragment viewPagerFragment1 = new ViewPagerFragment();
Bundle bundle = new Bundle();
bundle.putInt("upImageId", 0);
Expand Down Expand Up @@ -85,6 +91,10 @@ public boolean onOptionsItemSelected(MenuItem item) {
onBackPressed();
return true;
}
case R.id.github: {
AppUtils.urlOpen(context, getString(R.string.github_trinea));
return true;
}
}
return false;
}
Expand All @@ -100,4 +110,10 @@ protected void onStop() {
super.onStop();
EasyTracker.getInstance(this).activityStop(this);
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
}
26 changes: 26 additions & 0 deletions src/cn/trinea/android/demo/ViewPagerMulTiFragmentDemo.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v4.view.ViewPager.OnPageChangeListener;
import android.view.Menu;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
Expand All @@ -12,6 +13,9 @@
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import cn.trinea.android.demo.utils.AppUtils;

import com.google.analytics.tracking.android.EasyTracker;

/**
* ViewPager implements gallery effect
Expand Down Expand Up @@ -110,7 +114,29 @@ public boolean onOptionsItemSelected(MenuItem item) {
onBackPressed();
return true;
}
case R.id.github: {
AppUtils.urlOpen(context, getString(R.string.github_trinea));
return true;
}
}
return false;
}

@Override
protected void onStart() {
super.onStart();
EasyTracker.getInstance(this).activityStart(this);
}

@Override
protected void onStop() {
super.onStop();
EasyTracker.getInstance(this).activityStop(this);
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
}

0 comments on commit b2aa318

Please sign in to comment.