Skip to content
This repository has been archived by the owner on May 28, 2020. It is now read-only.

Commit

Permalink
remove the wear module, fix some bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
TonnyL committed May 9, 2017
1 parent 25569b6 commit 19177f5
Show file tree
Hide file tree
Showing 214 changed files with 98 additions and 128 deletions.
3 changes: 1 addition & 2 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 2 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,13 @@ android:
- platform-tools
- build-tools-25.0.2
- android-25
- extra-google-google_play_services
- extra-android-m2repository
- addon-google_apis-google-25
licenses:
- 'android-sdk-preview-license-.+'
- 'android-sdk-license-.+'
- 'google-gdk-license-.+'

jdk:
- oraclejdk8

notifications:
email: false

script: ./gradlew assemble check
script:
- ./gradlew assemble check
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ This project is still in progress. Here are the some features that I will finish
- [x] Day and night mode.
- [x] Service to build notifications.
- [x] Settings and about page.
- [ ] Supporting Android Wear.
- [ ] UI test and unit test.

### Help Me Improve This App
Expand Down
File renamed without changes.
40 changes: 23 additions & 17 deletions mobile/build.gradle → app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,33 +31,39 @@ android {

}

ext {
supportLibVersion = '25.3.1'
rxjavaVersion = '2.0.1'
retrofitVersion = '2.2.0'
zxingLibVersion = '3.3.0'
datetimePickerVersion = '3.1.3'
circleimageviewVersion = '2.1.0'
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
wearApp project(':wear')
// Google Mobile Service
compile 'com.google.android.gms:play-services:10.2.1'
// Support libraries
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support:preference-v14:25.3.1'
compile 'com.android.support:customtabs:25.3.1'
compile "com.android.support:appcompat-v7:${supportLibVersion}"
compile "com.android.support:support-v4:${supportLibVersion}"
compile "com.android.support:design:${supportLibVersion}"
compile "com.android.support:cardview-v7:${supportLibVersion}"
compile "com.android.support:preference-v14:${supportLibVersion}"
compile "com.android.support:customtabs:${supportLibVersion}"
// ReactiveX series
compile 'io.reactivex.rxjava2:rxjava:2.0.1'
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
compile "io.reactivex.rxjava2:rxjava:${rxjavaVersion}"
compile "io.reactivex.rxjava2:rxandroid:${rxjavaVersion}"
// Retrofit series
compile 'com.squareup.retrofit2:retrofit:2.2.0'
compile 'com.squareup.retrofit2:adapter-rxjava2:2.2.0'
compile 'com.squareup.retrofit2:converter-gson:2.2.0'
compile "com.squareup.retrofit2:retrofit:${retrofitVersion}"
compile "com.squareup.retrofit2:adapter-rxjava2:${retrofitVersion}"
compile "com.squareup.retrofit2:converter-gson:${retrofitVersion}"
// Zxing
compile 'com.google.zxing:core:3.3.0'
compile "com.google.zxing:core:${zxingLibVersion}"
// Material date time picker
compile 'com.wdullaer:materialdatetimepicker:3.1.3'
compile "com.wdullaer:materialdatetimepicker:${datetimePickerVersion}"
// CircleImageView
compile 'de.hdodenhof:circleimageview:2.1.0'
compile "de.hdodenhof:circleimageview:${circleimageviewVersion}"
testCompile 'junit:junit:4.12'
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

<!-- app shortcuts -->
<meta-data
android:name="android.app.shortcuts"
android:resource="@xml/shortcuts" />
</activity>
<activity
android:name=".mvp.packages.MainActivity"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@
import android.animation.ArgbEvaluator;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.ShortcutInfo;
import android.content.pm.ShortcutManager;
import android.graphics.drawable.Icon;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Handler;
import android.os.Message;
import android.preference.PreferenceManager;
Expand All @@ -33,10 +37,14 @@
import android.widget.ImageButton;
import android.widget.ImageView;

import java.util.Arrays;

import io.github.marktony.espresso.R;
import io.github.marktony.espresso.data.source.CompaniesRepository;
import io.github.marktony.espresso.data.source.local.CompaniesLocalDataSource;
import io.github.marktony.espresso.mvp.addpackage.AddPackageActivity;
import io.github.marktony.espresso.mvp.packages.MainActivity;
import io.github.marktony.espresso.mvp.search.SearchActivity;
import io.github.marktony.espresso.util.SettingsUtil;

public class OnboardingActivity extends AppCompatActivity {
Expand Down Expand Up @@ -99,6 +107,7 @@ public void onClick(View v) {
ed.putBoolean(SettingsUtil.KEY_FIRST_LAUNCH, false);
ed.apply();
navigateToMainActivity();
enableShortcuts();
}
});

Expand Down Expand Up @@ -188,6 +197,44 @@ protected void onProgressUpdate(Void... values) {
}
}

