├── app ├── .gitignore ├── src │ ├── main │ │ ├── appIcon-web.png │ │ ├── app_launcher-web.png │ │ ├── res │ │ │ ├── mipmap-hdpi │ │ │ │ └── app_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ │ └── app_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ │ └── app_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── app_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── app_launcher.png │ │ │ ├── values │ │ │ │ ├── colors.xml │ │ │ │ ├── strings.xml │ │ │ │ ├── dimens.xml │ │ │ │ └── styles.xml │ │ │ ├── values-v21 │ │ │ │ └── styles.xml │ │ │ ├── menu │ │ │ │ └── menu_main.xml │ │ │ ├── layout │ │ │ │ ├── fragment_setting_list.xml │ │ │ │ ├── fragment_itemlist_list.xml │ │ │ │ ├── fragment_itemlist_github_repo.xml │ │ │ │ ├── activity_feed_detail.xml │ │ │ │ ├── activity_main.xml │ │ │ │ └── content_feed_detail.xml │ │ │ └── values-w820dp │ │ │ │ └── dimens.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── mrpeak │ │ │ │ ├── trimdata │ │ │ │ ├── dal │ │ │ │ │ ├── DalBase.java │ │ │ │ │ ├── IDalBase.java │ │ │ │ │ ├── rawModel │ │ │ │ │ │ ├── RawModelBase.java │ │ │ │ │ │ └── GitHubRepository.java │ │ │ │ │ ├── DalModule.java │ │ │ │ │ ├── IGitHubRepoDal.java │ │ │ │ │ ├── EventSource.java │ │ │ │ │ ├── DalFactory.java │ │ │ │ │ └── imp │ │ │ │ │ │ └── GitHubRepoDalImp.java │ │ │ │ ├── service │ │ │ │ │ ├── ServiceBase.java │ │ │ │ │ ├── cache │ │ │ │ │ │ ├── FeedStreamServiceCache.java │ │ │ │ │ │ └── GitHubServiceCache.java │ │ │ │ │ ├── network │ │ │ │ │ │ ├── PPHttpRequestDelegate.java │ │ │ │ │ │ ├── github │ │ │ │ │ │ │ ├── GitHubRequestProvider.java │ │ │ │ │ │ │ ├── GitHubRepositoryListRequest.java │ │ │ │ │ │ │ └── GitHubRequest.java │ │ │ │ │ │ ├── retrofitModel │ │ │ │ │ │ │ └── RfRepository.java │ │ │ │ │ │ └── PPHttpRequest.java │ │ │ │ │ ├── IFeedStreamService.java │ │ │ │ │ ├── imp │ │ │ │ │ │ ├── FeedStreamServiceImp.java │ │ │ │ │ │ └── GitHubServiceImp.java │ │ │ │ │ ├── test │ │ │ │ │ │ ├── GitHubServiceTest.java │ │ │ │ │ │ └── FeedStreamServiceTest.java │ │ │ │ │ ├── IGitHubService.java │ │ │ │ │ ├── ServiceModule.java │ │ │ │ │ └── ServiceFactory.java │ │ │ │ ├── application │ │ │ │ │ ├── feed │ │ │ │ │ │ ├── feedDetail │ │ │ │ │ │ │ ├── IFeedDetailBO.java │ │ │ │ │ │ │ ├── FeedDetailBO.java │ │ │ │ │ │ │ ├── IFeedDetailDH.java │ │ │ │ │ │ │ ├── model │ │ │ │ │ │ │ │ ├── FeedDetail.java │ │ │ │ │ │ │ │ └── FeedDetailGitHubRepo.java │ │ │ │ │ │ │ ├── FeedDetailDH.java │ │ │ │ │ │ │ └── FeedDetailActivity.java │ │ │ │ │ │ └── feedStream │ │ │ │ │ │ │ ├── IFeedStreamBO.java │ │ │ │ │ │ │ ├── IFeedStreamDH.java │ │ │ │ │ │ │ ├── view │ │ │ │ │ │ │ ├── FeedItemVH.java │ │ │ │ │ │ │ └── FeedItemGitHubRepoVH.java │ │ │ │ │ │ │ ├── model │ │ │ │ │ │ │ ├── FeedItem.java │ │ │ │ │ │ │ └── FeedItemGitHubRepo.java │ │ │ │ │ │ │ ├── FeedStreamDH.java │ │ │ │ │ │ │ ├── FeedStreamFragment.java │ │ │ │ │ │ │ ├── FeedStreamAdapter.java │ │ │ │ │ │ │ └── FeedStreamBO.java │ │ │ │ │ ├── common │ │ │ │ │ │ ├── BaseDataHandler.java │ │ │ │ │ │ ├── BaseBusinessObject.java │ │ │ │ │ │ ├── BaseActivity.java │ │ │ │ │ │ ├── BaseViewHolder.java │ │ │ │ │ │ ├── BaseFragment.java │ │ │ │ │ │ ├── MyRoboFragment.java │ │ │ │ │ │ ├── MyRoboActivity.java │ │ │ │ │ │ ├── BaseRecyclerViewAdapter.java │ │ │ │ │ │ └── ItemListFragment.java │ │ │ │ │ ├── setting │ │ │ │ │ │ └── SettingListFragment.java │ │ │ │ │ └── MainTabActivity.java │ │ │ │ └── core │ │ │ │ │ └── TrimApplication.java │ │ │ │ └── ppkit │ │ │ │ └── android │ │ │ │ └── ObservableUtil.java │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── mrpeak │ │ │ └── trimdata │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── mrpeak │ │ └── trimdata │ │ └── ApplicationTest.java ├── build.gradle ├── proguard-rules.pro └── app.iml ├── settings.gradle ├── .idea ├── .name ├── copyright │ └── profiles_settings.xml ├── encodings.xml ├── vcs.xml ├── libraries │ ├── jsr305_1_3_9.xml │ ├── junit_4_12.xml │ ├── okio_1_6_0.xml │ ├── gson_2_6_2.xml │ ├── rxjava_1_1_1.xml │ ├── okhttp_3_2_0.xml │ ├── roboguice_3_0_1.xml │ ├── hamcrest_core_1_3.xml │ ├── support_annotations_23_2_0.xml │ ├── retrofit_2_0_0_beta4.xml │ ├── design_23_2_0.xml │ ├── rxandroid_1_1_0.xml │ ├── activeandroid_3_1_0_SNAPSHOT.xml │ ├── converter_gson_2_0_0_beta4.xml │ ├── appcompat_v7_23_2_0.xml │ ├── recyclerview_v7_23_2_0.xml │ ├── support_vector_drawable_23_2_0.xml │ ├── animated_vector_drawable_23_2_0.xml │ └── support_v4_23_2_0.xml ├── modules.xml ├── runConfigurations.xml ├── compiler.xml ├── gradle.xml └── misc.xml ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── gradle.properties ├── TrimData.iml ├── Data-Driven-Architecture-Android.iml ├── LICENSE ├── gradlew.bat ├── gradlew └── README.md /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' -------------------------------------------------------------------------------- /.idea/.name: -------------------------------------------------------------------------------- 1 | Data-Driven-Architecture-Android -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /app/src/main/appIcon-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/music4kid/Data-Driven-Architecture-Android/HEAD/app/src/main/appIcon-web.png -------------------------------------------------------------------------------- /app/src/main/app_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/music4kid/Data-Driven-Architecture-Android/HEAD/app/src/main/app_launcher-web.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/music4kid/Data-Driven-Architecture-Android/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/app_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/music4kid/Data-Driven-Architecture-Android/HEAD/app/src/main/res/mipmap-hdpi/app_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/app_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/music4kid/Data-Driven-Architecture-Android/HEAD/app/src/main/res/mipmap-mdpi/app_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/app_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/music4kid/Data-Driven-Architecture-Android/HEAD/app/src/main/res/mipmap-xhdpi/app_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/app_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/music4kid/Data-Driven-Architecture-Android/HEAD/app/src/main/res/mipmap-xxhdpi/app_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/app_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/music4kid/Data-Driven-Architecture-Android/HEAD/app/src/main/res/mipmap-xxxhdpi/app_launcher.png -------------------------------------------------------------------------------- /app/src/main/java/com/mrpeak/trimdata/dal/DalBase.java: -------------------------------------------------------------------------------- 1 | package com.mrpeak.trimdata.dal; 2 | 3 | /** 4 | * Created by gaofeng on 16/3/3. 5 | */ 6 | public class DalBase { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /app/src/main/java/com/mrpeak/trimdata/dal/IDalBase.java: -------------------------------------------------------------------------------- 1 | package com.mrpeak.trimdata.dal; 2 | 3 | /** 4 | * Created by gaofeng on 16/3/5. 5 | */ 6 | public interface IDalBase { 7 | } 8 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/java/com/mrpeak/trimdata/service/ServiceBase.java: -------------------------------------------------------------------------------- 1 | package com.mrpeak.trimdata.service; 2 | 3 | /** 4 | * Created by gaofeng on 16/3/3. 5 | */ 6 | public class ServiceBase { 7 | void clearCache(){} 8 | } 9 | -------------------------------------------------------------------------------- /app/src/main/java/com/mrpeak/trimdata/application/feed/feedDetail/IFeedDetailBO.java: -------------------------------------------------------------------------------- 1 | package com.mrpeak.trimdata.application.feed.feedDetail; 2 | 3 | /** 4 | * Created by gaofeng on 16/3/11. 5 | */ 6 | public interface IFeedDetailBO { 7 | } 8 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Oct 21 11:34:03 PDT 2015 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-2.10-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/java/com/mrpeak/trimdata/application/common/BaseDataHandler.java: -------------------------------------------------------------------------------- 1 | package com.mrpeak.trimdata.application.common; 2 | 3 | import android.content.Context; 4 | 5 | /** 6 | * Created by gaofeng on 16/3/2. 7 | */ 8 | public class BaseDataHandler { 9 | public Context mContext; 10 | } 11 | -------------------------------------------------------------------------------- /app/src/main/java/com/mrpeak/trimdata/application/feed/feedStream/IFeedStreamBO.java: -------------------------------------------------------------------------------- 1 | package com.mrpeak.trimdata.application.feed.feedStream; 2 | 3 | /** 4 | * Created by gaofeng on 16/3/2. 5 | */ 6 | public interface IFeedStreamBO { 7 | void loadFeedsFromServer(); 8 | void gotoFeedDetail(Long feedItemId); 9 | } 10 | -------------------------------------------------------------------------------- /app/src/main/java/com/mrpeak/trimdata/service/cache/FeedStreamServiceCache.java: -------------------------------------------------------------------------------- 1 | package com.mrpeak.trimdata.service.cache; 2 | 3 | import com.mrpeak.trimdata.service.imp.FeedStreamServiceImp; 4 | 5 | /** 6 | * Created by gaofeng on 16/3/2. 7 | */ 8 | public class FeedStreamServiceCache extends FeedStreamServiceImp { 9 | } 10 | -------------------------------------------------------------------------------- /app/src/main/java/com/mrpeak/trimdata/service/network/PPHttpRequestDelegate.java: -------------------------------------------------------------------------------- 1 | package com.mrpeak.trimdata.service.network; 2 | 3 | /** 4 | * Created by gaofeng on 16/3/3. 5 | */ 6 | public interface PPHttpRequestDelegate { 7 | void onRequestSuccess(PPHttpRequest req, int code); 8 | void onRequestFail(String msg); 9 | } 10 | -------------------------------------------------------------------------------- /app/src/main/java/com/mrpeak/trimdata/dal/rawModel/RawModelBase.java: -------------------------------------------------------------------------------- 1 | package com.mrpeak.trimdata.dal.rawModel; 2 | 3 | import com.activeandroid.Model; 4 | 5 | /** 6 | * Created by gaofeng on 16/3/6. 7 | */ 8 | public abstract class RawModelBase extends Model { 9 | public abstract void saveEntity(); 10 | 11 | public RawModelBase() { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /.idea/libraries/jsr305_1_3_9.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Trim 3 | Settings 4 | 5 | 6 | Hello blank fragment 7 | FeedDetailActivity 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/java/com/mrpeak/trimdata/application/common/BaseBusinessObject.java: -------------------------------------------------------------------------------- 1 | package com.mrpeak.trimdata.application.common; 2 | 3 | import android.content.Context; 4 | 5 | import rx.subscriptions.CompositeSubscription; 6 | 7 | /** 8 | * Created by gaofeng on 16/3/2. 9 | */ 10 | public class BaseBusinessObject { 11 | public Object dh; 12 | public Context mContext; 13 | 14 | 15 | } 16 | -------------------------------------------------------------------------------- /app/src/main/java/com/mrpeak/trimdata/service/IFeedStreamService.java: -------------------------------------------------------------------------------- 1 | package com.mrpeak.trimdata.service; 2 | 3 | import com.mrpeak.trimdata.dal.rawModel.GitHubRepository; 4 | import com.mrpeak.trimdata.service.network.PPHttpRequestDelegate; 5 | 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | 9 | /** 10 | * Created by gaofeng on 16/3/2. 11 | */ 12 | public interface IFeedStreamService { 13 | 14 | } 15 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8dp 4 | 5 | 16dp 6 | 16dp 7 | 16dp 8 | 9 | -------------------------------------------------------------------------------- /app/src/test/java/com/mrpeak/trimdata/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.mrpeak.trimdata; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * To work on unit tests, switch the Test Artifact in the Build Variants view. 9 | */ 10 | public class ExampleUnitTest { 11 | @Test 12 | public void addition_isCorrect() throws Exception { 13 | assertEquals(4, 2 + 2); 14 | } 15 | } -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/mrpeak/trimdata/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.mrpeak.trimdata; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_main.xml: -------------------------------------------------------------------------------- 1 | 5 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/java/com/mrpeak/trimdata/dal/DalModule.java: -------------------------------------------------------------------------------- 1 | package com.mrpeak.trimdata.dal; 2 | 3 | import com.google.inject.AbstractModule; 4 | import com.mrpeak.trimdata.dal.imp.GitHubRepoDalImp; 5 | 6 | /** 7 | * Created by gaofeng on 16/3/5. 8 | */ 9 | public class DalModule extends AbstractModule { 10 | @Override 11 | protected void configure() { 12 | bind(IGitHubRepoDal.class).to(GitHubRepoDalImp.class); 13 | } 14 | 15 | public DalModule() { 16 | 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /app/src/main/java/com/mrpeak/trimdata/dal/IGitHubRepoDal.java: -------------------------------------------------------------------------------- 1 | package com.mrpeak.trimdata.dal; 2 | 3 | import com.mrpeak.trimdata.dal.rawModel.GitHubRepository; 4 | 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | 8 | /** 9 | * Created by gaofeng on 16/3/5. 10 | */ 11 | public interface IGitHubRepoDal extends IDalBase { 12 | void insertOrUpdateGitHubRepo(GitHubRepository repo); 13 | GitHubRepository getRepoById(Long repoId); 14 | List loadAll(); 15 | } 16 | -------------------------------------------------------------------------------- /app/src/main/java/com/mrpeak/trimdata/application/feed/feedStream/IFeedStreamDH.java: -------------------------------------------------------------------------------- 1 | package com.mrpeak.trimdata.application.feed.feedStream; 2 | 3 | import com.mrpeak.trimdata.application.feed.feedStream.model.FeedItem; 4 | 5 | import java.util.ArrayList; 6 | 7 | /** 8 | * Created by gaofeng on 16/3/2. 9 | */ 10 | public interface IFeedStreamDH { 11 | ArrayList getmItems(); 12 | void setmItems(ArrayList items); 13 | void addItem(T item); 14 | } 15 | -------------------------------------------------------------------------------- /.idea/libraries/junit_4_12.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # Files for the Dalvik VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # Generated files 12 | bin/ 13 | gen/ 14 | 15 | # Gradle files 16 | .gradle/ 17 | build/ 18 | 19 | # Local configuration file (sdk path, etc) 20 | local.properties 21 | 22 | # Proguard folder generated by Eclipse 23 | proguard/ 24 | 25 | # Log Files 26 | *.log 27 | 28 | # Android Studio Navigation editor temp files 29 | .navigation/ 30 | 31 | # Android Studio captures folder 32 | captures/ 33 | -------------------------------------------------------------------------------- /.idea/libraries/okio_1_6_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/gson_2_6_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/rxjava_1_1_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/java/com/mrpeak/trimdata/application/common/BaseActivity.java: -------------------------------------------------------------------------------- 1 | package com.mrpeak.trimdata.application.common; 2 | 3 | import android.support.v7.app.AppCompatActivity; 4 | import android.os.Bundle; 5 | 6 | import roboguice.RoboGuice; 7 | import roboguice.activity.RoboActivity; 8 | 9 | public class BaseActivity extends RoboActivity { 10 | 11 | @Override 12 | protected void onCreate(Bundle savedInstanceState) { 13 | super.onCreate(savedInstanceState); 14 | 15 | RoboGuice.setUseAnnotationDatabases(false); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /app/src/main/java/com/mrpeak/trimdata/application/feed/feedDetail/FeedDetailBO.java: -------------------------------------------------------------------------------- 1 | package com.mrpeak.trimdata.application.feed.feedDetail; 2 | 3 | import android.content.Context; 4 | 5 | import com.google.inject.Inject; 6 | import com.mrpeak.trimdata.application.common.BaseBusinessObject; 7 | 8 | /** 9 | * Created by gaofeng on 16/3/11. 10 | */ 11 | public class FeedDetailBO extends BaseBusinessObject implements IFeedDetailBO { 12 | 13 | @Inject 14 | public FeedDetailBO(Context mContext) { 15 | this.mContext = mContext; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /.idea/libraries/okhttp_3_2_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/roboguice_3_0_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/hamcrest_core_1_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/java/com/mrpeak/trimdata/service/network/github/GitHubRequestProvider.java: -------------------------------------------------------------------------------- 1 | package com.mrpeak.trimdata.service.network.github; 2 | 3 | import com.mrpeak.trimdata.service.network.retrofitModel.RfRepository; 4 | 5 | import java.util.List; 6 | 7 | import retrofit2.Call; 8 | import retrofit2.http.GET; 9 | import retrofit2.http.Path; 10 | 11 | /** 12 | * Created by gaofeng on 16/3/4. 13 | */ 14 | public interface GitHubRequestProvider { 15 | @GET("users/{username}/repos?type=owner") 16 | Call> userReposList(@Path("username") String username); 17 | } 18 | -------------------------------------------------------------------------------- /.idea/libraries/support_annotations_23_2_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/java/com/mrpeak/trimdata/application/feed/feedStream/view/FeedItemVH.java: -------------------------------------------------------------------------------- 1 | package com.mrpeak.trimdata.application.feed.feedStream.view; 2 | 3 | import android.view.View; 4 | 5 | import com.mrpeak.trimdata.application.common.BaseViewHolder; 6 | import com.mrpeak.trimdata.application.feed.feedStream.model.*; 7 | 8 | /** 9 | * Created by gaofeng on 16/3/2. 10 | */ 11 | public class FeedItemVH extends BaseViewHolder { 12 | 13 | 14 | public FeedItemVH(View itemView) { 15 | super(itemView); 16 | } 17 | public void bindFeedItem(FeedItem item) { 18 | } 19 | 20 | } -------------------------------------------------------------------------------- /.idea/libraries/retrofit_2_0_0_beta4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_setting_list.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/design_23_2_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/rxandroid_1_1_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/java/com/mrpeak/trimdata/service/imp/FeedStreamServiceImp.java: -------------------------------------------------------------------------------- 1 | package com.mrpeak.trimdata.service.imp; 2 | 3 | import com.mrpeak.trimdata.dal.rawModel.GitHubRepository; 4 | import com.mrpeak.trimdata.service.IFeedStreamService; 5 | import com.mrpeak.trimdata.service.ServiceBase; 6 | import com.mrpeak.trimdata.service.network.PPHttpRequestDelegate; 7 | import com.mrpeak.trimdata.service.network.github.GitHubRepositoryListRequest; 8 | 9 | import java.util.ArrayList; 10 | 11 | /** 12 | * Created by gaofeng on 16/3/2. 13 | */ 14 | public class FeedStreamServiceImp extends ServiceBase implements IFeedStreamService { 15 | 16 | 17 | } 18 | -------------------------------------------------------------------------------- /.idea/libraries/activeandroid_3_1_0_SNAPSHOT.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/converter_gson_2_0_0_beta4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/java/com/mrpeak/trimdata/service/test/GitHubServiceTest.java: -------------------------------------------------------------------------------- 1 | package com.mrpeak.trimdata.service.test; 2 | 3 | import com.mrpeak.trimdata.dal.rawModel.GitHubRepository; 4 | import com.mrpeak.trimdata.service.cache.GitHubServiceCache; 5 | 6 | import java.util.ArrayList; 7 | 8 | /** 9 | * Created by gaofeng on 16/3/11. 10 | */ 11 | 12 | public class GitHubServiceTest extends GitHubServiceCache { 13 | @Override 14 | public ArrayList loadAllRepositories() { 15 | ArrayList repos = super.loadAllRepositories(); 16 | //run some tests here... 17 | return repos; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /.idea/libraries/appcompat_v7_23_2_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/java/com/mrpeak/trimdata/application/feed/feedDetail/IFeedDetailDH.java: -------------------------------------------------------------------------------- 1 | package com.mrpeak.trimdata.application.feed.feedDetail; 2 | 3 | import com.mrpeak.trimdata.application.feed.feedDetail.model.FeedDetailGitHubRepo; 4 | import com.mrpeak.trimdata.application.feed.feedStream.model.FeedItem; 5 | import com.mrpeak.trimdata.application.feed.feedStream.model.FeedItemGitHubRepo; 6 | import com.mrpeak.trimdata.dal.rawModel.GitHubRepository; 7 | 8 | /** 9 | * Created by gaofeng on 16/3/11. 10 | */ 11 | public interface IFeedDetailDH { 12 | void setFeedDetailItem(FeedDetailGitHubRepo repo); 13 | FeedDetailGitHubRepo getFeedDetailItem(); 14 | } 15 | -------------------------------------------------------------------------------- /app/src/main/java/com/mrpeak/trimdata/service/IGitHubService.java: -------------------------------------------------------------------------------- 1 | package com.mrpeak.trimdata.service; 2 | 3 | import com.mrpeak.trimdata.dal.rawModel.GitHubRepository; 4 | import com.mrpeak.trimdata.service.network.PPHttpRequestDelegate; 5 | 6 | import java.util.ArrayList; 7 | 8 | /** 9 | * Created by gaofeng on 16/3/4. 10 | */ 11 | public interface IGitHubService { 12 | public ArrayList loadAllRepositories(); 13 | public void loadAllRepositoriesFromServer(PPHttpRequestDelegate delegate); 14 | 15 | public GitHubRepository getRepositoryById(Long repoId); 16 | public void updateOrInsertRepository(GitHubRepository repo); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /.idea/libraries/recyclerview_v7_23_2_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 9 | 64dp 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/java/com/mrpeak/trimdata/service/test/FeedStreamServiceTest.java: -------------------------------------------------------------------------------- 1 | package com.mrpeak.trimdata.service.test; 2 | 3 | import com.mrpeak.trimdata.dal.EventSource; 4 | import com.mrpeak.trimdata.dal.rawModel.GitHubRepository; 5 | import com.mrpeak.trimdata.service.ServiceFactory; 6 | import com.mrpeak.trimdata.service.cache.FeedStreamServiceCache; 7 | import com.mrpeak.trimdata.service.network.PPHttpRequestDelegate; 8 | 9 | import java.util.ArrayList; 10 | import java.util.Collections; 11 | import java.util.List; 12 | import java.util.concurrent.TimeUnit; 13 | 14 | /** 15 | * Created by gaofeng on 16/3/2. 16 | */ 17 | public class FeedStreamServiceTest extends FeedStreamServiceCache { 18 | 19 | } 20 | -------------------------------------------------------------------------------- /.idea/libraries/support_vector_drawable_23_2_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/animated_vector_drawable_23_2_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/java/com/mrpeak/trimdata/application/feed/feedDetail/model/FeedDetail.java: -------------------------------------------------------------------------------- 1 | package com.mrpeak.trimdata.application.feed.feedDetail.model; 2 | 3 | /** 4 | * Created by gaofeng on 16/3/11. 5 | */ 6 | public class FeedDetail { 7 | public static final int FeedItemNormal = 0; 8 | public static final int FeedItemGitHubRepo = 1; 9 | public static final int FeedItemUnknown = 1000; 10 | 11 | private int itemType; 12 | private Long itemId; 13 | 14 | public FeedDetail(int itemType, Long itemId) { 15 | this.itemType = itemType; 16 | this.itemId = itemId; 17 | } 18 | 19 | public int getItemType() { 20 | return itemType; 21 | } 22 | 23 | public Long getItemId() { 24 | return itemId; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /.idea/libraries/support_v4_23_2_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/java/com/mrpeak/trimdata/service/ServiceModule.java: -------------------------------------------------------------------------------- 1 | package com.mrpeak.trimdata.service; 2 | 3 | import com.google.inject.AbstractModule; 4 | import com.mrpeak.trimdata.service.cache.GitHubServiceCache; 5 | import com.mrpeak.trimdata.service.imp.FeedStreamServiceImp; 6 | import com.mrpeak.trimdata.service.imp.GitHubServiceImp; 7 | import com.mrpeak.trimdata.service.test.FeedStreamServiceTest; 8 | 9 | /** 10 | * Created by gaofeng on 16/3/2. 11 | */ 12 | public class ServiceModule extends AbstractModule { 13 | 14 | @Override 15 | protected void configure() { 16 | bind(IFeedStreamService.class).to(FeedStreamServiceImp.class); 17 | bind(IGitHubService.class).to(GitHubServiceCache.class); 18 | } 19 | 20 | public ServiceModule() { 21 | 22 | } 23 | } 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 15 | 16 |