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

Commit

Permalink
bump up to as 3.0 canary
Browse files Browse the repository at this point in the history
  • Loading branch information
TonnyL committed May 20, 2017
1 parent d0a2768 commit 9a4fd4c
Show file tree
Hide file tree
Showing 17 changed files with 65 additions and 105 deletions.
45 changes: 10 additions & 35 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ apply plugin: 'com.android.application'
apply plugin: 'realm-android'

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
compileSdkVersion 'android-O'
buildToolsVersion '26.0.0 rc2'

defaultConfig {
applicationId "io.github.marktony.espresso"
minSdkVersion 21
targetSdkVersion 25
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand All @@ -31,35 +31,10 @@ android {
abortOnError false
}

productFlavors {
mock {
applicationIdSuffix = ".mock"
}
prod {

}
}

// Remove mockRelease as it's not needed.
android.variantFilter { variant ->
if (variant.buildType.name == 'release'
&& variant.getFlavors().get(0).name == 'mock') {
variant.setIgnore(true);
}
}

// Always show the result of every unit test, even if it passes.
testOptions.unitTests.all {
testLogging {
events 'passed', 'skipped', 'failed', 'standardOut', 'standardError'
}
}

sourceSets { prod { java.srcDirs = ['src/prod/java', 'src/prod/java/'] } }
}

ext {
supportLibVersion = '25.3.1'
supportLibVersion = '26.0.0-beta1'
rxjavaVersion = '2.0.1'
retrofitVersion = '2.2.0'
zxingLibVersion = '3.3.0'
Expand Down Expand Up @@ -92,15 +67,15 @@ dependencies {
// Zxing
compile "com.google.zxing:core:$zxingLibVersion"
// Material date time picker
compile "com.wdullaer:materialdatetimepicker:$datetimePickerVersion"
compile("com.wdullaer:materialdatetimepicker:$datetimePickerVersion"){
exclude group:'com.android.support'
}
// CircleImageView
compile "de.hdodenhof:circleimageview:$circleimageviewVersion"
compile("de.hdodenhof:circleimageview:$circleimageviewVersion"){
exclude group:'com.android.support'
}

testCompile "junit:junit:$junitVersion"
testCompile "org.mockito:mockito-all:$mockitoVersion"

// Mockito
androidTestCompile "org.mockito:mockito-core:$mockitoVersion"

// Espresso
androidTestCompile "com.android.support:support-annotations:$supportLibVersion"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

/**
* Created by lizhaotailang on 2017/5/12.
* The tests for {@link io.github.marktony.espresso.mvp.packages.PackagesFragment}.
*/

@RunWith(AndroidJUnit4.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

/**
* Created by lizhaotailang on 2017/5/14.
* The tests for {@link io.github.marktony.espresso.ui.SettingsFragment}.
*/

@RunWith(AndroidJUnit4.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,12 @@ public void initViews(View view) {
activity.setSupportActionBar((Toolbar) view.findViewById(R.id.toolbar));
activity.getSupportActionBar().setDisplayHomeAsUpEnabled(true);

editTextName = (TextInputEditText) view.findViewById(R.id.editTextName);
editTextNumber = (TextInputEditText) view.findViewById(R.id.editTextNumber);
textViewScanCode = (AppCompatTextView) view.findViewById(R.id.textViewScanCode);
fab = (FloatingActionButton) view.findViewById(R.id.fab);
progressBar = (ProgressBar) view.findViewById(R.id.progressBar);
scrollView = (NestedScrollView) view.findViewById(R.id.scrollView);
editTextName = view.findViewById(R.id.editTextName);
editTextNumber = view.findViewById(R.id.editTextNumber);
textViewScanCode = view.findViewById(R.id.textViewScanCode);
fab = view.findViewById(R.id.fab);
progressBar = view.findViewById(R.id.progressBar);
scrollView = view.findViewById(R.id.scrollView);

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public boolean onOptionsItemSelected(MenuItem item) {

@Override
public void initViews(View view) {
recyclerView = (RecyclerView) view.findViewById(R.id.recyclerViewCompaniesList);
recyclerView = view.findViewById(R.id.recyclerViewCompaniesList);
final LinearLayoutManager layoutManager = new LinearLayoutManager(getContext());
recyclerView.setLayoutManager(layoutManager);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,10 @@ public void initViews(View view) {
activity.setSupportActionBar((Toolbar) view.findViewById(R.id.toolbar));
activity.getSupportActionBar().setDisplayHomeAsUpEnabled(true);

fab = (FloatingActionButton) view.findViewById(R.id.fab);
textViewCompanyName = (AppCompatTextView) view.findViewById(R.id.textViewCompany);
textViewTel = (AppCompatTextView) view.findViewById(R.id.textViewCompanyPhoneNumber);
textViewWebsite = (AppCompatTextView) view.findViewById(R.id.textViewCompanyWebsite);
fab = view.findViewById(R.id.fab);
textViewCompanyName = view.findViewById(R.id.textViewCompany);
textViewTel = view.findViewById(R.id.textViewCompanyPhoneNumber);
textViewWebsite = view.findViewById(R.id.textViewCompanyWebsite);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,12 @@ public void initViews(View view) {
activity.setSupportActionBar((Toolbar) view.findViewById(R.id.toolbar));
activity.getSupportActionBar().setDisplayHomeAsUpEnabled(true);

recyclerView = (RecyclerView) view.findViewById(R.id.recyclerView);
recyclerView = view.findViewById(R.id.recyclerView);
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
fab = (FloatingActionButton) view.findViewById(R.id.fab);
swipeRefreshLayout = (SwipeRefreshLayout) view.findViewById(R.id.swipeRefreshLayout);
fab = view.findViewById(R.id.fab);
swipeRefreshLayout = view.findViewById(R.id.swipeRefreshLayout);
swipeRefreshLayout.setColorSchemeColors(ContextCompat.getColor(getContext(), R.color.colorPrimary));
toolbarLayout = (CollapsingToolbarLayout) view.findViewById(R.id.toolbar_layout);
toolbarLayout = view.findViewById(R.id.toolbar_layout);

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ public void onDrawerStateChanged(int newState) {

}

drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
drawer = findViewById(R.id.drawer_layout);
drawer.closeDrawer(GravityCompat.START);
return true;
}
Expand Down Expand Up @@ -261,10 +261,10 @@ protected void onSaveInstanceState(Bundle outState) {
*/
private void initViews() {

toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);

drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
drawer = findViewById(R.id.drawer_layout);
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
this, drawer, toolbar,
R.string.navigation_drawer_open,
Expand All @@ -273,7 +273,7 @@ private void initViews() {
drawer.setDrawerListener(toggle);
toggle.syncState();

navigationView = (NavigationView) findViewById(R.id.nav_view);
navigationView = findViewById(R.id.nav_view);
navigationView.setNavigationItemSelectedListener(this);

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,12 @@ public boolean onContextItemSelected(MenuItem item) {
@Override
public void initViews(View view) {

fab = (FloatingActionButton) view.findViewById(R.id.fab);
bottomNavigationView = (BottomNavigationView) view.findViewById(R.id.bottomNavigationView);
emptyView = (LinearLayout) view.findViewById(R.id.emptyView);
recyclerView = (RecyclerView) view.findViewById(R.id.recyclerView);
fab = view.findViewById(R.id.fab);
bottomNavigationView = view.findViewById(R.id.bottomNavigationView);
emptyView = view.findViewById(R.id.emptyView);
recyclerView = view.findViewById(R.id.recyclerView);
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
refreshLayout = (SwipeRefreshLayout) view.findViewById(R.id.refreshLayout);
refreshLayout = view.findViewById(R.id.refreshLayout);
refreshLayout.setColorSchemeColors(ContextCompat.getColor(getContext(), R.color.colorPrimary));

// ItemTouchHelper helps to handle the drag or swipe action.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ public void initViews(View view) {
activity.setSupportActionBar((Toolbar) view.findViewById(R.id.toolbar));
activity.getSupportActionBar().setDisplayHomeAsUpEnabled(true);

searchView = (SearchView) view.findViewById(R.id.searchView);
searchView = view.findViewById(R.id.searchView);
searchView.setIconified(false);
recyclerView = (RecyclerView) view.findViewById(R.id.recyclerView);
recyclerView = view.findViewById(R.id.recyclerView);
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public void onCreate(@Nullable Bundle savedInstanceState) {
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_licenses, container, false);

WebView webView = (WebView) view.findViewById(R.id.webView);
WebView webView = view.findViewById(R.id.webView);
webView.loadUrl("file:///android_asset/license.html");

return view;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ public class OnboardingActivity extends AppCompatActivity {

private static final int MSG_DATA_INSERT_FINISH = 1;

private Handler handler = new Handler(new HandlerCallback());

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand Down Expand Up @@ -138,16 +140,17 @@ public void onClick(View v) {

private void initViews() {
OnboardingPagerAdapter pagerAdapter = new OnboardingPagerAdapter(getSupportFragmentManager());
viewPager = (ViewPager) findViewById(R.id.view_pager);
viewPager = findViewById(R.id.view_pager);
viewPager.setAdapter(pagerAdapter);
buttonFinish = (AppCompatButton) findViewById(R.id.buttonFinish);
buttonFinish = findViewById(R.id.buttonFinish);
buttonFinish.setText(R.string.onboarding_finish_button_description_wait);
buttonFinish.setEnabled(false);
buttonNext = (ImageButton) findViewById(R.id.imageButtonNext);
buttonPre = (ImageButton) findViewById(R.id.imageButtonPre);
indicators = new ImageView[] {(ImageView) findViewById(R.id.imageViewIndicator0),
(ImageView) findViewById(R.id.imageViewIndicator1),
(ImageView) findViewById(R.id.imageViewIndicator2)};
buttonNext = findViewById(R.id.imageButtonNext);
buttonPre = findViewById(R.id.imageButtonPre);
indicators = new ImageView[] {
findViewById(R.id.imageViewIndicator0),
findViewById(R.id.imageViewIndicator1),
findViewById(R.id.imageViewIndicator2) };
}

private void initData() {
Expand All @@ -164,17 +167,20 @@ private void updateIndicators(int position) {
}
}

private Handler handler = new Handler() {
private class HandlerCallback implements Handler.Callback {

@Override
public void handleMessage(Message msg) {
switch (msg.what) {
public boolean handleMessage(Message message) {
switch (message.what) {
case MSG_DATA_INSERT_FINISH:

buttonFinish.setText(R.string.onboarding_finish_button_description);
buttonFinish.setEnabled(true);
break;
}
return true;
}
};
}

private class InitCompaniesDataTask extends AsyncTask<Void, Void, Void> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
}

private void initViews(View view) {
sectionLabel = (AppCompatTextView) view.findViewById(R.id.section_label);
sectionIntro = (AppCompatTextView) view.findViewById(R.id.section_intro);
sectionImg = (ImageView) view.findViewById(R.id.section_img);
sectionLabel = view.findViewById(R.id.section_label);
sectionIntro = view.findViewById(R.id.section_intro);
sectionImg = view.findViewById(R.id.section_img);
}

}
25 changes: 0 additions & 25 deletions app/src/prod/java/io/github/marktony/espresso/Injection.java

This file was deleted.

6 changes: 4 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

buildscript {
repositories {
maven { url 'https://maven.google.com' }
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.1'
classpath 'com.android.tools.build:gradle:3.0.0-alpha1'

// Realm database
classpath "io.realm:realm-gradle-plugin:3.0.0"
classpath "io.realm:realm-gradle-plugin:3.2.1"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand All @@ -17,6 +18,7 @@ buildscript {
allprojects {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
}
}

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m
org.gradle.jvmargs=-Xmx1000m

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-milestone-1-all.zip

0 comments on commit 9a4fd4c

Please sign in to comment.