private void enableShortcuts() {
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) {
ShortcutManager manager = getSystemService(ShortcutManager.class);
ShortcutInfo addPkg = new ShortcutInfo.Builder(this, "shortcut_add_package")
.setLongLabel(getString(R.string.shortcut_label_add_package))
.setShortLabel(getString(R.string.shortcut_label_add_package))
.setIcon(Icon.createWithResource(this, R.drawable.ic_shortcut_add))
.setIntent(
new Intent(OnboardingActivity.this, AddPackageActivity.class)
.setAction(Intent.ACTION_VIEW)
.addCategory(ShortcutInfo.SHORTCUT_CATEGORY_CONVERSATION)
)
.build();
ShortcutInfo scanCode = new ShortcutInfo.Builder(this, "shortcut_scan_code")
.setIcon(Icon.createWithResource(this, R.drawable.ic_shortcut_filter_center_focus))
.setLongLabel(getString(R.string.shortcut_label_scan_code))
.setShortLabel(getString(R.string.shortcut_label_scan_code))
.setIntent(
new Intent(OnboardingActivity.this, AddPackageActivity.class)
.setAction("io.github.marktony.espresso.mvp.addpackage.AddPackageActivity")
.addCategory(ShortcutInfo.SHORTCUT_CATEGORY_CONVERSATION)
)
.build();
ShortcutInfo search = new ShortcutInfo.Builder(this, "shortcut_search")
.setIcon(Icon.createWithResource(this, R.drawable.ic_shortcut_search))
.setLongLabel(getString(R.string.shortcut_label_search))
.setShortLabel(getString(R.string.shortcut_label_search))
.setIntent(
new Intent(OnboardingActivity.this, SearchActivity.class)
.setAction(Intent.ACTION_VIEW)
.addCategory(ShortcutInfo.SHORTCUT_CATEGORY_CONVERSATION)
)
.build();
manager.setDynamicShortcuts(Arrays.asList(addPkg, scanCode, search));
}

}

