Skip to content

Commit e2cde33

Browse files
committed
Adding zipaling into the build, updating the build number to match what is in Google Play and implementing fixes that closes #7
1 parent 197e497 commit e2cde33

File tree

3 files changed

+54
-5
lines changed

3 files changed

+54
-5
lines changed

app/AndroidManifest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
44
package="com.donnfelker.android.bootstrap"
5-
android:versionCode="100"
6-
android:versionName="1.0" >
5+
android:versionCode="102"
6+
android:versionName="1.1" >
77

88
<uses-sdk
99
android:minSdkVersion="8"

app/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@
190190
<debug>false</debug>
191191
</sign>
192192
<zipalign>
193+
<skip>false</skip>
193194
<verbose>true</verbose>
194195
<outputApk>${project.build.directory}/${project.artifactId}-${project.version}-signed-aligned.apk</outputApk>
195196
</zipalign>

app/src/main/java/com/donnfelker/android/bootstrap/ui/CarouselActivity.java

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,22 @@
22

33
package com.donnfelker.android.bootstrap.ui;
44

5+
import android.accounts.OperationCanceledException;
56
import android.content.Intent;
67
import android.os.Bundle;
78
import android.support.v4.view.ViewPager;
89
import android.view.View;
910

1011
import com.actionbarsherlock.view.MenuItem;
1112
import com.actionbarsherlock.view.Window;
13+
import com.donnfelker.android.bootstrap.BootstrapServiceProvider;
1214
import com.donnfelker.android.bootstrap.R;
15+
import com.donnfelker.android.bootstrap.core.BootstrapService;
16+
import com.donnfelker.android.bootstrap.util.SafeAsyncTask;
1317
import com.viewpagerindicator.TitlePageIndicator;
1418

19+
import javax.inject.Inject;
20+
1521
import butterknife.InjectView;
1622
import butterknife.Views;
1723
import net.simonvt.menudrawer.MenuDrawer;
@@ -25,8 +31,12 @@ public class CarouselActivity extends BootstrapFragmentActivity {
2531
@InjectView(R.id.tpi_header) TitlePageIndicator indicator;
2632
@InjectView(R.id.vp_pages) ViewPager pager;
2733

34+
@Inject BootstrapServiceProvider serviceProvider;
35+
2836
private MenuDrawer menuDrawer;
2937

38+
private boolean userHasAuthenticated = false;
39+
3040
@Override
3141
protected void onCreate(Bundle savedInstanceState) {
3242

@@ -43,14 +53,52 @@ protected void onCreate(Bundle savedInstanceState) {
4353

4454
Views.inject(this);
4555

46-
pager.setAdapter(new BootstrapPagerAdapter(getResources(), getSupportFragmentManager()));
56+
checkAuth();
57+
58+
}
59+
60+
private void initScreen() {
61+
if(userHasAuthenticated) {
62+
pager.setAdapter(new BootstrapPagerAdapter(getResources(), getSupportFragmentManager()));
4763

48-
indicator.setViewPager(pager);
49-
pager.setCurrentItem(1);
64+
indicator.setViewPager(pager);
65+
pager.setCurrentItem(1);
66+
67+
}
5068

5169
setNavListeners();
5270
}
5371

72+
private void checkAuth() {
73+
new SafeAsyncTask<Boolean>() {
74+
75+
@Override
76+
public Boolean call() throws Exception {
77+
final BootstrapService svc = serviceProvider.getService(CarouselActivity.this);
78+
return svc != null;
79+
80+
}
81+
82+
@Override
83+
protected void onException(Exception e) throws RuntimeException {
84+
super.onException(e);
85+
if(e instanceof OperationCanceledException) {
86+
// User cancelled the authentication process (back button, etc).
87+
// Since auth could not take place, lets finish this activity.
88+
finish();
89+
}
90+
}
91+
92+
@Override
93+
protected void onSuccess(Boolean hasAuthenticated) throws Exception {
94+
super.onSuccess(hasAuthenticated);
95+
userHasAuthenticated = true;
96+
initScreen();
97+
}
98+
}.execute();
99+
}
100+
101+
54102
private void setNavListeners() {
55103

56104
menuDrawer.findViewById(R.id.home).setOnClickListener(new View.OnClickListener() {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy