showRating(String id) {
29 | return traktAPI.getShowRating(id);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/devcamp2018/app/src/main/java/com/psato/devcamp/di/FragmentScoped.java:
--------------------------------------------------------------------------------
1 | package com.psato.devcamp.di;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 |
7 | import javax.inject.Scope;
8 |
9 | /**
10 | * Created by athila on 31/05/16.
11 | */
12 |
13 | @Scope
14 | @Documented
15 | @Retention(RetentionPolicy.RUNTIME)
16 | public @interface FragmentScoped {
17 | }
18 |
--------------------------------------------------------------------------------
/devcamp2018/app/src/main/java/com/psato/devcamp/di/component/ApplicationComponent.java:
--------------------------------------------------------------------------------
1 | package com.psato.devcamp.di.component;
2 |
3 | import com.psato.devcamp.data.repository.resource.ResourceRepository;
4 | import com.psato.devcamp.data.repository.show.ShowRepository;
5 | import com.psato.devcamp.di.module.ApplicationModule;
6 | import com.psato.devcamp.di.module.NetworkModule;
7 | import com.psato.devcamp.di.module.ResourceRepositoryModule;
8 | import com.psato.devcamp.di.module.ShowRepositoryModule;
9 | import com.psato.devcamp.infrastructure.DevCampApplication;
10 | import com.psato.devcamp.infrastructure.ProjectViewModelFactory;
11 |
12 | import javax.inject.Singleton;
13 |
14 | import dagger.Component;
15 |
16 | /**
17 | * Created by psato on 29/10/16.
18 | */
19 |
20 | @Singleton
21 | @Component(modules = {
22 | ApplicationModule.class,
23 | NetworkModule.class,
24 | ShowRepositoryModule.class,
25 | ResourceRepositoryModule.class
26 | })
27 | public interface ApplicationComponent {
28 | // expose to sub graphs
29 |
30 | DevCampApplication application();
31 |
32 | ShowRepository showRepository();
33 |
34 | ResourceRepository resourceRepository();
35 |
36 | ProjectViewModelFactory viewModelFactory();
37 | }
38 |
--------------------------------------------------------------------------------
/devcamp2018/app/src/main/java/com/psato/devcamp/di/component/BaseFragmentComponent.java:
--------------------------------------------------------------------------------
1 | package com.psato.devcamp.di.component;
2 |
3 | import com.psato.devcamp.di.FragmentScoped;
4 | import com.psato.devcamp.presentation.base.BaseFragment;
5 |
6 | import dagger.Component;
7 |
8 |
9 | @FragmentScoped
10 | @Component(dependencies = {ApplicationComponent.class})
11 | public interface BaseFragmentComponent {
12 | void inject(BaseFragment baseFragment);
13 | }
14 |
--------------------------------------------------------------------------------
/devcamp2018/app/src/main/java/com/psato/devcamp/di/component/ViewModelSubComponent.java:
--------------------------------------------------------------------------------
1 | package com.psato.devcamp.di.component;
2 |
3 | import com.psato.devcamp.presentation.MVVM.QueryViewModelArc;
4 | import com.psato.devcamp.presentation.home.HomeFragmentViewModel;
5 |
6 | import dagger.Subcomponent;
7 |
8 | @Subcomponent
9 | public interface ViewModelSubComponent {
10 | @Subcomponent.Builder
11 | interface Builder {
12 | ViewModelSubComponent build();
13 | }
14 |
15 | HomeFragmentViewModel homeFragmentViewModel();
16 | QueryViewModelArc queryViewModelArc();
17 | }
18 |
--------------------------------------------------------------------------------
/devcamp2018/app/src/main/java/com/psato/devcamp/di/module/ApplicationModule.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (C) 2015 Fernando Cejas Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.psato.devcamp.di.module;
17 |
18 | import com.psato.devcamp.data.remote.APIConstants;
19 | import com.psato.devcamp.di.component.ViewModelSubComponent;
20 | import com.psato.devcamp.infrastructure.DevCampApplication;
21 | import com.psato.devcamp.infrastructure.ProjectViewModelFactory;
22 |
23 | import javax.inject.Singleton;
24 |
25 | import dagger.Module;
26 | import dagger.Provides;
27 | import okhttp3.OkHttpClient;
28 | import okhttp3.logging.HttpLoggingInterceptor;
29 | import retrofit2.Retrofit;
30 | import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
31 | import retrofit2.converter.gson.GsonConverterFactory;
32 |
33 | /**
34 | * Dagger module that provides objects which will live during the application lifecycle.
35 | */
36 | @Module(subcomponents = {ViewModelSubComponent.class})
37 | public class ApplicationModule {
38 | private final DevCampApplication application;
39 |
40 | public ApplicationModule(DevCampApplication application) {
41 | this.application = application;
42 | }
43 |
44 | @Provides
45 | @Singleton
46 | DevCampApplication provideApplication() {
47 | return application;
48 | }
49 |
50 | @Provides
51 | @Singleton
52 | Retrofit provideRetrofit() {
53 | HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
54 | interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
55 | OkHttpClient client = new OkHttpClient.Builder().addInterceptor(interceptor).build();
56 |
57 | return new Retrofit.Builder()
58 | .client(client)
59 | .addCallAdapterFactory(RxJava2CallAdapterFactory.create())
60 | .addConverterFactory(GsonConverterFactory.create())
61 | .baseUrl(APIConstants.BASE_URL)
62 | .build();
63 | }
64 |
65 | @Singleton
66 | @Provides
67 | ProjectViewModelFactory provideViewModelFactory(
68 | ViewModelSubComponent.Builder viewModelSubComponent) {
69 |
70 | return new ProjectViewModelFactory(viewModelSubComponent.build());
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/devcamp2018/app/src/main/java/com/psato/devcamp/di/module/NetworkModule.java:
--------------------------------------------------------------------------------
1 | package com.psato.devcamp.di.module;
2 |
3 | import com.psato.devcamp.data.remote.TraktAPI;
4 | import com.psato.devcamp.data.remote.TraktAPI;
5 |
6 | import javax.inject.Singleton;
7 |
8 | import dagger.Module;
9 | import dagger.Provides;
10 | import retrofit2.Retrofit;
11 |
12 | /**
13 | * Created by athila on 31/05/16.
14 | */
15 |
16 | @Module
17 | public class NetworkModule {
18 |
19 | @Provides
20 | @Singleton
21 | TraktAPI provideUserApi(Retrofit retrofit) {
22 | return retrofit.create(TraktAPI.class);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/devcamp2018/app/src/main/java/com/psato/devcamp/di/module/ResourceRepositoryModule.java:
--------------------------------------------------------------------------------
1 | package com.psato.devcamp.di.module;
2 |
3 | import com.psato.devcamp.data.repository.resource.ResourceRepository;
4 | import com.psato.devcamp.data.repository.resource.ResourceRepositoryImpl;
5 | import com.psato.devcamp.infrastructure.DevCampApplication;
6 |
7 | import dagger.Module;
8 | import dagger.Provides;
9 |
10 | @Module
11 | public class ResourceRepositoryModule {
12 |
13 | @Provides
14 | ResourceRepository provideResourceRepository(DevCampApplication application) {
15 | return new ResourceRepositoryImpl(application);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/devcamp2018/app/src/main/java/com/psato/devcamp/di/module/ShowRepositoryModule.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (C) 2015 Fernando Cejas Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.psato.devcamp.di.module;
17 |
18 | import com.psato.devcamp.data.remote.TraktAPI;
19 | import com.psato.devcamp.data.repository.show.ShowRepository;
20 | import com.psato.devcamp.data.repository.show.ShowRepositoryImpl;
21 |
22 | import dagger.Module;
23 | import dagger.Provides;
24 |
25 | @Module
26 | public class ShowRepositoryModule {
27 |
28 | @Provides
29 | ShowRepository provideUserRepository(TraktAPI traktAPI) {
30 | return new ShowRepositoryImpl(traktAPI);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/devcamp2018/app/src/main/java/com/psato/devcamp/infrastructure/Constants.java:
--------------------------------------------------------------------------------
1 | package com.psato.devcamp.infrastructure;
2 |
3 | /**
4 | * Created by psato on 29/10/16.
5 | */
6 |
7 | public class Constants {
8 |
9 | public static final class LoaderID{
10 | public static final int SHOW_LIST_ID = 1;
11 | public static final int HOME_ID = 2;
12 | public static final int MVP_ID = 3;
13 | public static final int MVVM_ID = 4;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/devcamp2018/app/src/main/java/com/psato/devcamp/infrastructure/DevCampApplication.java:
--------------------------------------------------------------------------------
1 | package com.psato.devcamp.infrastructure;
2 |
3 | import android.app.Application;
4 |
5 | import com.psato.devcamp.di.component.ApplicationComponent;
6 | import com.psato.devcamp.di.module.ApplicationModule;
7 | import com.psato.devcamp.di.component.DaggerApplicationComponent;
8 |
9 | /**
10 | * Created by psato on 29/10/16.
11 | */
12 |
13 | public class DevCampApplication extends Application {
14 | private ApplicationComponent applicationComponent;
15 |
16 | @Override
17 | public void onCreate() {
18 | super.onCreate();
19 | initializeInjector();
20 | }
21 |
22 | private void initializeInjector() {
23 | applicationComponent = DaggerApplicationComponent.builder()
24 | .applicationModule(new ApplicationModule(this))
25 | .build();
26 | }
27 |
28 | public ApplicationComponent getApplicationComponent() {
29 | return applicationComponent;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/devcamp2018/app/src/main/java/com/psato/devcamp/infrastructure/ProjectViewModelFactory.java:
--------------------------------------------------------------------------------
1 | package com.psato.devcamp.infrastructure;
2 |
3 | import android.arch.lifecycle.ViewModel;
4 | import android.arch.lifecycle.ViewModelProvider;
5 | import android.support.v4.util.ArrayMap;
6 |
7 | import com.psato.devcamp.di.component.ViewModelSubComponent;
8 | import com.psato.devcamp.presentation.MVVM.QueryViewModelArc;
9 | import com.psato.devcamp.presentation.home.HomeFragmentViewModel;
10 |
11 | import java.util.Map;
12 | import java.util.concurrent.Callable;
13 |
14 | import javax.inject.Inject;
15 | import javax.inject.Singleton;
16 |
17 | public class ProjectViewModelFactory implements ViewModelProvider.Factory {
18 | private final ArrayMap> creators;
19 |
20 | public ProjectViewModelFactory(ViewModelSubComponent viewModelSubComponent) {
21 | creators = new ArrayMap<>();
22 | creators.put(HomeFragmentViewModel.class, () -> viewModelSubComponent.homeFragmentViewModel());
23 | creators.put(QueryViewModelArc.class, () -> viewModelSubComponent.queryViewModelArc());
24 | }
25 |
26 | @Override
27 | public T create(Class modelClass) {
28 | Callable extends ViewModel> creator = creators.get(modelClass);
29 | if (creator == null) {
30 | for (Map.Entry> entry : creators.entrySet()) {
31 | if (modelClass.isAssignableFrom(entry.getKey())) {
32 | creator = entry.getValue();
33 | break;
34 | }
35 | }
36 | }
37 | if (creator == null) {
38 | throw new IllegalArgumentException("Unknown model class " + modelClass);
39 | }
40 | try {
41 | return (T) creator.call();
42 | } catch (Exception e) {
43 | throw new RuntimeException(e);
44 | }
45 | }
46 | }
--------------------------------------------------------------------------------
/devcamp2018/app/src/main/java/com/psato/devcamp/interactor/rx/RxSchedulers.java:
--------------------------------------------------------------------------------
1 | package com.psato.devcamp.interactor.rx;
2 |
3 | import io.reactivex.SingleTransformer;
4 | import io.reactivex.android.schedulers.AndroidSchedulers;
5 | import io.reactivex.schedulers.Schedulers;
6 |
7 |
8 | /**
9 | * Created by athila on 15/03/16.
10 | */
11 | public class RxSchedulers {
12 | /**
13 | * Execute the operation on a new thread (from thread pool) and listen on the main thread.
14 | * It can be used for I/O operations
15 | *
16 | * @return the transformer properly configured
17 | */
18 | public static SingleTransformer applyDefaultSchedulers() {
19 | return upstream -> upstream.subscribeOn(Schedulers.io())
20 | .observeOn(AndroidSchedulers.mainThread());
21 | }
22 |
23 | /**
24 | * Execute and listen the operation on the current thread. It can be used for scenarios where the
25 | * parallelism is already provided (operations executed by IntentService, for example)
26 | *
27 | * @return the transformer properly configured
28 | */
29 | public static SingleTransformer applyImmediateSchedulers() {
30 | return upstream -> upstream.subscribeOn(Schedulers.trampoline())
31 | .observeOn(Schedulers.trampoline());
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/devcamp2018/app/src/main/java/com/psato/devcamp/interactor/usecase/UseCase.java:
--------------------------------------------------------------------------------
1 | package com.psato.devcamp.interactor.usecase;
2 |
3 | import android.support.annotation.NonNull;
4 |
5 | import com.psato.devcamp.interactor.rx.RxSchedulers;
6 |
7 | import io.reactivex.Single;
8 | import io.reactivex.SingleTransformer;
9 | import io.reactivex.disposables.Disposable;
10 | import io.reactivex.disposables.Disposables;
11 | import io.reactivex.functions.Consumer;
12 |
13 | public abstract class UseCase {
14 |
15 | private Disposable subscription = Disposables.empty();
16 |
17 |
18 | protected abstract Single buildUseCaseObservable();
19 |
20 |
21 | @SuppressWarnings("unchecked")
22 | public void execute(@NonNull Consumer onSuccess, @NonNull Consumer super Throwable> onError) {
23 | execute(onSuccess, onError, RxSchedulers.applyDefaultSchedulers());
24 | }
25 |
26 |
27 | @SuppressWarnings("unchecked")
28 | public void execute(@NonNull Consumer onSuccess, @NonNull Consumer super Throwable> onError, SingleTransformer transformer) {
29 | // Need to use the calling chain. It does not work if we break the chain like:
30 | if (transformer != null) {
31 | subscription = buildUseCaseObservable()
32 | .compose(transformer)
33 | .subscribe(onSuccess, onError);
34 | } else {
35 | subscription = buildUseCaseObservable()
36 | .subscribe(onSuccess, onError);
37 | }
38 | }
39 |
40 | /**
41 | * Unsubscribes from current {@link rx.Subscription}.
42 | */
43 | public void unsubscribe() {
44 | if (subscription != null && !subscription.isDisposed()) {
45 | subscription.dispose();
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/devcamp2018/app/src/main/java/com/psato/devcamp/interactor/usecase/show/SearchShows.kt:
--------------------------------------------------------------------------------
1 | package com.psato.devcamp.interactor.usecase.show
2 |
3 | import com.psato.devcamp.data.entity.ShowInfo
4 | import com.psato.devcamp.data.entity.ShowResponse
5 | import com.psato.devcamp.data.repository.show.ShowRepository
6 | import com.psato.devcamp.interactor.usecase.UseCase
7 | import io.reactivex.Flowable
8 | import io.reactivex.Single
9 | import io.reactivex.schedulers.Schedulers
10 | import javax.inject.Inject
11 |
12 | /**
13 | * Created by psato on 29/10/16.
14 | */
15 |
16 | class SearchShows @Inject
17 | constructor(private val showRepository: ShowRepository) : UseCase() {
18 | var query: String? = null
19 |
20 | override fun buildUseCaseObservable(): Single> {
21 | return showRepository.searchShow(query).flatMapPublisher { Flowable.fromIterable(it) }
22 | .flatMapSingle({ showInfo: ShowInfo ->
23 | showRepository.showRating(showInfo.show.ids.trakt)
24 | .subscribeOn(Schedulers.io())
25 | .map { rating ->
26 | ShowResponse(showInfo.show.title, rating
27 | .rating)
28 | }
29 | }, false, 4).toList()
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/devcamp2018/app/src/main/java/com/psato/devcamp/presentation/MVVM/QueryActivity.java:
--------------------------------------------------------------------------------
1 | package com.psato.devcamp.presentation.MVVM;
2 |
3 | import android.databinding.DataBindingUtil;
4 | import android.os.Bundle;
5 | import android.support.v7.app.AppCompatActivity;
6 |
7 | import com.psato.devcamp.R;
8 |
9 | public class QueryActivity extends AppCompatActivity {
10 | @Override
11 | protected void onCreate(Bundle savedInstanceState) {
12 | super.onCreate(savedInstanceState);
13 | DataBindingUtil.setContentView(this, R.layout.activity_list);
14 | if (savedInstanceState == null) {
15 | getSupportFragmentManager()
16 | .beginTransaction()
17 | .add(R.id.fragment_content, new com.psato.devcamp.presentation.MVVM.QueryFragment())
18 | .commit();
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/devcamp2018/app/src/main/java/com/psato/devcamp/presentation/MVVM/QueryFragment.java:
--------------------------------------------------------------------------------
1 | package com.psato.devcamp.presentation.MVVM;
2 |
3 | import android.arch.lifecycle.ViewModelProviders;
4 | import android.databinding.DataBindingUtil;
5 | import android.os.Bundle;
6 | import android.support.annotation.NonNull;
7 | import android.support.annotation.Nullable;
8 | import android.view.LayoutInflater;
9 | import android.view.View;
10 | import android.view.ViewGroup;
11 |
12 | import com.psato.devcamp.R;
13 | import com.psato.devcamp.databinding.FragmentQueryMvvmBinding;
14 | import com.psato.devcamp.presentation.base.BaseFragment;
15 |
16 | public class QueryFragment extends BaseFragment {
17 | private FragmentQueryMvvmBinding binding;
18 |
19 | @Nullable
20 | @Override
21 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
22 | View view = inflater.inflate(R.layout.fragment_query_mvvm, container, false);
23 | binding = DataBindingUtil.bind(view);
24 | return view;
25 | }
26 |
27 | @Override
28 | public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
29 | super.onViewCreated(view, savedInstanceState);
30 | QueryViewModelArc queryViewModelArc =
31 | ViewModelProviders.of(this, getViewModelFactory()).get(QueryViewModelArc.class);
32 | binding.setViewModel(queryViewModelArc);
33 | binding.setLifecycleOwner(this);
34 | binding.executePendingBindings();
35 | }
36 |
37 | @Override
38 | public void onDestroyView() {
39 | binding = null;
40 | super.onDestroyView();
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/devcamp2018/app/src/main/java/com/psato/devcamp/presentation/MVVM/QueryViewModelArc.java:
--------------------------------------------------------------------------------
1 | package com.psato.devcamp.presentation.MVVM;
2 |
3 | import android.arch.lifecycle.MutableLiveData;
4 | import android.arch.lifecycle.Observer;
5 | import android.arch.lifecycle.ViewModel;
6 | import android.text.TextUtils;
7 | import android.util.Log;
8 | import android.view.View;
9 |
10 | import com.psato.devcamp.data.entity.ShowResponse;
11 | import com.psato.devcamp.interactor.usecase.show.SearchShows;
12 |
13 | import java.util.Date;
14 | import java.util.List;
15 |
16 | import javax.inject.Inject;
17 |
18 | import io.reactivex.functions.Consumer;
19 |
20 | public class QueryViewModelArc extends ViewModel {
21 |
22 | private MutableLiveData result = new MutableLiveData<>();
23 |
24 | private MutableLiveData query = new MutableLiveData<>();
25 |
26 | private MutableLiveData showLoading = new MutableLiveData<>();
27 |
28 | private MutableLiveData searchEnabled = new MutableLiveData<>();
29 |
30 | private Observer queryObserver;
31 |
32 | private SearchShows searchShows;
33 |
34 | @Inject
35 | public QueryViewModelArc(SearchShows searchShows) {
36 | this.searchShows = searchShows;
37 | showLoading.setValue(false);
38 | searchEnabled.setValue(false);
39 | result.setValue("");
40 | query.setValue("");
41 | queryObserver = query -> searchEnabled.setValue(!TextUtils.isEmpty(query));
42 | query.observeForever(queryObserver);
43 | }
44 |
45 | @Override
46 | protected void onCleared() {
47 | super.onCleared();
48 | query.removeObserver(queryObserver);
49 | }
50 |
51 | public void onQueryClick(View view) {
52 | searchShow(query.getValue());
53 | }
54 |
55 | private void searchShow(String value) {
56 | if (searchShows != null) {
57 | showLoading.setValue(true);
58 | searchShows.unsubscribe();
59 | searchShows.setQuery(value);
60 | Date start = new Date();
61 | searchShows.execute((Consumer>) title -> {
62 | Date end = new Date();
63 | Log.e("SATO", "SATO - Time: " + (end.getTime() - start.getTime())/1000 + "s");
64 | showLoading.setValue(false);
65 | result.setValue(title.get(0).getName());
66 | }, throwable -> showLoading.setValue(false));
67 | }
68 | }
69 |
70 | public MutableLiveData getSearchEnabled() {
71 | return searchEnabled;
72 | }
73 |
74 | public MutableLiveData getShowLoading() {
75 | return showLoading;
76 | }
77 |
78 | public MutableLiveData getQuery() {
79 | return query;
80 | }
81 |
82 | public MutableLiveData getResult() {
83 | return result;
84 | }
85 |
86 | }
87 |
--------------------------------------------------------------------------------
/devcamp2018/app/src/main/java/com/psato/devcamp/presentation/base/BaseFragment.java:
--------------------------------------------------------------------------------
1 | package com.psato.devcamp.presentation.base;
2 |
3 | import android.os.Bundle;
4 | import android.support.annotation.NonNull;
5 | import android.support.annotation.Nullable;
6 | import android.support.v4.app.Fragment;
7 | import android.view.View;
8 |
9 | import com.psato.devcamp.di.component.DaggerBaseFragmentComponent;
10 | import com.psato.devcamp.infrastructure.DevCampApplication;
11 | import com.psato.devcamp.infrastructure.ProjectViewModelFactory;
12 |
13 | import javax.inject.Inject;
14 |
15 | /**
16 | * Created by psato on 29/10/16.
17 | */
18 |
19 | public abstract class BaseFragment extends Fragment {
20 |
21 | @Inject
22 | ProjectViewModelFactory viewModelFactory;
23 |
24 | @Override
25 | public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
26 | super.onViewCreated(view, savedInstanceState);
27 | DevCampApplication app = (DevCampApplication) getActivity().getApplication();
28 | DaggerBaseFragmentComponent.builder().applicationComponent(app.getApplicationComponent())
29 | .build().inject(this);
30 | }
31 |
32 | protected ProjectViewModelFactory getViewModelFactory(){
33 | return viewModelFactory;
34 | }
35 |
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/devcamp2018/app/src/main/java/com/psato/devcamp/presentation/bindadapter/EditTextBindingAdapter.java:
--------------------------------------------------------------------------------
1 | package com.psato.devcamp.presentation.bindadapter;
2 |
3 | import android.databinding.BindingAdapter;
4 | import android.view.inputmethod.EditorInfo;
5 | import android.widget.EditText;
6 |
7 | /**
8 | * Created by psato on 31/10/16.
9 | */
10 |
11 | public class EditTextBindingAdapter {
12 |
13 | @BindingAdapter("extractUI")
14 | public static void setExtractUi(EditText editText, boolean extractUi){
15 | if(!extractUi){
16 | int options = editText.getImeOptions();
17 | editText.setImeOptions(options| EditorInfo.IME_FLAG_NO_EXTRACT_UI);
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/devcamp2018/app/src/main/java/com/psato/devcamp/presentation/bindadapter/ViewBinderAdapter.java:
--------------------------------------------------------------------------------
1 | package com.psato.devcamp.presentation.bindadapter;
2 |
3 | import android.databinding.BindingAdapter;
4 | import android.view.View;
5 |
6 | public class ViewBinderAdapter {
7 |
8 | @BindingAdapter("android:visibility")
9 | public static void setVisibility(View view, Boolean visibility){
10 | if(visibility){
11 | view.setVisibility(View.VISIBLE);
12 | }else{
13 | view.setVisibility(View.GONE);
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/devcamp2018/app/src/main/java/com/psato/devcamp/presentation/home/HomeActivity.java:
--------------------------------------------------------------------------------
1 | package com.psato.devcamp.presentation.home;
2 |
3 | import android.databinding.DataBindingUtil;
4 | import android.os.Bundle;
5 | import android.support.v7.app.AppCompatActivity;
6 |
7 | import com.psato.devcamp.R;
8 |
9 | public class HomeActivity extends AppCompatActivity {
10 | @Override
11 | protected void onCreate(Bundle savedInstanceState) {
12 | super.onCreate(savedInstanceState);
13 | DataBindingUtil.setContentView(this, R.layout.activity_list);
14 | if (savedInstanceState == null) {
15 | getSupportFragmentManager()
16 | .beginTransaction()
17 | .add(R.id.fragment_content, new HomeFragment())
18 | .commit();
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/devcamp2018/app/src/main/java/com/psato/devcamp/presentation/home/HomeFragment.java:
--------------------------------------------------------------------------------
1 | package com.psato.devcamp.presentation.home;
2 |
3 | import android.arch.lifecycle.ViewModelProviders;
4 | import android.databinding.DataBindingUtil;
5 | import android.os.Bundle;
6 | import android.support.annotation.NonNull;
7 | import android.support.annotation.Nullable;
8 | import android.view.LayoutInflater;
9 | import android.view.View;
10 | import android.view.ViewGroup;
11 |
12 | import com.psato.devcamp.R;
13 | import com.psato.devcamp.databinding.FragmentHomeBinding;
14 | import com.psato.devcamp.presentation.base.BaseFragment;
15 |
16 | public class HomeFragment extends BaseFragment {
17 | private FragmentHomeBinding binding;
18 |
19 | @Nullable
20 | @Override
21 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
22 | View view = inflater.inflate(R.layout.fragment_home, container, false);
23 | binding = DataBindingUtil.bind(view);
24 | return view;
25 | }
26 |
27 | @Override
28 | public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
29 | super.onViewCreated(view, savedInstanceState);
30 | HomeFragmentViewModel homeFragmentViewModel =
31 | ViewModelProviders.of(this,getViewModelFactory()).get(HomeFragmentViewModel.class);
32 | binding.setViewModel(homeFragmentViewModel);
33 | binding.setLifecycleOwner(this);
34 | binding.executePendingBindings();
35 | }
36 |
37 | @Override
38 | public void onDestroyView() {
39 | binding = null;
40 | super.onDestroyView();
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/devcamp2018/app/src/main/java/com/psato/devcamp/presentation/home/HomeFragmentViewModel.java:
--------------------------------------------------------------------------------
1 | package com.psato.devcamp.presentation.home;
2 |
3 | import android.arch.lifecycle.ViewModel;
4 | import android.content.Intent;
5 | import android.view.View;
6 |
7 | import javax.inject.Inject;
8 |
9 | public class HomeFragmentViewModel extends ViewModel {
10 |
11 | @Inject
12 | public HomeFragmentViewModel() {
13 | }
14 |
15 | public void onMVVMClicked(View view) {
16 | view.getContext().startActivity(new Intent(view.getContext(), com.psato.devcamp.presentation.MVVM.QueryActivity.class));
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/devcamp2018/app/src/main/res/drawable/ic_search_grey_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/devcamp2018/app/src/main/res/layout/activity_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
--------------------------------------------------------------------------------
/devcamp2018/app/src/main/res/layout/fragment_home.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
13 |
14 |
15 |
18 |
19 |
28 |
29 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/devcamp2018/app/src/main/res/layout/fragment_query_mvp.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
9 |
10 |
15 |
16 |
25 |
26 |
34 |
35 |
36 |
43 |
44 |
45 |
46 |
53 |
54 |
55 |
56 |
57 |
66 |
67 |
74 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/devcamp2018/app/src/main/res/layout/fragment_query_mvvm.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
13 |
14 |
17 |
18 |
23 |
24 |
33 |
34 |
42 |
43 |
44 |
52 |
53 |
54 |
55 |
64 |
65 |
66 |
67 |
68 |
78 |
79 |
86 |
91 |
92 |
93 |
--------------------------------------------------------------------------------
/devcamp2018/app/src/main/res/mipmap-hdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/paulocns/coroutinesTests/b893e1b2e200c154721e55c276030a31b472954e/devcamp2018/app/src/main/res/mipmap-hdpi/logo.png
--------------------------------------------------------------------------------
/devcamp2018/app/src/main/res/mipmap-mdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/paulocns/coroutinesTests/b893e1b2e200c154721e55c276030a31b472954e/devcamp2018/app/src/main/res/mipmap-mdpi/logo.png
--------------------------------------------------------------------------------
/devcamp2018/app/src/main/res/mipmap-xhdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/paulocns/coroutinesTests/b893e1b2e200c154721e55c276030a31b472954e/devcamp2018/app/src/main/res/mipmap-xhdpi/logo.png
--------------------------------------------------------------------------------
/devcamp2018/app/src/main/res/mipmap-xxhdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/paulocns/coroutinesTests/b893e1b2e200c154721e55c276030a31b472954e/devcamp2018/app/src/main/res/mipmap-xxhdpi/logo.png
--------------------------------------------------------------------------------
/devcamp2018/app/src/main/res/mipmap-xxxhdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/paulocns/coroutinesTests/b893e1b2e200c154721e55c276030a31b472954e/devcamp2018/app/src/main/res/mipmap-xxxhdpi/logo.png
--------------------------------------------------------------------------------
/devcamp2018/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/devcamp2018/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #303F9F
6 |
7 |
--------------------------------------------------------------------------------
/devcamp2018/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/devcamp2018/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | DevCamp
3 | MVP
4 | MVVM
5 | search
6 | show name
7 | unable to find show
8 |
9 |
--------------------------------------------------------------------------------
/devcamp2018/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/devcamp2018/app/src/test/java/com/psato/devcamp/presentation/showlist/ShowListViewModelTest.java:
--------------------------------------------------------------------------------
1 | package com.psato.devfest.presentation.showlist;
2 |
3 | import com.psato.devcamp.data.entity.ShowInfo;
4 | import com.psato.devcamp.interactor.usecase.show.SearchShows;
5 | import com.psato.devcamp.presentation.showlist.ShowListViewModel;
6 |
7 | import org.junit.Before;
8 | import org.junit.Test;
9 | import org.mockito.ArgumentCaptor;
10 | import org.mockito.Mock;
11 | import org.mockito.Mockito;
12 | import org.mockito.MockitoAnnotations;
13 |
14 | import java.util.ArrayList;
15 |
16 | import rx.Subscriber;
17 |
18 | import static org.junit.Assert.assertFalse;
19 | import static org.junit.Assert.assertTrue;
20 |
21 | /**
22 | * Created by psato on 30/10/16.
23 | */
24 | public class ShowListViewModelTest {
25 |
26 | private ShowListViewModel mViewModel;
27 | @Mock
28 | private SearchShows mSearchShows;
29 |
30 | @Before
31 | public void setUp() {
32 | MockitoAnnotations.initMocks(this);
33 | mViewModel = new ShowListViewModel(mSearchShows);
34 | }
35 |
36 | @Test
37 | public void testSearch() {
38 | mViewModel.setQuery("big");
39 | assertTrue(mViewModel.getShowList().isEmpty());
40 | mViewModel.onSearchClicked();
41 | assertTrue(mViewModel.getShowLoading());
42 | ArgumentCaptor captor = ArgumentCaptor.forClass(Subscriber.class);
43 | Mockito.verify(mSearchShows).setQuery("big");
44 | Mockito.verify(mSearchShows).execute(captor.capture());
45 | Subscriber subscriber = captor.getValue();
46 | ArrayList list = new ArrayList<>();
47 | list.add(Mockito.mock(ShowInfo.class));
48 | subscriber.onNext(list);
49 | assertFalse(mViewModel.getShowLoading());
50 | assertFalse(mViewModel.getShowList().isEmpty());
51 | }
52 | }
--------------------------------------------------------------------------------
/devcamp2018/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | ext.kotlin_version = '1.2.51'
5 |
6 | repositories {
7 | google()
8 | jcenter()
9 | }
10 | dependencies {
11 | classpath 'com.android.tools.build:gradle:3.1.3'
12 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
13 |
14 | // NOTE: Do not place your application dependencies here; they belong
15 | // in the individual module build.gradle files
16 | }
17 | }
18 |
19 | allprojects {
20 | repositories {
21 | google()
22 | jcenter()
23 | }
24 | }
25 |
26 | task clean(type: Delete) {
27 | delete rootProject.buildDir
28 | }
--------------------------------------------------------------------------------
/devcamp2018/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | org.gradle.jvmargs=-Xmx1536m
13 |
14 | # When configured, Gradle will run in incubating parallel mode.
15 | # This option should only be used with decoupled projects. More details, visit
16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17 | # org.gradle.parallel=true
18 |
--------------------------------------------------------------------------------
/devcamp2018/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/paulocns/coroutinesTests/b893e1b2e200c154721e55c276030a31b472954e/devcamp2018/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/devcamp2018/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Jul 13 14:43:25 BRT 2018
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
7 |
--------------------------------------------------------------------------------
/devcamp2018/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/devcamp2018/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/devcamp2018/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------