private void navigateToMainActivity() {
Intent i = new Intent(this, MainActivity.class);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
sectionIntro.setText(R.string.onboarding_intro_1);
break;
case 1:
sectionImg.setBackgroundResource(R.drawable.ic_notifications_black_24dp);
sectionImg.setBackgroundResource(R.drawable.ic_camera_black_24dp);
sectionLabel.setText(R.string.onboarding_section_2);
sectionIntro.setText(R.string.onboarding_intro_2);
break;
case 2:
sectionImg.setBackgroundResource(R.drawable.ic_watch_black_24dp);
sectionImg.setBackgroundResource(R.drawable.ic_notifications_black_24dp);
sectionLabel.setText(R.string.onboarding_section_3);
sectionIntro.setText(R.string.onboarding_intro_3);
break;
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M20,12c0,-2.54 -1.19,-4.81 -3.04,-6.27L16,0H8l-0.95,5.73C5.19,7.19 4,9.45 4,12s1.19,4.81 3.05,6.27L8,24h8l0.96,-5.73C18.81,16.81 20,14.54 20,12zM6,12c0,-3.31 2.69,-6 6,-6s6,2.69 6,6 -2.69,6 -6,6 -6,-2.69 -6,-6z"/>
android:pathData="M9.4,10.5l4.77,-8.26C13.47,2.09 12.75,2 12,2c-2.4,0 -4.6,0.85 -6.32,2.25l3.66,6.35 0.06,-0.1zM21.54,9c-0.92,-2.92 -3.15,-5.26 -6,-6.34L11.88,9h9.66zM21.8,10h-7.49l0.29,0.5 4.76,8.25C21,16.97 22,14.61 22,12c0,-0.69 -0.07,-1.35 -0.2,-2zM8.54,12l-3.9,-6.75C3.01,7.03 2,9.39 2,12c0,0.69 0.07,1.35 0.2,2h7.49l-1.15,-2zM2.46,15c0.92,2.92 3.15,5.26 6,6.34L12.12,15L2.46,15zM13.73,15l-3.9,6.76c0.7,0.15 1.42,0.24 2.17,0.24 2.4,0 4.6,-0.85 6.32,-2.25l-3.66,-6.35 -0.93,1.6z"/>
</vector>
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,11 @@
<string name="onboarding_finish_button_description">完成</string>
<string name="onboarding_pre_button_description">上一步</string>
<string name="onboarding_section_1">简单快速地添加包裹</string>
<string name="onboarding_intro_1">支持全球640余家快递公司, 但当你添加包裹时, 快递公司的识别将被自动完成。</string>
<string name="onboarding_section_2">保持你的物流信息为最新状态</string>
<string name="onboarding_intro_2">当物流信息更新后, 你将收到通知提醒, 所以你的信息将保持最新。</string>
<string name="onboarding_section_3">和你的Android Wear设备保持同步</string>
<string name="onboarding_intro_3">你可以在Android Wear设备上完成一切操作。</string>
<string name="onboarding_intro_1">支持全球640余家快递公司</string>
<string name="onboarding_section_2">一次点击就可以完成输入单号的操作</string>
<string name="onboarding_intro_2">对准单号扫描,然后单号就会被自动识别</string>
<string name="onboarding_section_3">保持你的物流信息为最新状态</string>
<string name="onboarding_intro_3">当物流信息更新后, 你将收到通知提醒, 所以你的信息将保持最新</string>
<string name="onboarding_finish_button_description_wait">准备中, 请稍后…</string>
<!--onboarding end-->

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,11 @@
<string name="onboarding_finish_button_description">完成</string>
<string name="onboarding_pre_button_description">上一步</string>
<string name="onboarding_section_1">簡單快速地添加包裹</string>
<string name="onboarding_intro_1">支持全球640餘家快遞公司, 但當你添加包裹時, 快遞公司的識別將被自動完成。</string>
<string name="onboarding_section_2">保持你的物流信息為最新狀態</string>
<string name="onboarding_intro_2">當物流信息更新後, 你將收到通知提醒, 所以你的信息將保持最新。</string>
<string name="onboarding_section_3">和你的Android Wear設備保持同步</string>
<string name="onboarding_intro_3">你可以在Android Wear設備上完成一切操作。</string>
<string name="onboarding_intro_1">支持全球640餘家快遞公司</string>
<string name="onboarding_section_2">一次點擊就可以完成輸入單號的操作</string>
<string name="onboarding_intro_2">對準單號掃描,然後單號就會被自動識別</string>
<string name="onboarding_section_3">保持你的物流信息為最新狀態</string>
<string name="onboarding_intro_3">當物流信息更新後, 你將收到通知提醒, 所以你的信息將保持最新。</string>
<string name="onboarding_finish_button_description_wait">準備中, 請稍後…</string>
<!--onboarding end-->

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,11 @@
<string name="onboarding_finish_button_description">完成</string>
<string name="onboarding_pre_button_description">上一步</string>
<string name="onboarding_section_1">簡單快速地添加包裹</string>
<string name="onboarding_intro_1">支持全球640餘家快遞公司, 但當你添加包裹時, 快遞公司的識別將被自動完成。</string>
<string name="onboarding_section_2">保持你的物流信息為最新狀態</string>
<string name="onboarding_intro_2">當物流信息更新後, 你將收到通知提醒, 所以你的信息將保持最新。</string>
<string name="onboarding_section_3">和你的Android Wear設備保持同步</string>
<string name="onboarding_intro_3">你可以在Android Wear設備上完成一切操作。</string>
<string name="onboarding_intro_1">支持全球640餘家快遞公司</string>
<string name="onboarding_section_2">一次點擊就可以完成輸入單號的操作</string>
<string name="onboarding_intro_2">對準單號掃描,然後單號就會被自動識別</string>
<string name="onboarding_section_3">保持你的物流信息為最新狀態</string>
<string name="onboarding_intro_3">當物流信息更新後, 你將收到通知提醒, 所以你的信息將保持最新</string>
<string name="onboarding_finish_button_description_wait">準備中, 請稍後…</string>
<!--onboarding end-->

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,11 @@
<string name="onboarding_finish_button_description">Finish</string>
<string name="onboarding_pre_button_description">Pre</string>
<string name="onboarding_section_1">Add your packages quickly and easily</string>
<string name="onboarding_intro_1">Support 640+ express companies all over the world, but when you add packages, the companies will be recognized automatically.</string>
<string name="onboarding_section_2">Keep the delivery status updated</string>
<string name="onboarding_intro_2">Push notification when the delivery status is refreshed, so you can get the latest information.</string>
<string name="onboarding_section_3">Sync with your Android Wear devices</string>
<string name="onboarding_intro_3">You can make everything done on your watches.</string>
<string name="onboarding_intro_1">Support 640+ express companies all over the world.</string>
<string name="onboarding_section_2">Input numbers by just one touch</string>
<string name="onboarding_intro_2">Scan the number and then, they are recognized.</string>
<string name="onboarding_section_3">Keep the delivery status updated</string>
<string name="onboarding_intro_3">Push notification when the delivery status is refreshed, so you can get the latest information.</string>
<string name="onboarding_finish_button_description_wait">Preparing, please wait…</string>
<!--onboarding end-->

Expand Down
File renamed without changes.
68 changes: 0 additions & 68 deletions mobile/src/main/res/xml/shortcuts.xml

This file was deleted.

2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include ':mobile', ':wear'
include ':app'

0 comments on commit 19177f5

Please sign in to comment.