Skip to content

Commit 467bff7

Browse files
author
jinyalin
committed
init
1 parent dacfaa7 commit 467bff7

File tree

291 files changed

+38159
-15
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

291 files changed

+38159
-15
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
.DS_Store
77
/build
88
/captures
9+
.idea

app/build.gradle

+21-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
apply plugin: 'com.android.application'
22

3+
repositories {
4+
mavenCentral()
5+
flatDir {
6+
dirs 'libs'
7+
}
8+
flatDir {
9+
dirs '../third_party/svg-android/libs/'
10+
}
11+
}
12+
313
android {
414
compileSdkVersion 23
515
buildToolsVersion "23.0.3"
@@ -10,6 +20,9 @@ android {
1020
targetSdkVersion 23
1121
versionCode 1
1222
versionName "1.0"
23+
24+
buildConfigField("String", "BOOTSTRAP_DATA_TIMESTAMP", "\"${bootstrap_data_timestamp}\"")
25+
buildConfigField("String", "INPERSON_TIMEZONE", "\"${inperson_timezone}\"")
1326
}
1427
buildTypes {
1528
release {
@@ -22,10 +35,17 @@ android {
2235
dependencies {
2336
compile fileTree(include: ['*.jar'], dir: 'libs')
2437
testCompile 'junit:junit:4.12'
25-
2638
compile "com.android.support:appcompat-v7:${android_support_library_version}"
2739
compile "com.android.support:cardview-v7:${android_support_library_version}"
40+
compile "com.android.support:design:${android_support_library_version}"
2841

2942
compile "com.google.android.gms:play-services-plus:${google_play_services_client_library_version}"
3043

44+
compile 'com.github.bumptech.glide:glide:3.7.0'
45+
compile 'com.android.support.test.espresso:espresso-idling-resource:2.0'
46+
compile 'com.google.guava:guava:18.0'
47+
compile 'com.google.code.gson:gson:2.5'
48+
49+
compile files('../third_party/basic-http-client/libs/basic-http-client-android-0.88.jar')
50+
compile(name: 'svg-android-2.0.7-20150515.214425-1', ext: 'jar')
3151
}

app/src/main/AndroidManifest.xml

+26-2
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
66

77
<application
8-
android:allowBackup="true"
8+
android:allowBackup="false"
9+
android:hardwareAccelerated="true"
910
android:icon="@mipmap/ic_launcher"
1011
android:label="@string/app_name"
1112
android:supportsRtl="true"
1213
android:theme="@style/Theme.YaLinIO">
1314
<activity
14-
android:name=".MainActivity"
15+
android:name=".explore.ExploreIOActivity"
1516
android:exported="true"
1617
android:theme="@style/Theme.YaLinIO.Sessions">
1718
<intent-filter>
@@ -24,6 +25,29 @@
2425
android:name=".welcome.WelcomeActivity"
2526
android:exported="false"
2627
android:theme="@style/Theme.YaLinIO.Welcome" />
28+
29+
<service
30+
android:name=".service.DataBootstrapService"
31+
android:exported="false" />
32+
33+
<provider
34+
android:name=".provider.ScheduleProvider"
35+
android:authorities="com.yalin.googleio"
36+
android:exported="true"
37+
android:label="@string/app_name"
38+
android:syncable="true" />
39+
40+
<receiver
41+
android:name=".appwidget.ScheduleWidgetProvider"
42+
android:enabled="true">
43+
<intent-filter>
44+
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
45+
</intent-filter>
46+
47+
<meta-data
48+
android:name="android.appwidget.provider"
49+
android:resource="@xml/widgetinfo" />
50+
</receiver>
2751
</application>
2852

2953
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package com.yalin.googleio;
2+
3+
import java.util.TimeZone;
4+
5+
/**
6+
* 作者:YaLin
7+
* 日期:2016/4/19.
8+
*/
9+
public class Config {
10+
public interface Tags {
11+
String SESSIONS = "TYPE_SESSIONS";
12+
String SESSION_GROUPING_TAG_CATEGORY = "TYPE";
13+
14+
String CATEGORY_THEME = "THEME";
15+
String CATEGORY_TOPIC = "TOPIC";
16+
String CATEGORY_TYPE = "TYPE";
17+
18+
String SPECIAL_KEYNOTE = "FLAG_KEYNOTE";
19+
}
20+
21+
public static final TimeZone CONFERENCE_TIMEZONE =
22+
TimeZone.getTimeZone(BuildConfig.INPERSON_TIMEZONE);
23+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
package com.yalin.googleio.appwidget;
2+
3+
import android.accounts.Account;
4+
import android.appwidget.AppWidgetManager;
5+
import android.appwidget.AppWidgetProvider;
6+
import android.content.ComponentName;
7+
import android.content.Context;
8+
import android.content.Intent;
9+
10+
import com.yalin.googleio.R;
11+
import com.yalin.googleio.provider.ScheduleProvider;
12+
import com.yalin.googleio.sync.SyncHelper;
13+
import com.yalin.googleio.util.AccountUtils;
14+
15+
import static com.yalin.googleio.util.LogUtils.LOGD;
16+
import static com.yalin.googleio.util.LogUtils.makeLogTag;
17+
18+
/**
19+
* 作者:YaLin
20+
* 日期:2016/4/19.
21+
*/
22+
public class ScheduleWidgetProvider extends AppWidgetProvider {
23+
private static final String TAG = makeLogTag(ScheduleWidgetProvider.class);
24+
25+
private static final String REFRESH_ACTION =
26+
"com.yalin.googleio.appwidget.action.REFRESH";
27+
28+
private static final String EXTRA_PERFORM_SYNC =
29+
"com.yalin.googleio.appwidget.extra.PERFORM_SYNC";
30+
31+
public static Intent getRefreshBroadcastIntent(Context context, boolean performSync) {
32+
return new Intent(REFRESH_ACTION)
33+
.setComponent(new ComponentName(context, ScheduleProvider.class))
34+
.putExtra(EXTRA_PERFORM_SYNC, performSync);
35+
}
36+
37+
@Override
38+
public void onReceive(Context context, Intent intent) {
39+
final String action = intent.getAction();
40+
if (REFRESH_ACTION.equals(action)) {
41+
LOGD(TAG, "received REFRESH_ACTION_from widget.");
42+
final boolean shouldSync = intent.getBooleanExtra(EXTRA_PERFORM_SYNC, false);
43+
44+
Account chosenAccount = AccountUtils.getActiveAccount(context);
45+
if (shouldSync && chosenAccount != null) {
46+
SyncHelper.requestManualSync(chosenAccount);
47+
}
48+
49+
final AppWidgetManager mgr = AppWidgetManager.getInstance(context);
50+
final ComponentName cn = new ComponentName(context, ScheduleWidgetProvider.class);
51+
mgr.notifyAppWidgetViewDataChanged(mgr.getAppWidgetIds(cn),
52+
R.id.widget_schedule_list);
53+
}
54+
super.onReceive(context, intent);
55+
}
56+
57+
@Override
58+
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
59+
LOGD(TAG, "updating app widget.");
60+
super.onUpdate(context, appWidgetManager, appWidgetIds);
61+
}
62+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
package com.yalin.googleio.explore;
2+
3+
import android.app.Activity;
4+
import android.content.Intent;
5+
import android.os.Bundle;
6+
import android.support.annotation.Nullable;
7+
8+
import com.yalin.googleio.R;
9+
import com.yalin.googleio.explore.ExploreModel.ExploreUserActionEnum;
10+
import com.yalin.googleio.framework.QueryEnum;
11+
import com.yalin.googleio.ui.BaseActivity;
12+
import com.yalin.googleio.ui.widget.CollectionView;
13+
import com.yalin.googleio.ui.widget.DrawShadowFrameLayout;
14+
15+
import static com.yalin.googleio.util.LogUtils.makeLogTag;
16+
17+
public class ExploreIOActivity extends BaseActivity {
18+
private static final String TAG = makeLogTag(ExploreIOActivity.class);
19+
20+
public static Intent getOpenIntent(Activity activity) {
21+
Intent intent = new Intent(activity, ExploreIOActivity.class);
22+
return intent;
23+
}
24+
25+
@Override
26+
protected void onCreate(Bundle savedInstanceState) {
27+
super.onCreate(savedInstanceState);
28+
setContentView(R.layout.activity_explore_io);
29+
addPresenterFragment(R.id.explore_library_frag,
30+
new ExploreModel(getApplicationContext()),
31+
new QueryEnum[]{ExploreModel.ExploreQueryEnum.SESSIONS,
32+
ExploreModel.ExploreQueryEnum.TAGS},
33+
new ExploreUserActionEnum[]{ExploreUserActionEnum.RELOAD});
34+
registerHideableHeaderView(findViewById(R.id.header_bar));
35+
}
36+
37+
@Override
38+
protected void onPostCreate(@Nullable Bundle savedInstanceState) {
39+
super.onPostCreate(savedInstanceState);
40+
enableActionBarAuthHide((CollectionView) findViewById(R.id.explore_collection_view));
41+
}
42+
43+
@Override
44+
protected void onActionBarAutoShowOrHide(boolean shown) {
45+
super.onActionBarAutoShowOrHide(shown);
46+
DrawShadowFrameLayout frame = (DrawShadowFrameLayout) findViewById(R.id.main_content);
47+
frame.setShadowVisible(shown, shown);
48+
}
49+
}

0 commit comments

Comments
 (0)