├── .gitignore ├── .travis.yml ├── Application ├── .gitignore ├── build.gradle ├── google-services.json ├── proguard-rules.pro ├── proxy.jks └── src │ └── main │ ├── AndroidManifest.xml │ ├── aidl │ └── com │ │ └── shareyourproxy │ │ ├── INotificationService.aidl │ │ └── api │ │ └── rx │ │ └── RxBusDriver.aidl │ ├── java │ └── com │ │ └── shareyourproxy │ │ ├── Constants.java │ │ ├── IntentLauncher.java │ │ ├── Intents.java │ │ ├── ProxyApplication.java │ │ ├── api │ │ ├── CommandIntentService.java │ │ ├── FirebaseAuthenticator.java │ │ ├── FirebaseInterceptor.java │ │ ├── NotificationService.java │ │ ├── RestClient.java │ │ ├── RxAppDataManager.java │ │ ├── TwitterRestClient.java │ │ ├── domain │ │ │ ├── factory │ │ │ │ ├── AutoValueClass.java │ │ │ │ ├── AutoValueTypeAdapterFactory.java │ │ │ │ ├── ChannelFactory.java │ │ │ │ ├── ContactFactory.java │ │ │ │ ├── CustomTypeAdapterFactory.java │ │ │ │ ├── GroupFactory.java │ │ │ │ ├── RealmChannelFactory.java │ │ │ │ ├── RealmContactFactory.java │ │ │ │ ├── RealmGroupFactory.java │ │ │ │ ├── RealmUserFactory.java │ │ │ │ ├── UserFactory.java │ │ │ │ └── UserTypeAdapterFactory.java │ │ │ ├── model │ │ │ │ ├── ActivityFeedItem.java │ │ │ │ ├── Channel.java │ │ │ │ ├── ChannelToggle.java │ │ │ │ ├── ChannelType.java │ │ │ │ ├── Contact.java │ │ │ │ ├── Group.java │ │ │ │ ├── GroupToggle.java │ │ │ │ ├── InstagramAuthResponse.java │ │ │ │ ├── InstagramUser.java │ │ │ │ ├── Message.java │ │ │ │ ├── SharedLink.java │ │ │ │ ├── SpotifyAuthResponse.java │ │ │ │ ├── SpotifyUser.java │ │ │ │ └── User.java │ │ │ └── realm │ │ │ │ ├── RealmChannel.java │ │ │ │ ├── RealmChannelType.java │ │ │ │ ├── RealmContact.java │ │ │ │ ├── RealmGroup.java │ │ │ │ ├── RealmString.java │ │ │ │ └── RealmUser.java │ │ ├── rx │ │ │ ├── JustObserver.java │ │ │ ├── JustSingle.java │ │ │ ├── command │ │ │ │ ├── AddGroupChannelAndPublicCommand.java │ │ │ │ ├── AddGroupsChannelCommand.java │ │ │ │ ├── AddUserChannelCommand.java │ │ │ │ ├── AddUserCommand.java │ │ │ │ ├── AddUserGroupCommand.java │ │ │ │ ├── AddUserMessageCommand.java │ │ │ │ ├── BaseCommand.java │ │ │ │ ├── DeleteUserChannelCommand.java │ │ │ │ ├── DeleteUserGroupCommand.java │ │ │ │ ├── ExecuteCommand.java │ │ │ │ ├── GenerateShareLinkCommand.java │ │ │ │ ├── GetUserMessagesCommand.java │ │ │ │ ├── SaveGroupChannelsCommand.java │ │ │ │ ├── SaveGroupContactsCommand.java │ │ │ │ ├── SavePublicGroupChannelsCommand.java │ │ │ │ ├── SyncContactsCommand.java │ │ │ │ ├── UpdateUserContactsCommand.java │ │ │ │ └── eventcallback │ │ │ │ │ ├── ActivityFeedDownloadedEvent.java │ │ │ │ │ ├── EventCallback.java │ │ │ │ │ ├── GroupChannelsUpdatedEventCallback.java │ │ │ │ │ ├── GroupContactsUpdatedEventCallback.java │ │ │ │ │ ├── LoggedInUserUpdatedEventCallback.java │ │ │ │ │ ├── PublicChannelsUpdatedEvent.java │ │ │ │ │ ├── UserChannelAddedEventCallback.java │ │ │ │ │ ├── UserChannelDeletedEventCallback.java │ │ │ │ │ ├── UserContactAddedEventCallback.java │ │ │ │ │ ├── UserContactDeletedEventCallback.java │ │ │ │ │ ├── UserEventCallback.java │ │ │ │ │ ├── UserGroupAddedEventCallback.java │ │ │ │ │ ├── UserGroupDeletedEventCallback.java │ │ │ │ │ ├── UserMessageAddedEventCallback.java │ │ │ │ │ ├── UserMessagesDownloadedEventCallback.java │ │ │ │ │ └── UsersDownloadedEventCallback.java │ │ │ └── event │ │ │ │ ├── AddChannelDialogSuccess.java │ │ │ │ ├── ChannelAddedEvent.java │ │ │ │ ├── NotificationCardActionEvent.java │ │ │ │ ├── NotificationCardDismissEvent.java │ │ │ │ ├── OnBackPressedEvent.java │ │ │ │ ├── RecyclerViewDatasetChangedEvent.java │ │ │ │ ├── RefreshFirebaseAuthenticationEvent.java │ │ │ │ ├── SearchClickedEvent.java │ │ │ │ ├── SelectDrawerItemEvent.java │ │ │ │ ├── SelectUserChannelEvent.java │ │ │ │ ├── ShareLinkEventCallback.java │ │ │ │ ├── SyncAllContactsErrorEvent.java │ │ │ │ ├── SyncAllContactsSuccessEvent.java │ │ │ │ ├── TextViewEditorActionEvent.java │ │ │ │ ├── UserSelectedEvent.java │ │ │ │ └── ViewGroupContactsEvent.java │ │ └── service │ │ │ ├── GroupChannelService.java │ │ │ ├── GroupContactService.java │ │ │ ├── HerokuUserService.java │ │ │ ├── InstagramAuthService.java │ │ │ ├── InstagramUserService.java │ │ │ ├── MessageService.java │ │ │ ├── SharedLinkService.java │ │ │ ├── SpotifyAuthService.java │ │ │ ├── SpotifyUserService.java │ │ │ ├── TwitterUserService.java │ │ │ ├── UserChannelService.java │ │ │ ├── UserContactService.java │ │ │ ├── UserGroupService.java │ │ │ └── UserService.java │ │ ├── app │ │ ├── AboutActivity.java │ │ ├── AddChannelListActivity.java │ │ ├── AggregateFeedActivity.java │ │ ├── BaseActivity.java │ │ ├── DispatchActivity.java │ │ ├── EditGroupChannelsActivity.java │ │ ├── GoogleApiActivity.java │ │ ├── GroupContactsActivity.java │ │ ├── IntroductionActivity.java │ │ ├── LoginActivity.java │ │ ├── SearchActivity.java │ │ ├── UserContactActivity.java │ │ ├── adapter │ │ │ ├── ActivityFeedAdapter.java │ │ │ ├── AddChannelAdapter.java │ │ │ ├── BaseRecyclerView.java │ │ │ ├── BaseRecyclerViewAdapter.java │ │ │ ├── BaseViewHolder.java │ │ │ ├── DrawerAdapter.java │ │ │ ├── EditGroupChannelAdapter.java │ │ │ ├── GroupAdapter.java │ │ │ ├── GroupContactsAdapter.java │ │ │ ├── NotificationRecyclerAdapter.java │ │ │ ├── SaveGroupChannelAdapter.java │ │ │ ├── SearchUserAdapter.java │ │ │ ├── ShareLinkAdapter.java │ │ │ ├── SortedRecyclerAdapter.java │ │ │ ├── UserContactsAdapter.java │ │ │ ├── UserGroupsAdapter.java │ │ │ └── ViewChannelAdapter.java │ │ ├── dialog │ │ │ ├── AddAuthChannelDialog.java │ │ │ ├── AddChannelDialog.java │ │ │ ├── AddRedditChannelDialog.java │ │ │ ├── BaseDialogFragment.java │ │ │ ├── EditChannelDialog.java │ │ │ ├── ErrorDialog.java │ │ │ ├── InstagramAuthDialog.java │ │ │ ├── SaveGroupChannelDialog.java │ │ │ ├── ShareLinkDialog.java │ │ │ ├── SpotifyAuthDialog.java │ │ │ └── UserGroupsDialog.java │ │ └── fragment │ │ │ ├── AboutFragment.java │ │ │ ├── AddChannelListFragment.java │ │ │ ├── AggregateFeedFragment.java │ │ │ ├── BaseFragment.java │ │ │ ├── BaseIntroductionFragment.java │ │ │ ├── ContactProfileFragment.java │ │ │ ├── DispatchFragment.java │ │ │ ├── EditGroupChannelsFragment.java │ │ │ ├── FirstIntroductionFragment.java │ │ │ ├── GroupContactsFragment.java │ │ │ ├── MainContactsFragment.java │ │ │ ├── MainDrawerFragment.java │ │ │ ├── MainGroupFragment.java │ │ │ ├── MainIntroductionFragment.java │ │ │ ├── MainUserProfileFragment.java │ │ │ ├── SearchFragment.java │ │ │ ├── SecondIntroductionFragment.java │ │ │ ├── ThirdIntroductionFragment.java │ │ │ ├── UserChannelsFragment.java │ │ │ ├── UserFeedFragment.java │ │ │ └── UserProfileFragment.java │ │ ├── util │ │ ├── ObjectUtils.java │ │ └── ViewUtils.java │ │ └── widget │ │ ├── ContactSearchLayout.java │ │ ├── ContentDescriptionDrawable.java │ │ ├── CustomEditText.java │ │ ├── DismissibleNotificationCard.java │ │ └── behavior │ │ ├── ScrollOffBottomBehavior.java │ │ └── SnackbarMarginBehavior.java │ ├── kotlin │ └── com │ │ └── shareyourproxy │ │ └── api │ │ └── rx │ │ ├── RxActivityFeedSync.kt │ │ ├── RxBusDriver.kt │ │ ├── RxFabricAnalytics.kt │ │ ├── RxGoogleAnalytics.kt │ │ ├── RxGroupChannelSync.kt │ │ ├── RxGroupContactSync.kt │ │ ├── RxHelper.kt │ │ ├── RxLoginHelper.kt │ │ ├── RxMessageSync.kt │ │ ├── RxQuery.kt │ │ ├── RxShareLink.kt │ │ ├── RxTextWatcherSubject.kt │ │ ├── RxUserChannelSync.kt │ │ ├── RxUserContactSync.kt │ │ ├── RxUserGroupSync.kt │ │ └── RxUserSync.kt │ └── res │ ├── images │ ├── anim │ │ ├── fade_in.xml │ │ ├── fade_out.xml │ │ ├── slide_in_bottom.xml │ │ └── slide_out_bottom.xml │ ├── drawable-v21 │ │ ├── ripple.xml │ │ ├── selector_button_blue.xml │ │ ├── selector_button_grey.xml │ │ ├── selector_contactsearchlayout.xml │ │ └── selector_whitebox_darkclick.xml │ ├── drawable │ │ ├── ripple.xml │ │ ├── selector_button_blue.xml │ │ ├── selector_button_grey.xml │ │ ├── selector_contactsearchlayout.xml │ │ └── selector_whitebox_darkclick.xml │ ├── mipmap-hdpi │ │ ├── ic_proxy.png │ │ └── ic_proxy_notification.png │ ├── mipmap-mdpi │ │ ├── ic_proxy.png │ │ └── ic_proxy_notification.png │ ├── mipmap-xhdpi │ │ ├── ic_proxy.png │ │ └── ic_proxy_notification.png │ ├── mipmap-xxhdpi │ │ ├── ic_proxy.png │ │ └── ic_proxy_notification.png │ ├── mipmap-xxxhdpi │ │ ├── ic_proxy.png │ │ └── ic_proxy_notification.png │ └── raw │ │ ├── ic_account_circle.svg │ │ ├── ic_add.svg │ │ ├── ic_address.svg │ │ ├── ic_alien.svg │ │ ├── ic_arrow_back.svg │ │ ├── ic_bug_report.svg │ │ ├── ic_call.svg │ │ ├── ic_carroll_share.svg │ │ ├── ic_chameleon.svg │ │ ├── ic_chameleon_framed.svg │ │ ├── ic_chevron_right.svg │ │ ├── ic_clear.svg │ │ ├── ic_doge_channels.svg │ │ ├── ic_done.svg │ │ ├── ic_ello.svg │ │ ├── ic_email.svg │ │ ├── ic_exit_to_app.svg │ │ ├── ic_explore.svg │ │ ├── ic_facebook.svg │ │ ├── ic_facebook_messenger.svg │ │ ├── ic_fish.svg │ │ ├── ic_flash_on.svg │ │ ├── ic_gato.svg │ │ ├── ic_ghost_doge.svg │ │ ├── ic_ghost_sloth.svg │ │ ├── ic_github.svg │ │ ├── ic_google_hangouts.svg │ │ ├── ic_google_plus.svg │ │ ├── ic_group.svg │ │ ├── ic_groups.svg │ │ ├── ic_guide_activity_slide1.svg │ │ ├── ic_guide_activity_slide2.svg │ │ ├── ic_guide_activity_slide3.svg │ │ ├── ic_info_outline.svg │ │ ├── ic_instagram.svg │ │ ├── ic_jamal.svg │ │ ├── ic_link.svg │ │ ├── ic_linkedin.svg │ │ ├── ic_local_play.svg │ │ ├── ic_lol.svg │ │ ├── ic_medium.svg │ │ ├── ic_meerkat.svg │ │ ├── ic_menu.svg │ │ ├── ic_nintendo.svg │ │ ├── ic_owl.svg │ │ ├── ic_periscope.svg │ │ ├── ic_playstation.svg │ │ ├── ic_proxy_logo_typed.svg │ │ ├── ic_reddit.svg │ │ ├── ic_sexbot.svg │ │ ├── ic_sexbot_custom.svg │ │ ├── ic_share.svg │ │ ├── ic_skype.svg │ │ ├── ic_slack.svg │ │ ├── ic_sms.svg │ │ ├── ic_snapchat.svg │ │ ├── ic_soundcloud.svg │ │ ├── ic_spotify.svg │ │ ├── ic_star.svg │ │ ├── ic_steam.svg │ │ ├── ic_tumblr.svg │ │ ├── ic_twitch.svg │ │ ├── ic_twitter.svg │ │ ├── ic_venmo.svg │ │ ├── ic_whatsapp.svg │ │ ├── ic_xbox.svg │ │ ├── ic_yo.svg │ │ └── ic_youtube.svg │ ├── layouts │ ├── activity │ │ └── layout │ │ │ ├── activity_about.xml │ │ │ └── activity_login.xml │ ├── adapter │ │ └── layout │ │ │ ├── adapter_activity_feed_item.xml │ │ │ ├── adapter_add_channel_list_item.xml │ │ │ ├── adapter_channel_view_content.xml │ │ │ ├── adapter_dismissible_notification.xml │ │ │ ├── adapter_drawer_header.xml │ │ │ ├── adapter_drawer_item.xml │ │ │ ├── adapter_edit_group_channel_footer.xml │ │ │ ├── adapter_edit_group_channel_header.xml │ │ │ ├── adapter_edit_group_channel_item.xml │ │ │ ├── adapter_share_link.xml │ │ │ ├── adapter_user_groups_checklist.xml │ │ │ └── adapter_user_item.xml │ ├── common │ │ └── layout │ │ │ ├── common_activity_fragment_container.xml │ │ │ ├── common_adapter_text_item.xml │ │ │ ├── common_textview_body1_disabled.xml │ │ │ └── fragment_contacts_main.xml │ ├── dialog │ │ └── layout │ │ │ ├── dialog_add_channel.xml │ │ │ ├── dialog_add_reddit_channel.xml │ │ │ ├── dialog_auth_channel.xml │ │ │ ├── dialog_sharelink.xml │ │ │ ├── dialog_user_groups.xml │ │ │ └── dialog_webview.xml │ ├── fragment │ │ └── layout │ │ │ ├── fragment_about.xml │ │ │ ├── fragment_channellist.xml │ │ │ ├── fragment_dispatch.xml │ │ │ ├── fragment_drawer.xml │ │ │ ├── fragment_edit_group_channel.xml │ │ │ ├── fragment_introduction_first.xml │ │ │ ├── fragment_introduction_main.xml │ │ │ ├── fragment_introduction_second.xml │ │ │ ├── fragment_introduction_third.xml │ │ │ ├── fragment_main.xml │ │ │ ├── fragment_main_group.xml │ │ │ ├── fragment_search.xml │ │ │ ├── fragment_user_channels.xml │ │ │ ├── fragment_user_feed.xml │ │ │ ├── fragment_user_profile.xml │ │ │ └── fragment_view_group_users.xml │ ├── menu │ │ ├── menu_activity_aggregate_feed.xml │ │ └── menu_activity_edit_group_channel.xml │ └── widget │ │ └── layout │ │ ├── notification_card.xml │ │ └── widget_contactsearchlayout.xml │ ├── transition │ └── change_image_transform.xml │ └── values │ ├── attrs.xml │ ├── colors.xml │ ├── dimens.xml │ ├── strings.xml │ └── styles.xml ├── README.md ├── art ├── add_channel.png ├── add_group.png ├── contact_profile.png ├── contacts.png ├── search.png └── user_profile.png ├── blaze.yml ├── build.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── licenses.txt ├── lint.xml ├── proguard-rules.pro └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | # generated files 2 | bin/ 3 | gen/ 4 | out/ 5 | build/ 6 | config/ 7 | 8 | # Local configuration file (sdk path, etc) 9 | local.properties 10 | crashlytics.properties 11 | # Eclipse project files 12 | .classpath 13 | .project 14 | 15 | # IDEA/Android Studio project files, because the project can be imported from settings.gradle 16 | .idea/ 17 | *.iml 18 | 19 | # Old-style IDEA project files 20 | *.ipr 21 | *.iws 22 | 23 | # Gradle cache 24 | .gradle 25 | 26 | # Vim/kdiff files 27 | *.orig 28 | *.swp 29 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: android 2 | jdk: oraclejdk7 3 | 4 | android: 5 | components: 6 | - android-23 7 | - platform-tools 8 | - tools 9 | - sys-img-armeabi-v7a-android-23 10 | - extra-android-support 11 | - extra-google-google_play_services 12 | - extra-android-m2repository 13 | - extra-google-m2repository 14 | - build-tools-23.0.2 15 | 16 | sudo: false 17 | 18 | before_script: 19 | - chmod +x gradlew 20 | 21 | script: 22 | - ./gradlew clean assembleFullRelease --stacktrace --info 23 | 24 | branches: 25 | only: 26 | - master 27 | - develop -------------------------------------------------------------------------------- /Application/.gitignore: -------------------------------------------------------------------------------- 1 | # generated files 2 | build/ 3 | *.apk 4 | 5 | # IDEA/Android Studio project files, because the project can be imported from settings.gradle 6 | .idea 7 | *.iml 8 | 9 | # Local configuration file (sdk path, etc) 10 | local.properties 11 | crashlytics.properties 12 | keys.xml 13 | fabric.properties 14 | 15 | # Eclipse project files 16 | .classpath 17 | .project -------------------------------------------------------------------------------- /Application/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/Evan/android-sdks/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | -dontwarn okio.** 20 | -dontwarn retrofit.** 21 | -dontwarn butterknife.** 22 | -dontwarn com.squareup.** 23 | -dontwarn com.caverock.** 24 | -dontwarn rx.internal.** 25 | -dontwarn javax.** 26 | -dontwarn io.realm.** 27 | -dontwarn com.twitter.** 28 | -dontwarn com.fasterxml.jackson.databind.** 29 | 30 | 31 | -keep class io.realm.** { *; } 32 | -keep class com.firebase.** { *; } 33 | 34 | -keepnames class com.shaded.fasterxml.jackson.** { *; } 35 | -keepnames public class * extends io.realm.RealmObject 36 | 37 | -keepattributes Signature 38 | -keepattributes InnerClasses 39 | -keepattributes EnclosingMethod 40 | 41 | -------------------------------------------------------------------------------- /Application/proxy.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProxyApp/Proxy/bd7205fc3c329dc05525541c107c6ec3e48994a6/Application/proxy.jks -------------------------------------------------------------------------------- /Application/src/main/aidl/com/shareyourproxy/INotificationService.aidl: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy; 2 | 3 | import android.app.Notification; 4 | import com.shareyourproxy.api.rx.RxBusDriver; 5 | 6 | interface INotificationService { 7 | List getNotifications(in String userId); 8 | } 9 | -------------------------------------------------------------------------------- /Application/src/main/aidl/com/shareyourproxy/api/rx/RxBusDriver.aidl: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.rx; 2 | parcelable RxBusDriver; -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/FirebaseAuthenticator.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api; 2 | 3 | import android.content.SharedPreferences; 4 | 5 | import com.shareyourproxy.api.rx.RxBusDriver; 6 | import com.shareyourproxy.api.rx.event.RefreshFirebaseAuthenticationEvent; 7 | import com.squareup.okhttp.Authenticator; 8 | import com.squareup.okhttp.HttpUrl; 9 | import com.squareup.okhttp.Request; 10 | import com.squareup.okhttp.Response; 11 | 12 | import java.io.IOException; 13 | import java.net.Proxy; 14 | 15 | import static com.shareyourproxy.Constants.KEY_GOOGLE_PLUS_AUTH; 16 | import static com.shareyourproxy.Constants.QUERY_AUTH; 17 | 18 | /** 19 | * Appends a firebase token saved in shared preferences to each network request. 20 | */ 21 | public class FirebaseAuthenticator implements Authenticator { 22 | private final RxBusDriver _rxBus; 23 | private final SharedPreferences _sharedPrefs; 24 | 25 | public FirebaseAuthenticator(RxBusDriver rxBus, SharedPreferences sharedPrefs) { 26 | _rxBus = rxBus; 27 | _sharedPrefs = sharedPrefs; 28 | } 29 | 30 | @Override 31 | public Request authenticate(Proxy proxy, Response response) throws IOException { 32 | String token = _sharedPrefs.getString(KEY_GOOGLE_PLUS_AUTH, null); 33 | Request request = response.request(); 34 | _rxBus.post(new RefreshFirebaseAuthenticationEvent()); 35 | if (token != null) { 36 | HttpUrl httpUrl = request.httpUrl(); 37 | HttpUrl url = httpUrl.newBuilder().addQueryParameter(QUERY_AUTH, token).build(); 38 | request = response.request().newBuilder().url(url).build(); 39 | } 40 | return request; 41 | } 42 | 43 | @Override 44 | public Request authenticateProxy(Proxy proxy, Response response) throws IOException { 45 | _rxBus.post(new RefreshFirebaseAuthenticationEvent()); 46 | return response.request(); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/FirebaseInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api; 2 | 3 | import android.content.SharedPreferences; 4 | 5 | import com.shareyourproxy.Constants; 6 | import com.squareup.okhttp.HttpUrl; 7 | import com.squareup.okhttp.Interceptor; 8 | import com.squareup.okhttp.Request; 9 | import com.squareup.okhttp.Response; 10 | 11 | import java.io.IOException; 12 | 13 | import timber.log.Timber; 14 | 15 | import static com.shareyourproxy.Constants.QUERY_AUTH; 16 | 17 | /** 18 | * Created by Evan on 9/17/15. 19 | */ 20 | public class FirebaseInterceptor implements Interceptor { 21 | 22 | private final SharedPreferences _sharedPrefs; 23 | 24 | public FirebaseInterceptor(SharedPreferences sharedPrefs) { 25 | _sharedPrefs = sharedPrefs; 26 | } 27 | 28 | 29 | @Override 30 | public Response intercept(Chain chain) throws IOException { 31 | String token = _sharedPrefs.getString(Constants.KEY_GOOGLE_PLUS_AUTH, null); 32 | Request request = chain.request(); 33 | if (token != null) { 34 | HttpUrl url = request.httpUrl().newBuilder() 35 | .addQueryParameter(QUERY_AUTH, token) 36 | .build(); 37 | request = chain.request().newBuilder().url(url).build(); 38 | } 39 | Response res = chain.proceed(request); 40 | Timber.i("Retrofit Response: %1$s", res.toString()); 41 | return res; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/NotificationService.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api; 2 | 3 | import android.app.Notification; 4 | import android.app.Service; 5 | import android.content.Intent; 6 | import android.os.IBinder; 7 | import android.os.RemoteException; 8 | 9 | import com.shareyourproxy.INotificationService; 10 | import com.shareyourproxy.api.rx.command.GetUserMessagesCommand; 11 | import com.shareyourproxy.api.rx.command.eventcallback.EventCallback; 12 | import com.shareyourproxy.api.rx.command.eventcallback.UserMessagesDownloadedEventCallback; 13 | 14 | import java.util.ArrayList; 15 | 16 | /** 17 | * Created by Evan on 6/18/15. 18 | */ 19 | public class NotificationService extends Service { 20 | private final INotificationService.Stub _binder = new INotificationService.Stub() { 21 | @Override 22 | public ArrayList getNotifications(String userId) 23 | throws RemoteException { 24 | EventCallback eventData = new GetUserMessagesCommand(userId) 25 | .execute(NotificationService.this); 26 | if (eventData != null) { 27 | ArrayList notifications = 28 | ((UserMessagesDownloadedEventCallback) eventData).notifications; 29 | if (notifications != null) { 30 | return notifications; 31 | } 32 | } 33 | return null; 34 | } 35 | }; 36 | 37 | @Override 38 | public void onCreate() { 39 | super.onCreate(); 40 | } 41 | 42 | @Override 43 | public IBinder onBind(Intent intent) { 44 | return _binder; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/TwitterRestClient.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api; 2 | 3 | import com.shareyourproxy.api.service.TwitterUserService; 4 | import com.twitter.sdk.android.core.Session; 5 | import com.twitter.sdk.android.core.TwitterApiClient; 6 | 7 | /** 8 | * Custom twitter user timeline service. 9 | */ 10 | public class TwitterRestClient extends TwitterApiClient { 11 | public TwitterRestClient(Session session) { 12 | super(session); 13 | 14 | } 15 | 16 | public static TwitterRestClient newInstance(Session session) { 17 | return new TwitterRestClient(session); 18 | } 19 | 20 | public TwitterUserService getUserService() { 21 | return getService(TwitterUserService.class); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/domain/factory/AutoValueClass.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.domain.factory; 2 | 3 | 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * Marks an {@link @AutoValue}-annotated type for proper Gson serialization. 11 | *

12 | * This annotation is needed because the {@linkplain Retention retention} of {@code @AutoValue} does not allow reflection at runtime. 13 | */ 14 | @Retention(RetentionPolicy.RUNTIME) 15 | @Target(ElementType.TYPE) 16 | public @interface AutoValueClass { 17 | 18 | /** 19 | * A reference to the AutoValue-generated class (e.g. AutoValue_MyClass). This is necessary to handle obfuscation of the class names. 20 | */ 21 | Class autoValueClass(); 22 | } 23 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/domain/factory/AutoValueTypeAdapterFactory.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.domain.factory; 2 | 3 | import com.google.gson.Gson; 4 | import com.google.gson.TypeAdapter; 5 | import com.google.gson.TypeAdapterFactory; 6 | import com.google.gson.reflect.TypeToken; 7 | import com.shareyourproxy.api.domain.model.User; 8 | 9 | /** 10 | * Gson adapter factory responsible for deserializing json responses into immutable autovalue objects. 11 | */ 12 | public class AutoValueTypeAdapterFactory implements TypeAdapterFactory { 13 | @Override 14 | public TypeAdapter create(Gson gson, TypeToken type) { 15 | Class rawType = (Class) type.getRawType(); 16 | 17 | AutoValueClass annotation = rawType.getAnnotation(AutoValueClass.class); 18 | // Only deserialize classes decorated with @AutoValueClass. 19 | if (annotation == null || User.class.isInstance(rawType.getClass())) { 20 | return null; 21 | } 22 | return (TypeAdapter) gson.getAdapter(annotation.autoValueClass()); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/domain/factory/ContactFactory.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.domain.factory; 2 | 3 | import com.shareyourproxy.api.domain.model.Contact; 4 | import com.shareyourproxy.api.domain.realm.RealmString; 5 | 6 | import java.util.HashSet; 7 | 8 | import io.realm.RealmList; 9 | 10 | /** 11 | * Factory for creating domain model {@link Contact}s. 12 | */ 13 | public class ContactFactory { 14 | 15 | /** 16 | * Convert a list of RealmString values into a HashSet of contact id Strings. 17 | * 18 | * @param values contact ids saved in realm 19 | * @return HashSet of contact id values 20 | */ 21 | public static HashSet getContactIdSet(RealmList values) { 22 | if (values != null) { 23 | HashSet contactList = new HashSet<>(values.size()); 24 | for (RealmString realmContact : values) { 25 | contactList.add(realmContact.getValue()); 26 | } 27 | return contactList; 28 | } 29 | return null; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/domain/factory/GroupFactory.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.domain.factory; 2 | 3 | import com.shareyourproxy.api.domain.model.Group; 4 | import com.shareyourproxy.api.domain.realm.RealmGroup; 5 | 6 | import java.util.HashMap; 7 | import java.util.HashSet; 8 | 9 | import io.realm.RealmList; 10 | 11 | import static com.shareyourproxy.api.domain.factory.ChannelFactory.getModelChannelList; 12 | import static com.shareyourproxy.api.domain.factory.ContactFactory.getContactIdSet; 13 | 14 | /** 15 | * Factory for creating domain model {@link Group}s. 16 | */ 17 | public class GroupFactory { 18 | 19 | /** 20 | * Return a RealmList of Contacts from a user 21 | * 22 | * @param realmGroupArray to get contactGroups from 23 | * @return RealmList of Contacts 24 | */ 25 | public static HashMap getModelGroups(RealmList realmGroupArray) { 26 | HashMap groups = new HashMap<>(realmGroupArray.size()); 27 | for (RealmGroup realmGroup : realmGroupArray) { 28 | groups.put(realmGroup.getId(), getModelGroup(realmGroup)); 29 | } 30 | return groups; 31 | } 32 | 33 | public static Group getModelGroup(RealmGroup realmGroup) { 34 | return Group.copy(realmGroup.getId(), realmGroup.getLabel(), 35 | getModelChannelList(realmGroup.getChannels()), 36 | getContactIdSet(realmGroup.getContacts())); 37 | } 38 | 39 | public static Group addGroupChannels( 40 | String newTitle, Group oldGroup, HashSet channels) { 41 | return Group.copy(oldGroup.id(), newTitle, channels, oldGroup.contacts()); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/domain/factory/RealmChannelFactory.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.domain.factory; 2 | 3 | import com.shareyourproxy.api.domain.model.Channel; 4 | import com.shareyourproxy.api.domain.realm.RealmChannel; 5 | import com.shareyourproxy.api.domain.realm.RealmChannelType; 6 | 7 | import java.util.HashMap; 8 | import java.util.Map; 9 | 10 | import io.realm.RealmList; 11 | 12 | /** 13 | * Factory for creating {@link RealmChannel}s. 14 | */ 15 | public class RealmChannelFactory { 16 | 17 | public static RealmList getRealmChannels(HashMap channels) { 18 | if (channels == null) { 19 | return null; 20 | } 21 | RealmList realmChannelArray; 22 | realmChannelArray = new RealmList<>(); 23 | for (Map.Entry channelEntry : channels.entrySet()) { 24 | Channel channel = channelEntry.getValue(); 25 | RealmChannel realmChannel = new RealmChannel(); 26 | RealmChannelType realmChannelType = new RealmChannelType(); 27 | //construct the newChannel section 28 | 29 | //construct the newChannel type 30 | realmChannelType.setWeight(channel.channelType().getWeight()); 31 | realmChannelType.setLabel(channel.channelType().getLabel()); 32 | realmChannelType.setResId(channel.channelType().getResId()); 33 | 34 | //construct the newChannel 35 | realmChannel.setId(channel.id()); 36 | realmChannel.setLabel(channel.label()); 37 | realmChannel.setChannelType(realmChannelType); 38 | realmChannel.setActionAddress(channel.actionAddress()); 39 | 40 | Boolean isPublic = channel.isPublic() == null ? false : channel.isPublic(); 41 | realmChannel.setIsPublic(isPublic); 42 | 43 | //add to array 44 | realmChannelArray.add(realmChannel); 45 | } 46 | return realmChannelArray; 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/domain/factory/RealmContactFactory.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.domain.factory; 2 | 3 | import com.shareyourproxy.api.domain.realm.RealmContact; 4 | import com.shareyourproxy.api.domain.realm.RealmString; 5 | 6 | import java.util.HashSet; 7 | 8 | import io.realm.RealmList; 9 | 10 | /** 11 | * Factory for creating {@link RealmContact}s. 12 | */ 13 | public class RealmContactFactory { 14 | /** 15 | * Return a RealmList of Contacts from a user's contacts. 16 | * 17 | * @param contacts array of user contacts 18 | * @return RealmList of Contacts 19 | */ 20 | public static RealmList getRealmContacts(HashSet contacts) { 21 | if (contacts == null) { 22 | return null; 23 | } 24 | RealmList realmContactArray = new RealmList<>(); 25 | for (String id : contacts) { 26 | RealmString realmContact = new RealmString(); 27 | realmContact.setValue(id); 28 | realmContactArray.add(realmContact); 29 | } 30 | return realmContactArray; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/domain/factory/RealmGroupFactory.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.domain.factory; 2 | 3 | import com.shareyourproxy.api.domain.model.Group; 4 | import com.shareyourproxy.api.domain.realm.RealmGroup; 5 | import com.shareyourproxy.api.domain.realm.RealmString; 6 | 7 | import java.util.HashMap; 8 | import java.util.HashSet; 9 | import java.util.Map; 10 | 11 | import io.realm.RealmList; 12 | 13 | /** 14 | * Factory for creating {@link RealmGroup}s. 15 | */ 16 | public class RealmGroupFactory { 17 | 18 | /** 19 | * Return a RealmList of Contacts from a user 20 | * 21 | * @param groupHashMap to get contacts from 22 | * @return RealmList of Contacts 23 | */ 24 | public static RealmList getRealmGroups(HashMap groupHashMap) { 25 | if (groupHashMap == null) { 26 | return null; 27 | } 28 | RealmList realmGroupArray = new RealmList<>(); 29 | for (Map.Entry entryGroup : groupHashMap.entrySet()) { 30 | Group group = entryGroup.getValue(); 31 | RealmGroup realmGroup = new RealmGroup(); 32 | realmGroup.setId(group.id()); 33 | realmGroup.setLabel(group.label()); 34 | realmGroup.setChannels(createRealmStringList(group.channels())); 35 | realmGroup.setContacts(createRealmStringList(group.contacts())); 36 | realmGroupArray.add(realmGroup); 37 | } 38 | return realmGroupArray; 39 | } 40 | 41 | private static RealmList createRealmStringList(HashSet values) { 42 | if (values == null) { 43 | return null; 44 | } 45 | RealmList list = new RealmList<>(); 46 | for (String id : values) { 47 | RealmString newChannel = new RealmString(); 48 | newChannel.setValue(id); 49 | list.add(newChannel); 50 | } 51 | return list; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/domain/factory/UserTypeAdapterFactory.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.domain.factory; 2 | 3 | import com.google.gson.JsonElement; 4 | import com.google.gson.JsonObject; 5 | import com.google.gson.JsonPrimitive; 6 | import com.shareyourproxy.api.domain.model.User; 7 | 8 | import static com.shareyourproxy.util.ObjectUtils.buildFullName; 9 | 10 | /** 11 | * Created by Evan on 11/3/15. 12 | */ 13 | public class UserTypeAdapterFactory extends CustomTypeAdapterFactory { 14 | public UserTypeAdapterFactory() { 15 | super(User.class); 16 | } 17 | 18 | @Override 19 | protected void beforeWrite(User source, JsonElement toSerialize) { 20 | JsonObject custom = toSerialize.getAsJsonObject(); 21 | custom.remove("fullName"); 22 | } 23 | 24 | @Override 25 | protected void afterRead(JsonElement deserialized) { 26 | if (deserialized.isJsonObject()) { 27 | JsonObject obj = deserialized.getAsJsonObject(); 28 | JsonElement firstName = obj.get("first"); 29 | JsonElement lastName = obj.get("last"); 30 | String first = firstName == null ? "" : firstName.getAsString(); 31 | String last = lastName == null ? "" : lastName.getAsString(); 32 | obj.add("fullName", new JsonPrimitive(buildFullName(first, last))); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/domain/model/ChannelToggle.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.domain.model; 2 | 3 | import android.os.Parcel; 4 | import android.os.Parcelable; 5 | 6 | /** 7 | * Used to signify if a {@link Channel} is in a {@link Group} or not. 8 | */ 9 | public class ChannelToggle implements Parcelable { 10 | public static final Creator CREATOR = 11 | new Creator() { 12 | @Override 13 | public ChannelToggle createFromParcel(Parcel in) { 14 | return new ChannelToggle(in); 15 | } 16 | 17 | @Override 18 | public ChannelToggle[] newArray(int size) { 19 | return new ChannelToggle[size]; 20 | } 21 | }; 22 | private final static java.lang.ClassLoader CL = ChannelToggle.class.getClassLoader(); 23 | 24 | private Channel _channel; 25 | private boolean _inGroup; 26 | 27 | public ChannelToggle(Channel channel, boolean inGroup) { 28 | _channel = channel; 29 | _inGroup = inGroup; 30 | } 31 | 32 | private ChannelToggle(Parcel in) { 33 | this((Channel) in.readValue(CL), (boolean) in.readValue(CL)); 34 | } 35 | 36 | public static ChannelToggle create(Channel channel, boolean inGroup) { 37 | return new ChannelToggle(channel, inGroup); 38 | } 39 | 40 | public Channel getChannel() { 41 | return _channel; 42 | } 43 | 44 | public void setChannel(Channel channel) { 45 | _channel = channel; 46 | } 47 | 48 | public boolean inGroup() { 49 | return _inGroup; 50 | } 51 | 52 | public void setInGroup(boolean inGroup) { 53 | _inGroup = inGroup; 54 | } 55 | 56 | @Override 57 | public int describeContents() { 58 | return 0; 59 | } 60 | 61 | @Override 62 | public void writeToParcel(Parcel dest, int flags) { 63 | dest.writeValue(_channel); 64 | dest.writeValue(_inGroup); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/domain/model/GroupToggle.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.domain.model; 2 | 3 | import android.os.Parcel; 4 | import android.os.Parcelable; 5 | 6 | import com.shareyourproxy.app.dialog.UserGroupsDialog; 7 | 8 | /** 9 | * Model for {@link UserGroupsDialog}. 10 | */ 11 | public class GroupToggle implements Parcelable { 12 | public static final Creator CREATOR = new Creator 13 | () { 14 | @Override 15 | public GroupToggle createFromParcel(Parcel in) { 16 | return new GroupToggle(in); 17 | } 18 | 19 | @Override 20 | public GroupToggle[] newArray(int size) { 21 | return new GroupToggle[size]; 22 | } 23 | }; 24 | private final static java.lang.ClassLoader CL = GroupToggle.class.getClassLoader(); 25 | 26 | private Group _group; 27 | private boolean _isChecked; 28 | 29 | public GroupToggle(Group group, boolean isChecked) { 30 | _group = group; 31 | _isChecked = isChecked; 32 | } 33 | 34 | private GroupToggle(Parcel in) { 35 | this((Group) in.readValue(CL), (boolean) in.readValue(CL)); 36 | } 37 | 38 | public static GroupToggle create(Group group, boolean hasContact) { 39 | return new GroupToggle(group, hasContact); 40 | } 41 | 42 | public Group getGroup() { 43 | return _group; 44 | } 45 | 46 | public void setGroup(Group group) { 47 | _group = group; 48 | } 49 | 50 | public boolean isChecked() { 51 | return _isChecked; 52 | } 53 | 54 | public void setChecked(boolean isChecked) { 55 | _isChecked = isChecked; 56 | } 57 | 58 | @Override 59 | public int describeContents() { 60 | return 0; 61 | } 62 | 63 | @Override 64 | public void writeToParcel(Parcel dest, int flags) { 65 | dest.writeValue(_group); 66 | dest.writeValue(_isChecked); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/domain/model/InstagramAuthResponse.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.domain.model; 2 | 3 | import android.os.Parcelable; 4 | 5 | import com.shareyourproxy.api.domain.factory.AutoValueClass; 6 | 7 | import auto.parcel.AutoParcel; 8 | 9 | /** 10 | * Created by Evan on 8/12/15. 11 | */ 12 | @AutoParcel 13 | @AutoValueClass(autoValueClass = AutoParcel_InstagramAuthResponse.class) 14 | public abstract class InstagramAuthResponse implements Parcelable { 15 | 16 | public static InstagramAuthResponse createBlank(String token, InstagramUser user) { 17 | return builder().authToken(token).user(user).build(); 18 | } 19 | 20 | public static Builder builder() { 21 | return new AutoParcel_InstagramAuthResponse.Builder(); 22 | } 23 | 24 | /** 25 | * Get the ID of the {@link Group} 26 | * 27 | * @return name 28 | */ 29 | public abstract String authToken(); 30 | 31 | /** 32 | * Get the name of the {@link Group}. 33 | * 34 | * @return name 35 | */ 36 | public abstract InstagramUser user(); 37 | 38 | @AutoParcel.Builder 39 | public interface Builder { 40 | 41 | /** 42 | * Set the contactGroups Id. 43 | * 44 | * @param token auth token 45 | * @return token 46 | */ 47 | Builder authToken(String token); 48 | 49 | /** 50 | * Set the contactGroups name. 51 | * 52 | * @param user instagram user 53 | * @return user 54 | */ 55 | Builder user(InstagramUser user); 56 | 57 | /** 58 | * BUILD. 59 | * 60 | * @return Group 61 | */ 62 | InstagramAuthResponse build(); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/domain/model/SpotifyAuthResponse.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.domain.model; 2 | 3 | import android.os.Parcelable; 4 | 5 | import com.shareyourproxy.api.domain.factory.AutoValueClass; 6 | 7 | import auto.parcel.AutoParcel; 8 | 9 | /** 10 | * Created by Evan on 8/14/15. 11 | */ 12 | @AutoParcel 13 | @AutoValueClass(autoValueClass = AutoParcel_SpotifyAuthResponse.class) 14 | public abstract class SpotifyAuthResponse implements Parcelable { 15 | public static SpotifyAuthResponse create( 16 | String accessToken, String type, String expires, String refreshToken) { 17 | return builder().access_token(accessToken).token_type(type) 18 | .expires_in(expires).refresh_token(refreshToken).build(); 19 | } 20 | 21 | public static Builder builder() { 22 | return new AutoParcel_SpotifyAuthResponse.Builder(); 23 | } 24 | 25 | public abstract String access_token(); 26 | 27 | public abstract String token_type(); 28 | 29 | public abstract String expires_in(); 30 | 31 | public abstract String refresh_token(); 32 | 33 | @AutoParcel.Builder 34 | public interface Builder { 35 | 36 | Builder access_token(String token); 37 | 38 | Builder token_type(String type); 39 | 40 | Builder expires_in(String time); 41 | 42 | Builder refresh_token(String token); 43 | 44 | SpotifyAuthResponse build(); 45 | } 46 | } 47 | 48 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/domain/realm/RealmChannel.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.domain.realm; 2 | 3 | import io.realm.RealmObject; 4 | import io.realm.annotations.PrimaryKey; 5 | 6 | /** 7 | * Channels are other apps and services that you will use to communicate with {@link RealmContact}s. 8 | */ 9 | public class RealmChannel extends RealmObject { 10 | 11 | @PrimaryKey 12 | private String id; 13 | private String label; 14 | private String actionAddress; 15 | private RealmChannelType channelType; 16 | private boolean isPublic; 17 | 18 | /** 19 | * Getter 20 | * 21 | * @return id of the newChannel 22 | */ 23 | public String getId() { 24 | return id; 25 | } 26 | 27 | /** 28 | * Setter. 29 | * 30 | * @param id ID of the newChannel 31 | */ 32 | public void setId(String id) { 33 | this.id = id; 34 | } 35 | 36 | /** 37 | * Getter. 38 | * 39 | * @return newChannel label 40 | */ 41 | public String getLabel() { 42 | return label; 43 | } 44 | 45 | /** 46 | * Setter. 47 | * 48 | * @param label of the newChannel 49 | */ 50 | public void setLabel(String label) { 51 | this.label = label; 52 | } 53 | 54 | public RealmChannelType getChannelType() { 55 | return channelType; 56 | } 57 | 58 | public void setChannelType(RealmChannelType channelType) { 59 | this.channelType = channelType; 60 | } 61 | 62 | /** 63 | * Getter. 64 | * 65 | * @return action address 66 | */ 67 | public String getActionAddress() { 68 | return actionAddress; 69 | } 70 | 71 | public void setActionAddress(String actionAddress) { 72 | this.actionAddress = actionAddress; 73 | } 74 | 75 | public boolean getIsPublic() { 76 | return isPublic; 77 | } 78 | 79 | public void setIsPublic(boolean isPublic) { 80 | this.isPublic = isPublic; 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/domain/realm/RealmChannelType.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.domain.realm; 2 | 3 | import io.realm.RealmObject; 4 | 5 | /** 6 | * Created by Evan on 5/4/15. 7 | */ 8 | public class RealmChannelType extends RealmObject { 9 | 10 | private int weight; 11 | private String label; 12 | private int resId; 13 | 14 | public int getWeight() { 15 | return weight; 16 | } 17 | 18 | public void setWeight(int weight) { 19 | this.weight = weight; 20 | } 21 | 22 | public String getLabel() { 23 | return label; 24 | } 25 | 26 | public void setLabel(String label) { 27 | this.label = label; 28 | } 29 | 30 | /** 31 | * Getter. 32 | * 33 | * @return resource id 34 | */ 35 | public int getResId() { 36 | return resId; 37 | } 38 | 39 | /** 40 | * Setter. 41 | * 42 | * @param resId resource id 43 | */ 44 | public void setResId(int resId) { 45 | this.resId = resId; 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/domain/realm/RealmString.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.domain.realm; 2 | 3 | import io.realm.RealmObject; 4 | 5 | /** 6 | * Created by Evan on 8/17/15. 7 | */ 8 | public class RealmString extends RealmObject { 9 | 10 | private String value; 11 | 12 | public String getValue() { 13 | return value; 14 | } 15 | 16 | public void setValue(String value) { 17 | this.value = value; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/rx/JustObserver.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.rx; 2 | 3 | import android.util.Log; 4 | 5 | import rx.Observer; 6 | import timber.log.Timber; 7 | 8 | /** 9 | * This abstraction simply logs all errors to the command prompt. 10 | */ 11 | public abstract class JustObserver implements Observer { 12 | 13 | @Override 14 | public void onCompleted() { 15 | Timber.v(this.toString(), "onComplete"); 16 | } 17 | 18 | @Override 19 | public void onError(Throwable e) { 20 | Timber.e(Log.getStackTraceString(e)); 21 | this.error(e); 22 | } 23 | 24 | @Override 25 | public void onNext(T t) { 26 | this.next(t); 27 | } 28 | 29 | public abstract void next(T t); 30 | 31 | public void error(Throwable e) { 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/rx/JustSingle.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.rx; 2 | 3 | import rx.Single; 4 | 5 | /** 6 | * Created by Evan on 12/7/15. 7 | */ 8 | public class JustSingle implements Single.OnSubscribe { 9 | @Override 10 | public void call(Object o) { 11 | 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/rx/command/AddUserCommand.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.rx.command; 2 | 3 | import android.app.Service; 4 | import android.os.Parcel; 5 | import android.os.Parcelable; 6 | import android.support.annotation.NonNull; 7 | 8 | import com.shareyourproxy.api.domain.model.User; 9 | import com.shareyourproxy.api.rx.RxUserSync; 10 | import com.shareyourproxy.api.rx.command.eventcallback.EventCallback; 11 | 12 | 13 | /** 14 | * Add a user to firebase. 15 | */ 16 | public class AddUserCommand extends BaseCommand { 17 | public static final Parcelable.Creator CREATOR = 18 | new Parcelable.Creator() { 19 | @Override 20 | public AddUserCommand createFromParcel(Parcel in) { 21 | return new AddUserCommand(in); 22 | } 23 | 24 | @Override 25 | public AddUserCommand[] newArray(int size) { 26 | return new AddUserCommand[size]; 27 | } 28 | }; 29 | 30 | private final static java.lang.ClassLoader CL = AddUserCommand.class.getClassLoader(); 31 | public final User user; 32 | 33 | public AddUserCommand(@NonNull User user) { 34 | this.user = user; 35 | } 36 | 37 | private AddUserCommand(Parcel in) { 38 | this((User) in.readValue(CL)); 39 | } 40 | 41 | @Override 42 | public EventCallback execute(Service service) { 43 | return RxUserSync.INSTANCE.saveUser(service, user); 44 | } 45 | 46 | @Override 47 | public int describeContents() { 48 | return 0; 49 | } 50 | 51 | @Override 52 | public void writeToParcel(Parcel dest, int flags) { 53 | dest.writeValue(user); 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/rx/command/AddUserGroupCommand.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.rx.command; 2 | 3 | import android.app.Service; 4 | import android.os.Parcel; 5 | import android.support.annotation.NonNull; 6 | 7 | import com.shareyourproxy.api.domain.model.Group; 8 | import com.shareyourproxy.api.domain.model.User; 9 | import com.shareyourproxy.api.rx.RxUserGroupSync; 10 | import com.shareyourproxy.api.rx.command.eventcallback.EventCallback; 11 | 12 | /** 13 | * Created by Evan on 6/8/15. 14 | */ 15 | public class AddUserGroupCommand extends BaseCommand { 16 | 17 | public static final Creator CREATOR = new Creator() { 18 | @Override 19 | public AddUserGroupCommand createFromParcel(Parcel in) { 20 | return new AddUserGroupCommand(in); 21 | } 22 | 23 | @Override 24 | public AddUserGroupCommand[] newArray(int size) { 25 | return new AddUserGroupCommand[size]; 26 | } 27 | }; 28 | private final static java.lang.ClassLoader CL = AddUserGroupCommand.class.getClassLoader(); 29 | public final Group group; 30 | public final User user; 31 | 32 | /** 33 | * Public constructor. 34 | * 35 | * @param user logged in user 36 | * @param group this events group 37 | */ 38 | public AddUserGroupCommand(@NonNull User user, @NonNull Group group) { 39 | this.user = user; 40 | this.group = group; 41 | } 42 | 43 | private AddUserGroupCommand(Parcel in) { 44 | this((User) in.readValue(CL), (Group) in.readValue(CL)); 45 | } 46 | 47 | @Override 48 | public EventCallback execute(Service service) { 49 | return RxUserGroupSync.INSTANCE.addUserGroup(service, user, group); 50 | } 51 | 52 | @Override 53 | public int describeContents() { 54 | return 0; 55 | } 56 | 57 | @Override 58 | public void writeToParcel(Parcel dest, int flags) { 59 | dest.writeValue(user); 60 | dest.writeValue(group); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/rx/command/BaseCommand.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.rx.command; 2 | 3 | import android.os.Parcelable; 4 | 5 | /** 6 | * Send a command request to be processed in ProxyApplication. 7 | */ 8 | public abstract class BaseCommand implements ExecuteCommand, Parcelable { 9 | } 10 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/rx/command/ExecuteCommand.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.rx.command; 2 | 3 | import android.app.Service; 4 | 5 | import com.shareyourproxy.api.rx.command.eventcallback.EventCallback; 6 | 7 | /** 8 | * Command Pattern. 9 | */ 10 | public interface ExecuteCommand { 11 | EventCallback execute(Service service); 12 | } 13 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/rx/command/GetUserMessagesCommand.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.rx.command; 2 | 3 | import android.app.Service; 4 | import android.os.Parcel; 5 | 6 | import com.shareyourproxy.api.rx.RxMessageSync; 7 | import com.shareyourproxy.api.rx.command.eventcallback.EventCallback; 8 | 9 | 10 | /** 11 | * Created by Evan on 6/18/15. 12 | */ 13 | public class GetUserMessagesCommand extends BaseCommand { 14 | 15 | public static final Creator CREATOR = 16 | new Creator() { 17 | @Override 18 | public GetUserMessagesCommand createFromParcel(Parcel in) { 19 | return new GetUserMessagesCommand(in); 20 | } 21 | 22 | @Override 23 | public GetUserMessagesCommand[] newArray(int size) { 24 | return new GetUserMessagesCommand[size]; 25 | } 26 | }; 27 | private final static java.lang.ClassLoader CL = GetUserMessagesCommand.class.getClassLoader(); 28 | private final String userId; 29 | 30 | public GetUserMessagesCommand(String userId) { 31 | this.userId = userId; 32 | } 33 | 34 | private GetUserMessagesCommand(Parcel in) { 35 | this((String) in.readValue(CL)); 36 | } 37 | 38 | @Override 39 | public EventCallback execute(Service service) { 40 | return RxMessageSync.INSTANCE.getFirebaseMessages(service, userId); 41 | } 42 | 43 | @Override 44 | public int describeContents() { 45 | return 0; 46 | } 47 | 48 | @Override 49 | public void writeToParcel(Parcel dest, int flags) { 50 | dest.writeValue(userId); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/rx/command/SyncContactsCommand.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.rx.command; 2 | 3 | import android.app.Service; 4 | import android.os.Parcel; 5 | import android.os.Parcelable; 6 | 7 | import com.shareyourproxy.api.domain.model.User; 8 | import com.shareyourproxy.api.rx.RxUserSync; 9 | import com.shareyourproxy.api.rx.command.eventcallback.EventCallback; 10 | 11 | /** 12 | * Sync All Users data from firebase to Realm and return the logged in User. 13 | */ 14 | public class SyncContactsCommand extends BaseCommand { 15 | public static final Parcelable.Creator CREATOR = new Parcelable 16 | .Creator 17 | () { 18 | @Override 19 | public SyncContactsCommand createFromParcel(Parcel in) { 20 | return new SyncContactsCommand(in); 21 | } 22 | 23 | @Override 24 | public SyncContactsCommand[] newArray(int size) { 25 | return new SyncContactsCommand[size]; 26 | } 27 | }; 28 | 29 | private final static java.lang.ClassLoader CL = 30 | SyncContactsCommand.class.getClassLoader(); 31 | public final User user; 32 | 33 | public SyncContactsCommand(User user) { 34 | this.user = user; 35 | } 36 | 37 | private SyncContactsCommand(Parcel in) { 38 | this((User) in.readValue(CL)); 39 | } 40 | 41 | @Override 42 | public EventCallback execute(Service service) { 43 | return RxUserSync.INSTANCE.syncAllContacts(service, user); 44 | } 45 | 46 | @Override 47 | public int describeContents() { 48 | return 0; 49 | } 50 | 51 | @Override 52 | public void writeToParcel(Parcel dest, int flags) { 53 | dest.writeValue(user); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/rx/command/eventcallback/ActivityFeedDownloadedEvent.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.rx.command.eventcallback; 2 | 3 | import android.os.Parcel; 4 | 5 | import com.shareyourproxy.api.domain.model.ActivityFeedItem; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * The activities feed has been downloaded. 11 | */ 12 | public class ActivityFeedDownloadedEvent extends EventCallback { 13 | private final static java.lang.ClassLoader CL = 14 | ActivityFeedDownloadedEvent.class.getClassLoader(); 15 | public static final Creator CREATOR = 16 | new Creator() { 17 | @Override 18 | public ActivityFeedDownloadedEvent createFromParcel(Parcel in) { 19 | return new ActivityFeedDownloadedEvent( 20 | (List) in.readValue(CL)); 21 | } 22 | 23 | @Override 24 | public ActivityFeedDownloadedEvent[] newArray(int size) { 25 | return new ActivityFeedDownloadedEvent[size]; 26 | } 27 | }; 28 | public final List feedItems; 29 | 30 | public ActivityFeedDownloadedEvent(List feedItems) { 31 | this.feedItems = feedItems; 32 | } 33 | 34 | @Override 35 | public int describeContents() { 36 | return 0; 37 | } 38 | 39 | @Override 40 | public void writeToParcel(Parcel dest, int flags) { 41 | dest.writeValue(feedItems); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/rx/command/eventcallback/EventCallback.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.rx.command.eventcallback; 2 | 3 | import android.os.Parcelable; 4 | 5 | /** 6 | * Base event class for all events to extend from. 7 | */ 8 | public abstract class EventCallback implements Parcelable { 9 | } 10 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/rx/command/eventcallback/GroupContactsUpdatedEventCallback.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.rx.command.eventcallback; 2 | 3 | import android.os.Parcel; 4 | 5 | import com.shareyourproxy.api.domain.model.Group; 6 | import com.shareyourproxy.api.domain.model.User; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * Created by Evan on 6/10/15. 12 | */ 13 | public class GroupContactsUpdatedEventCallback extends UserEventCallback { 14 | private final static java.lang.ClassLoader CL = 15 | GroupContactsUpdatedEventCallback.class.getClassLoader(); 16 | public static final Creator CREATOR = 17 | new Creator() { 18 | @Override 19 | public GroupContactsUpdatedEventCallback createFromParcel(Parcel in) { 20 | return new GroupContactsUpdatedEventCallback( 21 | (User) in.readValue(CL), (String) in.readValue(CL), 22 | (List) in.readValue(CL)); 23 | } 24 | 25 | @Override 26 | public GroupContactsUpdatedEventCallback[] newArray(int size) { 27 | return new GroupContactsUpdatedEventCallback[size]; 28 | } 29 | }; 30 | public final List contactGroups; 31 | public final String contactId; 32 | 33 | public GroupContactsUpdatedEventCallback(User user, String contactId, List groups) { 34 | super(user); 35 | this.contactId = contactId; 36 | this.contactGroups = groups; 37 | } 38 | 39 | @Override 40 | public int describeContents() { 41 | return 0; 42 | } 43 | 44 | @Override 45 | public void writeToParcel(Parcel dest, int flags) { 46 | dest.writeValue(contactId); 47 | dest.writeValue(contactGroups); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/rx/command/eventcallback/LoggedInUserUpdatedEventCallback.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.rx.command.eventcallback; 2 | 3 | import android.os.Parcel; 4 | import android.support.annotation.NonNull; 5 | 6 | import com.shareyourproxy.api.domain.model.User; 7 | 8 | /** 9 | * Created by Evan on 6/9/15. 10 | */ 11 | public class LoggedInUserUpdatedEventCallback extends UserEventCallback { 12 | private final static java.lang.ClassLoader CL = 13 | LoggedInUserUpdatedEventCallback.class.getClassLoader(); 14 | public static final Creator CREATOR = 15 | new Creator() { 16 | @Override 17 | public LoggedInUserUpdatedEventCallback createFromParcel(Parcel in) { 18 | return new LoggedInUserUpdatedEventCallback( 19 | (User) in.readValue(CL)); 20 | } 21 | 22 | @Override 23 | public LoggedInUserUpdatedEventCallback[] newArray(int size) { 24 | return new LoggedInUserUpdatedEventCallback[size]; 25 | } 26 | }; 27 | 28 | public LoggedInUserUpdatedEventCallback(@NonNull User user) { 29 | super(user); 30 | } 31 | 32 | @Override 33 | public int describeContents() { 34 | return 0; 35 | } 36 | 37 | @Override 38 | public void writeToParcel(Parcel dest, int flags) { 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/rx/command/eventcallback/PublicChannelsUpdatedEvent.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.rx.command.eventcallback; 2 | 3 | import android.os.Parcel; 4 | 5 | import com.shareyourproxy.api.domain.model.Channel; 6 | import com.shareyourproxy.api.domain.model.User; 7 | 8 | import java.util.HashMap; 9 | 10 | /** 11 | * Created by Evan on 10/1/15. 12 | */ 13 | public class PublicChannelsUpdatedEvent extends UserEventCallback { 14 | private final static java.lang.ClassLoader CL = 15 | PublicChannelsUpdatedEvent.class.getClassLoader(); 16 | public static final Creator CREATOR = 17 | new Creator() { 18 | @Override 19 | public PublicChannelsUpdatedEvent createFromParcel(Parcel in) { 20 | return new PublicChannelsUpdatedEvent( 21 | (User) in.readValue(CL), (HashMap) in.readValue(CL)); 22 | } 23 | 24 | @Override 25 | public PublicChannelsUpdatedEvent[] newArray(int size) { 26 | return new PublicChannelsUpdatedEvent[size]; 27 | } 28 | }; 29 | public final HashMap newChannels; 30 | 31 | public PublicChannelsUpdatedEvent(User user, HashMap newChannels) { 32 | super(user); 33 | this.newChannels = newChannels; 34 | } 35 | 36 | @Override 37 | public int describeContents() { 38 | return 0; 39 | } 40 | 41 | @Override 42 | public void writeToParcel(Parcel dest, int flags) { 43 | 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/rx/command/eventcallback/UserChannelAddedEventCallback.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.rx.command.eventcallback; 2 | 3 | import android.os.Parcel; 4 | import android.support.annotation.NonNull; 5 | import android.support.annotation.Nullable; 6 | 7 | import com.shareyourproxy.api.domain.model.Channel; 8 | import com.shareyourproxy.api.domain.model.User; 9 | 10 | /** 11 | * A newChannel was added or updated. If oldChannel is non-null, then this is an update. 12 | */ 13 | public class UserChannelAddedEventCallback extends UserEventCallback { 14 | private final static java.lang.ClassLoader CL = UserChannelAddedEventCallback.class.getClassLoader(); 15 | public static final Creator CREATOR = 16 | new Creator() { 17 | @Override 18 | public UserChannelAddedEventCallback createFromParcel(Parcel in) { 19 | return new UserChannelAddedEventCallback( 20 | (User) in.readValue(CL), (Channel) in.readValue(CL), 21 | (Channel) in.readValue(CL)); 22 | } 23 | 24 | @Override 25 | public UserChannelAddedEventCallback[] newArray(int size) { 26 | return new UserChannelAddedEventCallback[size]; 27 | } 28 | }; 29 | public final Channel newChannel; 30 | public final Channel oldChannel; 31 | 32 | public UserChannelAddedEventCallback( 33 | @NonNull User user, @Nullable Channel oldChannel, @NonNull Channel newChannel) { 34 | super(user); 35 | this.oldChannel = oldChannel; 36 | this.newChannel = newChannel; 37 | } 38 | 39 | @Override 40 | public int describeContents() { 41 | return 0; 42 | } 43 | 44 | @Override 45 | public void writeToParcel(Parcel dest, int flags) { 46 | dest.writeValue(oldChannel); 47 | dest.writeValue(newChannel); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/rx/command/eventcallback/UserChannelDeletedEventCallback.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.rx.command.eventcallback; 2 | 3 | import android.os.Parcel; 4 | import android.support.annotation.NonNull; 5 | 6 | import com.shareyourproxy.api.domain.model.Channel; 7 | import com.shareyourproxy.api.domain.model.User; 8 | 9 | /** 10 | * Created by Evan on 5/21/15. 11 | */ 12 | public class UserChannelDeletedEventCallback extends UserEventCallback { 13 | private final static java.lang.ClassLoader CL = 14 | UserChannelDeletedEventCallback.class.getClassLoader(); 15 | 16 | public static final Creator CREATOR = 17 | new Creator() { 18 | @Override 19 | public UserChannelDeletedEventCallback createFromParcel(Parcel in) { 20 | return new UserChannelDeletedEventCallback( 21 | (User) in.readValue(CL), (Channel) in.readValue(CL), (int) in.readValue(CL)); 22 | } 23 | 24 | @Override 25 | public UserChannelDeletedEventCallback[] newArray(int size) { 26 | return new UserChannelDeletedEventCallback[size]; 27 | } 28 | }; 29 | public final Channel channel; 30 | public final int position; 31 | 32 | public UserChannelDeletedEventCallback( 33 | @NonNull User user, @NonNull Channel channel, int position) { 34 | super(user); 35 | this.channel = channel; 36 | this.position = position; 37 | } 38 | 39 | @Override 40 | public int describeContents() { 41 | return 0; 42 | } 43 | 44 | @Override 45 | public void writeToParcel(Parcel dest, int flags) { 46 | dest.writeValue(channel); 47 | dest.writeValue(position); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/rx/command/eventcallback/UserContactAddedEventCallback.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.rx.command.eventcallback; 2 | 3 | import android.os.Parcel; 4 | 5 | import com.shareyourproxy.api.domain.model.User; 6 | 7 | /** 8 | * Created by Evan on 6/8/15. 9 | */ 10 | public class UserContactAddedEventCallback extends UserEventCallback { 11 | private final static java.lang.ClassLoader CL = 12 | UserContactAddedEventCallback.class.getClassLoader(); 13 | public static final Creator CREATOR = 14 | new Creator() { 15 | @Override 16 | public UserContactAddedEventCallback createFromParcel(Parcel in) { 17 | return new UserContactAddedEventCallback( 18 | (User) in.readValue(CL), (String) in.readValue(CL)); 19 | } 20 | 21 | @Override 22 | public UserContactAddedEventCallback[] newArray(int size) { 23 | return new UserContactAddedEventCallback[size]; 24 | } 25 | }; 26 | public final String contactId; 27 | 28 | public UserContactAddedEventCallback(User user, String contactId) { 29 | super(user); 30 | this.contactId = contactId; 31 | } 32 | 33 | @Override 34 | public int describeContents() { 35 | return 0; 36 | } 37 | 38 | @Override 39 | public void writeToParcel(Parcel dest, int flags) { 40 | dest.writeValue(contactId); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/rx/command/eventcallback/UserContactDeletedEventCallback.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.rx.command.eventcallback; 2 | 3 | import android.os.Parcel; 4 | 5 | import com.shareyourproxy.api.domain.model.User; 6 | 7 | /** 8 | * Created by Evan on 6/8/15. 9 | */ 10 | public class UserContactDeletedEventCallback extends UserEventCallback { 11 | private final static java.lang.ClassLoader CL = 12 | UserContactDeletedEventCallback.class.getClassLoader(); 13 | public static final Creator CREATOR = 14 | new Creator() { 15 | @Override 16 | public UserContactDeletedEventCallback createFromParcel(Parcel in) { 17 | return new UserContactDeletedEventCallback( 18 | (User) in.readValue(CL), (String) in.readValue(CL)); 19 | } 20 | 21 | @Override 22 | public UserContactDeletedEventCallback[] newArray(int size) { 23 | return new UserContactDeletedEventCallback[size]; 24 | } 25 | }; 26 | private final String contactId; 27 | 28 | public UserContactDeletedEventCallback(User user, String contactId) { 29 | super(user); 30 | this.contactId = contactId; 31 | } 32 | 33 | @Override 34 | public int describeContents() { 35 | return 0; 36 | } 37 | 38 | @Override 39 | public void writeToParcel(Parcel dest, int flags) { 40 | dest.writeValue(contactId); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/rx/command/eventcallback/UserEventCallback.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.rx.command.eventcallback; 2 | 3 | import android.os.Parcel; 4 | import android.os.Parcelable; 5 | import android.support.annotation.NonNull; 6 | 7 | import com.shareyourproxy.api.domain.model.User; 8 | 9 | /** 10 | * EventCallbacks that have a user update. 11 | */ 12 | public abstract class UserEventCallback extends EventCallback implements Parcelable { 13 | public final User user; 14 | 15 | public UserEventCallback(@NonNull User user) { 16 | this.user = user; 17 | } 18 | 19 | @Override 20 | public int describeContents() { 21 | return 0; 22 | } 23 | 24 | @Override 25 | public void writeToParcel(Parcel dest, int flags) { 26 | dest.writeValue(user); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/rx/command/eventcallback/UserGroupAddedEventCallback.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.rx.command.eventcallback; 2 | 3 | import android.os.Parcel; 4 | 5 | import com.shareyourproxy.api.domain.model.Group; 6 | import com.shareyourproxy.api.domain.model.User; 7 | 8 | /** 9 | * User group channel updated. 10 | */ 11 | public class UserGroupAddedEventCallback extends UserEventCallback { 12 | private final static java.lang.ClassLoader CL = UserGroupAddedEventCallback.class.getClassLoader(); 13 | public static final Creator CREATOR = 14 | new Creator() { 15 | @Override 16 | public UserGroupAddedEventCallback createFromParcel(Parcel in) { 17 | return new UserGroupAddedEventCallback( 18 | (User) in.readValue(CL), (Group) in.readValue(CL)); 19 | } 20 | 21 | @Override 22 | public UserGroupAddedEventCallback[] newArray(int size) { 23 | return new UserGroupAddedEventCallback[size]; 24 | } 25 | }; 26 | public final Group group; 27 | 28 | 29 | /** 30 | * Public constructor. 31 | * 32 | * @param group this events group 33 | */ 34 | public UserGroupAddedEventCallback(User user, Group group) { 35 | super(user); 36 | this.group = group; 37 | } 38 | 39 | @Override 40 | public int describeContents() { 41 | return 0; 42 | } 43 | 44 | @Override 45 | public void writeToParcel(Parcel dest, int flags) { 46 | dest.writeValue(group); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/rx/command/eventcallback/UserGroupDeletedEventCallback.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.rx.command.eventcallback; 2 | 3 | 4 | import android.os.Parcel; 5 | import android.support.annotation.NonNull; 6 | 7 | import com.shareyourproxy.api.domain.model.Group; 8 | import com.shareyourproxy.api.domain.model.User; 9 | 10 | public class UserGroupDeletedEventCallback extends UserEventCallback { 11 | private final static java.lang.ClassLoader CL = 12 | UserGroupDeletedEventCallback.class.getClassLoader(); 13 | public static final Creator CREATOR = 14 | new Creator() { 15 | @Override 16 | public UserGroupDeletedEventCallback createFromParcel(Parcel in) { 17 | return new UserGroupDeletedEventCallback( 18 | (User) in.readValue(CL), (Group) in.readValue(CL)); 19 | } 20 | 21 | @Override 22 | public UserGroupDeletedEventCallback[] newArray(int size) { 23 | return new UserGroupDeletedEventCallback[size]; 24 | } 25 | }; 26 | public final Group group; 27 | 28 | /** 29 | * Public constructor. 30 | * 31 | * @param group this events group 32 | */ 33 | public UserGroupDeletedEventCallback(@NonNull User user, @NonNull Group group) { 34 | super(user); 35 | this.group = group; 36 | } 37 | 38 | @Override 39 | public int describeContents() { 40 | return 0; 41 | } 42 | 43 | @Override 44 | public void writeToParcel(Parcel dest, int flags) { 45 | dest.writeValue(group); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/rx/command/eventcallback/UserMessageAddedEventCallback.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.rx.command.eventcallback; 2 | 3 | import android.os.Parcel; 4 | import android.support.annotation.NonNull; 5 | 6 | import com.shareyourproxy.api.domain.model.Message; 7 | 8 | import java.util.HashMap; 9 | 10 | /** 11 | * Created by Evan on 6/18/15. 12 | */ 13 | public class UserMessageAddedEventCallback extends EventCallback { 14 | private final static java.lang.ClassLoader CL = 15 | UserMessageAddedEventCallback.class.getClassLoader(); 16 | public static final Creator CREATOR = 17 | new Creator() { 18 | @Override 19 | public UserMessageAddedEventCallback createFromParcel(Parcel in) { 20 | return new UserMessageAddedEventCallback( 21 | (HashMap) in.readValue(CL)); 22 | } 23 | 24 | @Override 25 | public UserMessageAddedEventCallback[] newArray(int size) { 26 | return new UserMessageAddedEventCallback[size]; 27 | } 28 | }; 29 | public final HashMap message; 30 | 31 | /** 32 | * Public constructor. 33 | * 34 | * @param message notification content 35 | */ 36 | public UserMessageAddedEventCallback(@NonNull HashMap message) { 37 | this.message = message; 38 | } 39 | 40 | @Override 41 | public int describeContents() { 42 | return 0; 43 | } 44 | 45 | @Override 46 | public void writeToParcel(Parcel dest, int flags) { 47 | dest.writeValue(message); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/rx/command/eventcallback/UserMessagesDownloadedEventCallback.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.rx.command.eventcallback; 2 | 3 | import android.app.Notification; 4 | import android.os.Parcel; 5 | 6 | import java.util.ArrayList; 7 | 8 | /** 9 | * Created by Evan on 6/18/15. 10 | */ 11 | public class UserMessagesDownloadedEventCallback extends EventCallback { 12 | private final static java.lang.ClassLoader CL = 13 | UserMessagesDownloadedEventCallback.class.getClassLoader(); 14 | public static final Creator CREATOR = 15 | new Creator() { 16 | @Override 17 | public UserMessagesDownloadedEventCallback createFromParcel(Parcel in) { 18 | return new UserMessagesDownloadedEventCallback( 19 | (ArrayList) in.readValue(CL)); 20 | } 21 | 22 | @Override 23 | public UserMessagesDownloadedEventCallback[] newArray(int size) { 24 | return new UserMessagesDownloadedEventCallback[size]; 25 | } 26 | }; 27 | public final ArrayList notifications; 28 | 29 | public UserMessagesDownloadedEventCallback(ArrayList notifications) { 30 | this.notifications = notifications; 31 | } 32 | 33 | @Override 34 | public int describeContents() { 35 | return 0; 36 | } 37 | 38 | @Override 39 | public void writeToParcel(Parcel dest, int flags) { 40 | dest.writeValue(notifications); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/rx/command/eventcallback/UsersDownloadedEventCallback.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.rx.command.eventcallback; 2 | 3 | import android.os.Parcel; 4 | 5 | import com.shareyourproxy.api.domain.model.User; 6 | 7 | import java.util.HashMap; 8 | 9 | /** 10 | * Created by Evan on 6/9/15. 11 | */ 12 | public class UsersDownloadedEventCallback extends UserEventCallback { 13 | private final static java.lang.ClassLoader CL = 14 | UsersDownloadedEventCallback.class.getClassLoader(); 15 | public static final Creator CREATOR = 16 | new Creator() { 17 | @Override 18 | public UsersDownloadedEventCallback createFromParcel(Parcel in) { 19 | return new UsersDownloadedEventCallback( 20 | (User) in.readValue(CL), (HashMap) in.readValue(CL)); 21 | } 22 | 23 | @Override 24 | public UsersDownloadedEventCallback[] newArray(int size) { 25 | return new UsersDownloadedEventCallback[size]; 26 | } 27 | }; 28 | public final HashMap users; 29 | 30 | public UsersDownloadedEventCallback(User loggedInUser, HashMap users) { 31 | super(loggedInUser); 32 | this.users = users; 33 | } 34 | 35 | @Override 36 | public int describeContents() { 37 | return 0; 38 | } 39 | 40 | @Override 41 | public void writeToParcel(Parcel dest, int flags) { 42 | dest.writeValue(users); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/rx/event/AddChannelDialogSuccess.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.rx.event; 2 | 3 | import com.shareyourproxy.api.domain.model.Channel; 4 | import com.shareyourproxy.api.domain.model.User; 5 | 6 | /** 7 | * Created by Evan on 11/17/15. 8 | */ 9 | public class AddChannelDialogSuccess { 10 | public final User user; 11 | public final Channel channel; 12 | 13 | public AddChannelDialogSuccess(User user, Channel channel) { 14 | this.user = user; 15 | this.channel = channel; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/rx/event/ChannelAddedEvent.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.rx.event; 2 | 3 | import com.shareyourproxy.api.domain.model.Channel; 4 | import com.shareyourproxy.api.domain.model.User; 5 | 6 | /** 7 | * Created by Evan on 11/9/15. 8 | */ 9 | public class ChannelAddedEvent { 10 | 11 | public final Channel channel; 12 | public final User user; 13 | 14 | public ChannelAddedEvent(User user, Channel channel) { 15 | this.channel = channel; 16 | this.user = user; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/rx/event/NotificationCardActionEvent.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.rx.event; 2 | 3 | import com.shareyourproxy.app.adapter.BaseRecyclerViewAdapter; 4 | import com.shareyourproxy.app.adapter.BaseViewHolder; 5 | import com.shareyourproxy.widget.DismissibleNotificationCard.NotificationCard; 6 | 7 | /** 8 | * Created by Evan on 11/10/15. 9 | */ 10 | public class NotificationCardActionEvent { 11 | public final NotificationCard cardType; 12 | public final boolean isHeader; 13 | public final BaseViewHolder holder; 14 | private final BaseRecyclerViewAdapter adapter; 15 | 16 | public NotificationCardActionEvent( 17 | BaseRecyclerViewAdapter adapter, BaseViewHolder holder, NotificationCard cardType, 18 | boolean isHeader) { 19 | this.adapter = adapter; 20 | this.holder = holder; 21 | this.cardType = cardType; 22 | this.isHeader = isHeader; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/rx/event/NotificationCardDismissEvent.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.rx.event; 2 | 3 | import com.shareyourproxy.app.adapter.BaseRecyclerViewAdapter; 4 | import com.shareyourproxy.app.adapter.BaseViewHolder; 5 | import com.shareyourproxy.widget.DismissibleNotificationCard.NotificationCard; 6 | 7 | /** 8 | * Created by Evan on 11/10/15. 9 | */ 10 | public class NotificationCardDismissEvent { 11 | public final NotificationCard cardType; 12 | public final boolean isHeader; 13 | public final BaseViewHolder holder; 14 | public final BaseRecyclerViewAdapter adapter; 15 | 16 | public NotificationCardDismissEvent( 17 | BaseRecyclerViewAdapter adapter, BaseViewHolder holder, NotificationCard cardType, 18 | boolean isHeader) { 19 | this.holder = holder; 20 | this.adapter = adapter; 21 | this.cardType = cardType; 22 | this.isHeader = isHeader; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/rx/event/OnBackPressedEvent.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.rx.event; 2 | 3 | /** 4 | * Created by Evan on 9/2/15. 5 | */ 6 | public class OnBackPressedEvent { 7 | } 8 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/rx/event/RecyclerViewDatasetChangedEvent.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.rx.event; 2 | 3 | 4 | import com.shareyourproxy.app.adapter.BaseRecyclerView; 5 | import com.shareyourproxy.app.adapter.BaseRecyclerViewAdapter; 6 | 7 | /** 8 | * Created by Evan on 11/2/15. 9 | */ 10 | public class RecyclerViewDatasetChangedEvent { 11 | public final BaseRecyclerView.ViewState viewState; 12 | public final BaseRecyclerViewAdapter adapter; 13 | 14 | public RecyclerViewDatasetChangedEvent( 15 | BaseRecyclerViewAdapter adapter, BaseRecyclerView 16 | .ViewState viewState) { 17 | this.viewState = viewState; 18 | this.adapter = adapter; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/rx/event/RefreshFirebaseAuthenticationEvent.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.rx.event; 2 | 3 | /** 4 | * Created by Evan on 9/17/15. 5 | */ 6 | public class RefreshFirebaseAuthenticationEvent { 7 | } 8 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/rx/event/SearchClickedEvent.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.rx.event; 2 | 3 | /** 4 | * Created by Evan on 8/30/15. 5 | */ 6 | public class SearchClickedEvent { 7 | } 8 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/rx/event/SelectDrawerItemEvent.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.rx.event; 2 | 3 | import android.support.annotation.NonNull; 4 | import android.view.View; 5 | 6 | import com.shareyourproxy.app.adapter.DrawerAdapter.DrawerItem; 7 | 8 | /** 9 | * When a Drawer item is clicked dispatch this event. 10 | */ 11 | public class SelectDrawerItemEvent { 12 | 13 | public final View view; 14 | public final int position; 15 | public final String message; 16 | public final DrawerItem drawerItem; 17 | 18 | /** 19 | * Constructor. 20 | * 21 | * @param view clicked 22 | * @param position of item in list 23 | * @param message item message 24 | */ 25 | public SelectDrawerItemEvent( 26 | @NonNull DrawerItem drawerItem, @NonNull View view, int position, String message) { 27 | this.drawerItem = drawerItem; 28 | this.view = view; 29 | this.message = message; 30 | this.position = position; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/rx/event/SelectUserChannelEvent.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.rx.event; 2 | 3 | import com.shareyourproxy.api.domain.model.Channel; 4 | 5 | /** 6 | * Channel selected event. 7 | */ 8 | public class SelectUserChannelEvent { 9 | public final Channel channel; 10 | 11 | public SelectUserChannelEvent(Channel channel) { 12 | this.channel = channel; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/rx/event/ShareLinkEventCallback.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.rx.event; 2 | 3 | import android.os.Parcel; 4 | 5 | import com.shareyourproxy.api.rx.command.eventcallback.EventCallback; 6 | 7 | /** 8 | * A ShareLink message has been generated. 9 | */ 10 | public class ShareLinkEventCallback extends EventCallback { 11 | private final static java.lang.ClassLoader CL = 12 | ShareLinkEventCallback.class.getClassLoader(); 13 | public static final Creator CREATOR = 14 | new Creator() { 15 | @Override 16 | public ShareLinkEventCallback createFromParcel(Parcel in) { 17 | return new ShareLinkEventCallback((String) in.readValue(CL)); 18 | } 19 | 20 | @Override 21 | public ShareLinkEventCallback[] newArray(int size) { 22 | return new ShareLinkEventCallback[size]; 23 | } 24 | }; 25 | public final String message; 26 | 27 | public ShareLinkEventCallback(String message) { 28 | this.message = message; 29 | } 30 | 31 | @Override 32 | public int describeContents() { 33 | return 0; 34 | } 35 | 36 | @Override 37 | public void writeToParcel(Parcel dest, int flags) { 38 | dest.writeValue(message); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/rx/event/SyncAllContactsErrorEvent.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.rx.event; 2 | 3 | /** 4 | * Sync all users command has failed. 5 | */ 6 | public class SyncAllContactsErrorEvent { 7 | } 8 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/rx/event/SyncAllContactsSuccessEvent.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.rx.event; 2 | 3 | import android.os.Parcel; 4 | 5 | import com.shareyourproxy.api.rx.command.eventcallback.EventCallback; 6 | 7 | /** 8 | * Sync all users command has successfully completed. 9 | */ 10 | public class SyncAllContactsSuccessEvent extends EventCallback { 11 | public static final Creator CREATOR = 12 | new Creator() { 13 | @Override 14 | public SyncAllContactsSuccessEvent createFromParcel(Parcel in) { 15 | return new SyncAllContactsSuccessEvent(); 16 | } 17 | 18 | @Override 19 | public SyncAllContactsSuccessEvent[] newArray(int size) { 20 | return new SyncAllContactsSuccessEvent[size]; 21 | } 22 | }; 23 | 24 | @Override 25 | public int describeContents() { 26 | return 0; 27 | } 28 | 29 | @Override 30 | public void writeToParcel(Parcel dest, int flags) { 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/rx/event/TextViewEditorActionEvent.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.rx.event; 2 | 3 | import android.view.KeyEvent; 4 | 5 | /** 6 | * Created by Evan on 11/2/15. 7 | */ 8 | public class TextViewEditorActionEvent { 9 | public final KeyEvent keyEvent; 10 | 11 | public TextViewEditorActionEvent(KeyEvent keyEvent) { 12 | this.keyEvent = keyEvent; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/rx/event/UserSelectedEvent.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.rx.event; 2 | 3 | import android.view.View; 4 | 5 | import com.shareyourproxy.api.domain.model.User; 6 | 7 | /** 8 | * Created by Evan on 4/26/15. 9 | */ 10 | public class UserSelectedEvent { 11 | 12 | public final User user; 13 | public final View imageView; 14 | public final View textView; 15 | 16 | /** 17 | * Constructor. 18 | * 19 | * @param user that was selected 20 | * @param imageView user image 21 | * @param textView user name label 22 | */ 23 | public UserSelectedEvent(View imageView, View textView, User user) { 24 | this.user = user; 25 | this.imageView = imageView; 26 | this.textView = textView; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/rx/event/ViewGroupContactsEvent.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.rx.event; 2 | 3 | /** 4 | * Created by Evan on 11/16/15. 5 | */ 6 | public class ViewGroupContactsEvent { 7 | } 8 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/service/GroupChannelService.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.service; 2 | 3 | import com.shareyourproxy.api.domain.model.Channel; 4 | import com.shareyourproxy.api.domain.model.Group; 5 | import com.shareyourproxy.api.domain.model.User; 6 | 7 | import java.util.AbstractMap.SimpleEntry; 8 | import java.util.ArrayList; 9 | import java.util.HashMap; 10 | 11 | import retrofit.http.Body; 12 | import retrofit.http.GET; 13 | import retrofit.http.PUT; 14 | import retrofit.http.Path; 15 | import rx.Observable; 16 | 17 | /** 18 | * Save and get group channels. 19 | */ 20 | public interface GroupChannelService { 21 | /** 22 | * Get a {@link User}'s {@link Group}s. 23 | * 24 | * @param userId unique id for {@link User} table 25 | */ 26 | @GET("/users/{userId}/groups/{groupId}/channels.json") 27 | Observable> listGroupChannels( 28 | @Path("userId") String userId, @Path("groupId") String groupId); 29 | 30 | /** 31 | * add a {@link Channel}. 32 | * 33 | * @param userId unique id for {@link User} table 34 | */ 35 | @PUT("/users/{userId}/groups/{groupId}/channels.json") 36 | Observable> addGroupChannel( 37 | @Path("userId") String userId, @Path("groupId") String groupId, 38 | @Body ArrayList channels); 39 | } 40 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/service/GroupContactService.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.service; 2 | 3 | import com.shareyourproxy.api.domain.model.Channel; 4 | import com.shareyourproxy.api.domain.model.Contact; 5 | import com.shareyourproxy.api.domain.model.User; 6 | 7 | import retrofit.http.Body; 8 | import retrofit.http.DELETE; 9 | import retrofit.http.PUT; 10 | import retrofit.http.Path; 11 | import rx.Observable; 12 | 13 | /** 14 | * Created by Evan on 6/5/15. 15 | */ 16 | public interface GroupContactService { 17 | /** 18 | * add a {@link Channel}. 19 | * 20 | * @param userId unique id for {@link User} table 21 | */ 22 | @PUT("/users/{userId}/groups/{groupId}/contacts/{contactId}.json") 23 | Observable addGroupContact( 24 | @Path("userId") String userId, @Path("groupId") String groupId, @Body String contactId); 25 | 26 | @DELETE("/users/{userId}/groups/{groupId}/contacts/{contactId}.json") 27 | Observable deleteGroupContact( 28 | @Path("userId") String userId, @Path("groupId") String groupId, 29 | @Path("contactId") String contactId); 30 | } 31 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/service/HerokuUserService.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.service; 2 | 3 | import com.shareyourproxy.api.domain.model.SharedLink; 4 | import com.shareyourproxy.api.domain.model.User; 5 | 6 | import java.util.ArrayList; 7 | import java.util.HashSet; 8 | 9 | import retrofit.http.GET; 10 | import retrofit.http.PUT; 11 | import retrofit.http.Query; 12 | import rx.Observable; 13 | 14 | /** 15 | * Created by Evan on 10/26/15. 16 | */ 17 | public interface HerokuUserService { 18 | /** 19 | * Return a list of users. 20 | * 21 | * @return user observable 22 | */ 23 | @GET("/users") 24 | Observable> listUsers(@Query("users") HashSet users); 25 | 26 | /** 27 | * Search for users who's first, last and first + last name match the query string. 28 | * 29 | * @return user observable 30 | */ 31 | @GET("/users/search") 32 | Observable> searchUsers(@Query("name") String name); 33 | 34 | /** 35 | * Get a specific user based of their UUID. 36 | * 37 | * @return user observable 38 | */ 39 | @GET("/users/user") 40 | Observable> getUser(@Query("id") String userId); 41 | 42 | /** 43 | * Get the total number of user followers. 44 | * 45 | * @return user observable 46 | */ 47 | @GET("/users/user/following") 48 | Observable userFollowerCount(@Query("id") String userId); 49 | 50 | /** 51 | * Get the total number of user followers. 52 | * 53 | * @return user observable 54 | */ 55 | @GET("/users/user/shared") 56 | Observable getSharedLink( 57 | @Query("groupId") String groupId, @Query("userId") String userId); 58 | 59 | /** 60 | * Get the total number of user followers. 61 | * 62 | * @return user observable 63 | */ 64 | @PUT("/shared") 65 | Observable putSharedLinks( 66 | @Query("groupId") ArrayList groupIds, @Query("userId") String userId); 67 | } 68 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/service/InstagramAuthService.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.service; 2 | 3 | import com.shareyourproxy.api.domain.model.InstagramAuthResponse; 4 | 5 | import retrofit.http.Multipart; 6 | import retrofit.http.POST; 7 | import retrofit.http.Part; 8 | import rx.Observable; 9 | 10 | /** 11 | * Get the access token 12 | */ 13 | public interface InstagramAuthService { 14 | @Multipart 15 | @POST("/access_token") 16 | Observable getAuth( 17 | @Part("client_id") String clientId, 18 | @Part("client_secret") String clientSecret, 19 | @Part("grant_type") String grantType, 20 | @Part("redirect_uri") String redirectUri, 21 | @Part("code") String code); 22 | } 23 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/service/InstagramUserService.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.service; 2 | 3 | import com.shareyourproxy.api.domain.model.InstagramUser; 4 | 5 | import retrofit.http.GET; 6 | import retrofit.http.Path; 7 | import retrofit.http.Query; 8 | import rx.Observable; 9 | 10 | /** 11 | * Instagram user api. 12 | */ 13 | public interface InstagramUserService { 14 | @GET("/users/{user_id}") 15 | Observable getUser( 16 | @Path("user_id") String userId, 17 | @Query("access_token") String accessToken); 18 | } 19 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/service/MessageService.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.service; 2 | 3 | 4 | import com.shareyourproxy.api.domain.model.Message; 5 | 6 | import java.util.HashMap; 7 | 8 | import retrofit.http.Body; 9 | import retrofit.http.DELETE; 10 | import retrofit.http.GET; 11 | import retrofit.http.PUT; 12 | import retrofit.http.Path; 13 | import rx.Observable; 14 | 15 | /** 16 | * Service to get and update messages. 17 | */ 18 | public interface MessageService { 19 | @GET("/messages/{userId}.json") 20 | Observable> getUserMessages(@Path("userId") String userId); 21 | 22 | @PUT("/messages/{userId}.json") 23 | Observable> addUserMessage( 24 | @Path("userId") String userId, @Body HashMap message); 25 | 26 | @DELETE("/messages/{userId}.json") 27 | Observable deleteAllUserMessages(@Path("userId") String userId); 28 | } 29 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/service/SharedLinkService.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.service; 2 | 3 | import com.shareyourproxy.api.domain.model.SharedLink; 4 | 5 | import java.util.HashMap; 6 | 7 | import retrofit.http.Body; 8 | import retrofit.http.DELETE; 9 | import retrofit.http.GET; 10 | import retrofit.http.PUT; 11 | import retrofit.http.Path; 12 | import rx.Observable; 13 | 14 | /** 15 | * Add and remove {@link SharedLink}s. 16 | */ 17 | public interface SharedLinkService { 18 | 19 | @GET("/shared.json") 20 | Observable> getSharedLinks(); 21 | 22 | /** 23 | * add a {@link SharedLink} 24 | * 25 | * @param sharedId shared link identifier 26 | */ 27 | @PUT("/shared/{sharedId}.json") 28 | Observable addSharedLink(@Path("sharedId") String sharedId, @Body SharedLink link); 29 | 30 | @DELETE("/shared/{sharedId}.json") 31 | Observable deleteSharedLink(@Path("sharedId") String sharedId); 32 | } 33 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/service/SpotifyAuthService.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.service; 2 | 3 | import com.shareyourproxy.api.domain.model.SpotifyAuthResponse; 4 | 5 | import retrofit.http.Field; 6 | import retrofit.http.FormUrlEncoded; 7 | import retrofit.http.Header; 8 | import retrofit.http.Headers; 9 | import retrofit.http.POST; 10 | import rx.Observable; 11 | 12 | /** 13 | * Created by Evan on 8/14/15. 14 | */ 15 | public interface SpotifyAuthService { 16 | @FormUrlEncoded 17 | @POST("/token") 18 | @Headers({ "Authorization: Basic {authCode}" }) 19 | Observable getAuth( 20 | @Header("authCode") String authHeader, 21 | @Field("grant_type") String grantType, 22 | @Field("code") String code, 23 | @Field("redirect_uri") String redirectUri); 24 | 25 | @POST("/token") 26 | @FormUrlEncoded 27 | Observable getAuth( 28 | @Field("client_id") String clientId, 29 | @Field("client_secret") String clientSecret, 30 | @Field("grant_type") String grantType, 31 | @Field("code") String code, 32 | @Field("redirect_uri") String redirectUri); 33 | } 34 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/service/SpotifyUserService.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.service; 2 | 3 | import com.shareyourproxy.api.domain.model.SpotifyUser; 4 | 5 | import retrofit.http.GET; 6 | import retrofit.http.Header; 7 | import retrofit.http.Headers; 8 | import rx.Observable; 9 | 10 | /** 11 | * Created by Evan on 8/14/15. 12 | */ 13 | public interface SpotifyUserService { 14 | @GET("/me/") 15 | @Headers({ "Accept: application/json", "Content-Type: application/json", 16 | "Authorization: Bearer {authToken}" }) 17 | Observable getUser(@Header("authToken") String authToken); 18 | } 19 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/service/TwitterUserService.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.service; 2 | 3 | import com.twitter.sdk.android.core.models.Tweet; 4 | 5 | import java.util.List; 6 | 7 | import retrofit.http.GET; 8 | import retrofit.http.Query; 9 | import rx.Observable; 10 | 11 | /** 12 | * Twitter OAuthed Service request {https://dev.twitter .com/rest/reference/get/statuses/user_timeline}. 13 | */ 14 | public interface TwitterUserService { 15 | 16 | @GET("/1.1/statuses/user_timeline.json?" + 17 | "trim_user=true&include_rts=false&contributor_details=false") 18 | Observable> getUserTimeline( 19 | @Query("user_id") Long userId, 20 | @Query("count") Long count, 21 | @Query("since_id") Long sinceId, 22 | @Query("max_id") Long maxId); 23 | 24 | @GET("/1.1/statuses/user_timeline.json?" + 25 | "trim_user=true&include_rts=false&contributor_details=false") 26 | Observable> getUserTimeline( 27 | @Query("user_id") Long userId, 28 | @Query("count") Long count); 29 | } 30 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/service/UserChannelService.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.service; 2 | 3 | import com.shareyourproxy.api.domain.model.Channel; 4 | import com.shareyourproxy.api.domain.model.User; 5 | 6 | import java.util.HashMap; 7 | 8 | import retrofit.http.Body; 9 | import retrofit.http.DELETE; 10 | import retrofit.http.PUT; 11 | import retrofit.http.Path; 12 | import rx.Observable; 13 | 14 | /** 15 | * Created by Evan on 5/15/15. 16 | */ 17 | public interface UserChannelService { 18 | /** 19 | * add a {@link Channel}. 20 | * 21 | * @param userId unique id for {@link User} table 22 | */ 23 | @PUT("/users/{userId}/channels/{channelId}.json") 24 | Observable addUserChannel( 25 | @Path("userId") String userId, @Path("channelId") String channelId, @Body Channel channel); 26 | 27 | /** 28 | * add multiple {@link Channel}s. 29 | * 30 | * @param userId unique id for {@link User} table 31 | */ 32 | @PUT("/users/{userId}/channels.json") 33 | Observable> addUserChannels( 34 | @Path("userId") String userId, @Body HashMap channel); 35 | 36 | @DELETE("/users/{userId}/channels/{channelId}.json") 37 | Observable deleteUserChannel( 38 | @Path("userId") String userId, @Path("channelId") String channelId); 39 | } 40 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/service/UserContactService.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.service; 2 | 3 | import com.shareyourproxy.api.domain.model.User; 4 | 5 | import retrofit.http.Body; 6 | import retrofit.http.DELETE; 7 | import retrofit.http.PUT; 8 | import retrofit.http.Path; 9 | import rx.Observable; 10 | 11 | /** 12 | * Pokemon that a user wants to collect. 13 | */ 14 | public interface UserContactService { 15 | /** 16 | * add a User contact id. 17 | * 18 | * @param userId unique id for {@link User} table 19 | */ 20 | @PUT("/users/{userId}/contacts.json") 21 | Observable addUserContact( 22 | @Path("userId") String userId, @Body String contactId); 23 | 24 | @DELETE("/users/{userId}/contacts/{contactId}.json") 25 | Observable deleteUserContact( 26 | @Path("userId") String userId, @Path("contactId") String contactId); 27 | 28 | } 29 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/service/UserGroupService.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.service; 2 | 3 | import com.shareyourproxy.api.domain.model.Group; 4 | 5 | import java.util.HashMap; 6 | 7 | import retrofit.http.Body; 8 | import retrofit.http.DELETE; 9 | import retrofit.http.PUT; 10 | import retrofit.http.Path; 11 | import rx.Observable; 12 | 13 | /** 14 | * Group services for {@link Group}s. 15 | */ 16 | public interface UserGroupService { 17 | 18 | @PUT("/users/{userId}/groups.json") 19 | Observable updateUserGroups( 20 | @Path("userId") String userId, @Body HashMap group); 21 | 22 | @PUT("/users/{userId}/groups/{groupId}.json") 23 | Observable addUserGroup( 24 | @Path("userId") String userId, @Path("groupId") String groupId, @Body Group group); 25 | 26 | @DELETE("/users/{userId}/groups/{groupId}.json") 27 | Observable deleteUserGroup( 28 | @Path("userId") String userId, @Path("groupId") String groupId); 29 | } 30 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/api/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.service; 2 | 3 | 4 | import com.shareyourproxy.api.domain.model.User; 5 | 6 | import java.util.HashMap; 7 | 8 | import retrofit.http.Body; 9 | import retrofit.http.GET; 10 | import retrofit.http.PUT; 11 | import retrofit.http.Path; 12 | import rx.Observable; 13 | 14 | /** 15 | * User Observable. 16 | */ 17 | @SuppressWarnings("unused") 18 | public interface UserService { 19 | /** 20 | * Return a list of users. 21 | * 22 | * @return user observable 23 | */ 24 | @GET("/users.json") 25 | Observable> listUsers(); 26 | 27 | /** 28 | * Get a specific user. 29 | * 30 | * @param userId user unique identifier 31 | * @return user 32 | */ 33 | @GET("/users/{id}.json") 34 | Observable getUser(@Path("id") String userId); 35 | 36 | /** 37 | * Save a user. 38 | * 39 | * @param userId unique id for {@link User} table 40 | * @param user {@link User} data 41 | */ 42 | @PUT("/users/{id}.json") 43 | Observable updateUser(@Path("id") String userId, @Body User user); 44 | 45 | /** 46 | * Save a user. 47 | * 48 | * @param userId unique id for {@link User} table 49 | */ 50 | @PUT("/users/{id}/version.json") 51 | Observable updateUserVersion( 52 | @Path("id") String userId, 53 | @Body Integer version); 54 | } 55 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/app/AboutActivity.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.app; 2 | 3 | import android.os.Bundle; 4 | import android.view.MenuItem; 5 | 6 | import com.shareyourproxy.R; 7 | import com.shareyourproxy.app.fragment.AboutFragment; 8 | 9 | import timber.log.Timber; 10 | 11 | /** 12 | * Display an {@link AboutFragment} that has an Apache II license for this project. 13 | */ 14 | public class AboutActivity extends BaseActivity { 15 | 16 | @Override 17 | protected void onCreate(Bundle savedInstanceState) { 18 | super.onCreate(savedInstanceState); 19 | setContentView(R.layout.activity_about); 20 | if (savedInstanceState == null) { 21 | getSupportFragmentManager().beginTransaction() 22 | .replace(R.id.activity_about_container, 23 | AboutFragment.newInstance()).commit(); 24 | } 25 | } 26 | 27 | @Override 28 | public boolean onOptionsItemSelected(MenuItem item) { 29 | switch (item.getItemId()) { 30 | case android.R.id.home: 31 | onBackPressed(); 32 | break; 33 | default: 34 | Timber.e("Menu Item ID unknown"); 35 | break; 36 | } 37 | return false; 38 | } 39 | 40 | @Override 41 | public void onBackPressed() { 42 | finish(); 43 | overridePendingTransition(R.anim.fade_in, R.anim.slide_out_bottom); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/app/GroupContactsActivity.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.app; 2 | 3 | import android.os.Bundle; 4 | import android.view.MenuItem; 5 | 6 | import com.shareyourproxy.R; 7 | import com.shareyourproxy.app.fragment.GroupContactsFragment; 8 | 9 | import timber.log.Timber; 10 | 11 | /** 12 | * Activity to display the contacts that a user has saved in a selected group. 13 | */ 14 | public class GroupContactsActivity extends BaseActivity { 15 | @Override 16 | protected void onCreate(Bundle savedInstanceState) { 17 | super.onCreate(savedInstanceState); 18 | if (savedInstanceState == null) { 19 | getSupportFragmentManager().beginTransaction() 20 | .replace(android.R.id.content, 21 | GroupContactsFragment.newInstance()).commit(); 22 | } 23 | } 24 | 25 | @Override 26 | public boolean onOptionsItemSelected(MenuItem item) { 27 | switch (item.getItemId()) { 28 | case android.R.id.home: 29 | onBackPressed(); 30 | break; 31 | default: 32 | Timber.e("Menu Item ID unknown"); 33 | break; 34 | } 35 | return false; 36 | } 37 | 38 | @Override 39 | public void onBackPressed() { 40 | finish(); 41 | overridePendingTransition(R.anim.fade_in, R.anim.slide_out_bottom); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/app/IntroductionActivity.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.app; 2 | 3 | import android.os.Bundle; 4 | 5 | import com.firebase.client.AuthData; 6 | import com.google.android.gms.common.ConnectionResult; 7 | import com.google.android.gms.common.api.GoogleApiClient; 8 | import com.shareyourproxy.app.fragment.MainIntroductionFragment; 9 | 10 | import timber.log.Timber; 11 | 12 | /** 13 | * Created by Evan on 9/21/15. 14 | */ 15 | public class IntroductionActivity extends GoogleApiActivity { 16 | 17 | private GoogleApiClient _googleApiClient; 18 | 19 | @Override 20 | protected void onCreate(Bundle savedInstanceState) { 21 | super.onCreate(savedInstanceState); 22 | _googleApiClient = getGoogleApiClient(); 23 | if (savedInstanceState == null) { 24 | MainIntroductionFragment mainFragment = MainIntroductionFragment.newInstance(); 25 | getSupportFragmentManager().beginTransaction() 26 | .replace(android.R.id.content, mainFragment) 27 | .commit(); 28 | } 29 | } 30 | 31 | @Override 32 | public void onAuthenticated(AuthData authData) { 33 | } 34 | 35 | @Override 36 | public void onAuthenticationError(Throwable e) { 37 | } 38 | 39 | @Override 40 | public void onConnected(Bundle bundle) { 41 | Timber.i("Connected to G+"); 42 | } 43 | 44 | @Override 45 | public void onConnectionSuspended(int i) { 46 | _googleApiClient.connect(); 47 | } 48 | 49 | @Override 50 | public void onConnectionFailed(ConnectionResult connectionResult) { 51 | _googleApiClient.connect(); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/app/SearchActivity.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.app; 2 | 3 | import android.os.Bundle; 4 | import android.support.v4.app.ActivityCompat; 5 | 6 | import com.shareyourproxy.app.fragment.SearchFragment; 7 | 8 | /** 9 | * Activity to handle displaying contacts and searching for new ones. 10 | */ 11 | public class SearchActivity extends BaseActivity { 12 | 13 | @Override 14 | protected void onCreate(Bundle savedInstanceState) { 15 | super.onCreate(savedInstanceState); 16 | preventStatusBarFlash(this); 17 | if (savedInstanceState == null) { 18 | SearchFragment searchFragment = SearchFragment.newInstance(); 19 | getSupportFragmentManager().beginTransaction() 20 | .replace(android.R.id.content, searchFragment).commit(); 21 | } 22 | } 23 | 24 | @Override 25 | public void onBackPressed() { 26 | super.onBackPressed(); 27 | ActivityCompat.finishAfterTransition(this); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/app/dialog/BaseDialogFragment.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.app.dialog; 2 | 3 | import android.content.SharedPreferences; 4 | import android.support.annotation.NonNull; 5 | import android.support.v4.app.DialogFragment; 6 | import android.widget.Button; 7 | 8 | import com.shareyourproxy.api.domain.model.User; 9 | import com.shareyourproxy.api.rx.RxBusDriver; 10 | import com.shareyourproxy.app.BaseActivity; 11 | 12 | /** 13 | * Base Dialog Abstraction. 14 | */ 15 | public class BaseDialogFragment extends DialogFragment { 16 | /** 17 | * Sets the color of button input. 18 | * 19 | * @param button Button 20 | * @param color integer value of color. 21 | */ 22 | public void setButtonTint(@NonNull Button button, int color) { 23 | button.setTextColor(color); 24 | } 25 | 26 | /** 27 | * Get the currently logged in user. 28 | * 29 | * @return logged in user 30 | */ 31 | public User getLoggedInUser() { 32 | return ((BaseActivity) getActivity()).getLoggedInUser(); 33 | } 34 | 35 | /** 36 | * Get this applications Observable event bus. 37 | * 38 | * @return 39 | */ 40 | public RxBusDriver getRxBus() { 41 | return ((BaseActivity) getActivity()).getRxBus(); 42 | } 43 | 44 | 45 | /** 46 | * Get this applications Observable event bus. 47 | * 48 | * @return 49 | */ 50 | public SharedPreferences getSharedPreferences() { 51 | return ((BaseActivity) getActivity()).getSharedPreferences(); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/app/fragment/AboutFragment.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.app.fragment; 2 | 3 | import android.annotation.SuppressLint; 4 | import android.os.Bundle; 5 | import android.support.v4.app.Fragment; 6 | import android.support.v7.widget.Toolbar; 7 | import android.view.LayoutInflater; 8 | import android.view.View; 9 | import android.view.ViewGroup; 10 | 11 | import com.shareyourproxy.R; 12 | import com.shareyourproxy.app.AboutActivity; 13 | 14 | import butterknife.Bind; 15 | import butterknife.ButterKnife; 16 | 17 | /** 18 | * Show an Apache II License for this project. 19 | */ 20 | public class AboutFragment extends BaseFragment { 21 | @Bind(R.id.fragment_about_toolbar) 22 | Toolbar toolbar; 23 | 24 | /** 25 | * Return a new instance of this fragment for the parent {@link AboutActivity}. 26 | * 27 | * @return AboutFragment 28 | */ 29 | public static Fragment newInstance() { 30 | return new AboutFragment(); 31 | } 32 | 33 | @Override 34 | @SuppressLint("InflateParams") 35 | public View onCreateView( 36 | LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { 37 | View rootView = inflater.inflate(R.layout.fragment_about, null, false); 38 | ButterKnife.bind(this, rootView); 39 | buildToolbar(toolbar, getString(R.string.about), null); 40 | return rootView; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/app/fragment/FirstIntroductionFragment.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.app.fragment; 2 | 3 | import android.os.Bundle; 4 | import android.view.LayoutInflater; 5 | import android.view.View; 6 | import android.view.ViewGroup; 7 | import android.widget.ImageView; 8 | import android.widget.TextView; 9 | 10 | import com.shareyourproxy.R; 11 | 12 | import butterknife.Bind; 13 | import butterknife.BindDimen; 14 | import butterknife.BindString; 15 | import butterknife.ButterKnife; 16 | 17 | /** 18 | * First introduction slide content. 19 | */ 20 | public class FirstIntroductionFragment extends BaseIntroductionFragment { 21 | @BindDimen(R.dimen.common_svg_xlarge) 22 | int logoSize; 23 | @BindString(R.string.slide_one_title) 24 | String introTitle; 25 | @BindString(R.string.slide_one_body) 26 | String introBody; 27 | @Bind(R.id.fragment_introduction_first_imageview) 28 | ImageView imageView; 29 | @Bind(R.id.fragment_introduction_first_textview) 30 | TextView textView; 31 | 32 | /** 33 | * Default Constructor. 34 | */ 35 | public FirstIntroductionFragment() { 36 | } 37 | 38 | public static FirstIntroductionFragment newInstance() { 39 | return new FirstIntroductionFragment(); 40 | } 41 | 42 | @Override 43 | public View onCreateView( 44 | LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { 45 | View rootView = inflater.inflate(R.layout.fragment_introduction_first, container, false); 46 | ButterKnife.bind(this, rootView); 47 | drawSlide(getActivity(), imageView, textView, R.raw.ic_guide_activity_slide1, logoSize, 48 | introTitle, introBody); 49 | return rootView; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/app/fragment/SecondIntroductionFragment.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.app.fragment; 2 | 3 | import android.os.Bundle; 4 | import android.view.LayoutInflater; 5 | import android.view.View; 6 | import android.view.ViewGroup; 7 | import android.widget.ImageView; 8 | import android.widget.TextView; 9 | 10 | import com.shareyourproxy.R; 11 | 12 | import butterknife.Bind; 13 | import butterknife.BindDimen; 14 | import butterknife.BindString; 15 | import butterknife.ButterKnife; 16 | 17 | /** 18 | * Second introduction slide content. 19 | */ 20 | public class SecondIntroductionFragment extends BaseIntroductionFragment { 21 | @BindDimen(R.dimen.common_svg_xlarge) 22 | int logoSize; 23 | @BindString(R.string.slide_two_title) 24 | String introTitle; 25 | @BindString(R.string.slide_two_body) 26 | String introBody; 27 | @Bind(R.id.fragment_introduction_second_imageview) 28 | ImageView imageView; 29 | @Bind(R.id.fragment_introduction_second_textview) 30 | TextView textView; 31 | 32 | /** 33 | * Default Constructor. 34 | */ 35 | public SecondIntroductionFragment() { 36 | } 37 | 38 | public static SecondIntroductionFragment newInstance() { 39 | return new SecondIntroductionFragment(); 40 | } 41 | 42 | @Override 43 | public View onCreateView( 44 | LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { 45 | View rootView = inflater.inflate(R.layout.fragment_introduction_second, container, false); 46 | ButterKnife.bind(this, rootView); 47 | drawSlide(getActivity(), imageView, textView, R.raw.ic_guide_activity_slide2, logoSize, 48 | introTitle, introBody); 49 | return rootView; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/app/fragment/ThirdIntroductionFragment.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.app.fragment; 2 | 3 | import android.os.Bundle; 4 | import android.view.LayoutInflater; 5 | import android.view.View; 6 | import android.view.ViewGroup; 7 | import android.widget.ImageView; 8 | import android.widget.TextView; 9 | 10 | import com.shareyourproxy.R; 11 | 12 | import butterknife.Bind; 13 | import butterknife.BindDimen; 14 | import butterknife.BindString; 15 | import butterknife.ButterKnife; 16 | 17 | /** 18 | * Third introduction slide content. 19 | */ 20 | public class ThirdIntroductionFragment extends BaseIntroductionFragment { 21 | @BindDimen(R.dimen.common_svg_xxlarge) 22 | int logoSize; 23 | @BindString(R.string.slide_three_title) 24 | String introTitle; 25 | @BindString(R.string.slide_three_body) 26 | String introBody; 27 | @Bind(R.id.fragment_introduction_third_imageview) 28 | ImageView imageView; 29 | @Bind(R.id.fragment_introduction_third_textview) 30 | TextView textView; 31 | 32 | /** 33 | * Default Constructor. 34 | */ 35 | public ThirdIntroductionFragment() { 36 | } 37 | 38 | public static ThirdIntroductionFragment newInstance() { 39 | return new ThirdIntroductionFragment(); 40 | } 41 | 42 | @Override 43 | public View onCreateView( 44 | LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { 45 | View rootView = inflater.inflate(R.layout.fragment_introduction_third, container, false); 46 | ButterKnife.bind(this, rootView); 47 | drawSlide(getActivity(), imageView, textView, R.raw.ic_guide_activity_slide3, logoSize, 48 | introTitle, introBody); 49 | return rootView; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/util/ObjectUtils.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.util; 2 | 3 | import java.text.SimpleDateFormat; 4 | import java.util.Locale; 5 | 6 | import static java.lang.Character.toTitleCase; 7 | import static java.lang.String.valueOf; 8 | 9 | /** 10 | * Helper class for formatting objects. 11 | */ 12 | public class ObjectUtils { 13 | 14 | /** 15 | * Private Constructor. 16 | */ 17 | private ObjectUtils() { 18 | super(); 19 | } 20 | 21 | public static String buildFullName(String firstName, String lastName) { 22 | return new StringBuilder(capitalize(firstName)) 23 | .append(" ") 24 | .append(capitalize(lastName)) 25 | .toString().trim(); 26 | } 27 | 28 | /** 29 | * Compare two ints. 30 | * 31 | * @param lhs left item 32 | * @param rhs right item 33 | * @return left right or equal 34 | */ 35 | public static int compare(int lhs, int rhs) { 36 | return lhs < rhs ? -1 : (lhs == rhs ? 0 : 1); 37 | } 38 | 39 | public static String capitalize(String string) { 40 | if (string == null || string.length() == 0) { 41 | return ""; 42 | } 43 | StringBuilder sb = new StringBuilder(valueOf(toTitleCase(string.charAt(0)))) 44 | .append(string.substring(1)); 45 | return sb.toString(); 46 | } 47 | 48 | public static SimpleDateFormat getTwitterDateFormat() { 49 | return new SimpleDateFormat("EEE MMM dd HH:mm:ss ZZZZZ yyyy", Locale.US); 50 | } 51 | 52 | /** 53 | * Get a formatted TAG string. 54 | * 55 | * @param klass the class to copy a TAG for 56 | * @return return the TAG String 57 | */ 58 | public static String getSimpleName(Class klass) { 59 | return klass.getSimpleName(); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Application/src/main/java/com/shareyourproxy/widget/ContentDescriptionDrawable.java: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.widget; 2 | 3 | import android.content.res.Resources; 4 | import android.graphics.Bitmap; 5 | import android.graphics.drawable.BitmapDrawable; 6 | 7 | /** 8 | * This BitmapDrawable has a name. For now this functionality is being used to display the {@link ContentDescriptionDrawable#_contentDescription} in a Toast 9 | * when a user long presses a tab {@link android.support.design.widget.TabLayout}. 10 | */ 11 | public class ContentDescriptionDrawable extends BitmapDrawable { 12 | private String _contentDescription = ""; 13 | 14 | /** 15 | * Create an image from a bitmap, setting initial target density based on the display metrics of the resources. 16 | * 17 | * @param res display metrics 18 | * @param bmp Bitmap 19 | */ 20 | public ContentDescriptionDrawable(Resources res, Bitmap bmp) { 21 | super(res, bmp); 22 | } 23 | 24 | /** 25 | * Getter. 26 | * 27 | * @return content description 28 | */ 29 | public String getContentDescription() { 30 | return _contentDescription; 31 | } 32 | 33 | /** 34 | * Setter. 35 | * 36 | * @param contentDescription description of image.drawable 37 | * @return this 38 | */ 39 | public ContentDescriptionDrawable setContentDescription(String contentDescription) { 40 | this._contentDescription = contentDescription; 41 | return this; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /Application/src/main/kotlin/com/shareyourproxy/api/rx/RxBusDriver.kt: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.rx 2 | 3 | import android.os.Parcel 4 | import android.os.Parcelable 5 | import rx.Observable 6 | import rx.subjects.PublishSubject 7 | import rx.subjects.SerializedSubject 8 | import timber.log.Timber 9 | 10 | /** 11 | * A singleton pattern intended to store an instance in the [ProxyApplication] that allows one 12 | * to easily send messages over this [PublishSubject] Bus. 13 | */ 14 | object RxBusDriver : Parcelable { 15 | val CREATOR: Parcelable.Creator = object : Parcelable.Creator { 16 | override fun createFromParcel(parcelIn: Parcel): RxBusDriver { 17 | return this@RxBusDriver 18 | } 19 | 20 | override fun newArray(size: Int): Array { 21 | return Array(size, { i -> this@RxBusDriver }) 22 | } 23 | } 24 | 25 | private val _rxBus = SerializedSubject(PublishSubject.create()) 26 | 27 | fun toObservable(): Observable { 28 | return _rxBus.onBackpressureLatest().compose(RxHelper.observeMain()) 29 | } 30 | 31 | fun toIOThreadObservable(): Observable { 32 | return _rxBus.onBackpressureLatest().compose(RxHelper.observeIO()) 33 | } 34 | 35 | /** 36 | * Post an event on [PublishSubject]. 37 | 38 | * @param event event object. 39 | */ 40 | fun post(event: Any) { 41 | Timber.i("Event Posted: ${event.toString()}") 42 | _rxBus.onNext(event) 43 | } 44 | 45 | override fun describeContents(): Int { 46 | return 0 47 | } 48 | 49 | override fun writeToParcel(dest: Parcel, flags: Int) { 50 | } 51 | } 52 | 53 | -------------------------------------------------------------------------------- /Application/src/main/kotlin/com/shareyourproxy/api/rx/RxTextWatcherSubject.kt: -------------------------------------------------------------------------------- 1 | package com.shareyourproxy.api.rx 2 | 3 | import rx.Observable 4 | import rx.android.schedulers.AndroidSchedulers 5 | import rx.schedulers.Schedulers 6 | import rx.subjects.PublishSubject 7 | import rx.subjects.SerializedSubject 8 | import java.util.concurrent.TimeUnit 9 | 10 | /** 11 | * Created by Evan on 5/21/15. 12 | */ 13 | object RxTextWatcherSubject { 14 | private val _rxBus = SerializedSubject(PublishSubject.create()) 15 | fun toObserverable(): Observable { 16 | return _rxBus.debounce(500, TimeUnit.MILLISECONDS, Schedulers.io()) 17 | .onBackpressureLatest() 18 | .observeOn(AndroidSchedulers.mainThread()) 19 | } 20 | 21 | /** 22 | * Post an event on [PublishSubject]. 23 | * @param searchText String. 24 | */ 25 | fun post(searchText: String) { 26 | _rxBus.onNext(searchText) 27 | } 28 | } -------------------------------------------------------------------------------- /Application/src/main/res/images/anim/fade_in.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | -------------------------------------------------------------------------------- /Application/src/main/res/images/anim/fade_out.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | -------------------------------------------------------------------------------- /Application/src/main/res/images/anim/slide_in_bottom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 14 | -------------------------------------------------------------------------------- /Application/src/main/res/images/anim/slide_out_bottom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 14 | -------------------------------------------------------------------------------- /Application/src/main/res/images/drawable-v21/ripple.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | -------------------------------------------------------------------------------- /Application/src/main/res/images/drawable-v21/selector_button_blue.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 7 | 8 | 9 | 10 | 11 | 12 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Application/src/main/res/images/drawable-v21/selector_button_grey.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 7 | 8 | 9 | 10 | 11 | 12 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Application/src/main/res/images/drawable-v21/selector_contactsearchlayout.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 7 | 8 | 9 | 10 | 11 | 12 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Application/src/main/res/images/drawable-v21/selector_whitebox_darkclick.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Application/src/main/res/images/drawable/ripple.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Application/src/main/res/images/drawable/selector_button_blue.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | 11 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /Application/src/main/res/images/drawable/selector_button_grey.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | 11 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /Application/src/main/res/images/drawable/selector_contactsearchlayout.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | 11 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /Application/src/main/res/images/drawable/selector_whitebox_darkclick.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Application/src/main/res/images/mipmap-hdpi/ic_proxy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProxyApp/Proxy/bd7205fc3c329dc05525541c107c6ec3e48994a6/Application/src/main/res/images/mipmap-hdpi/ic_proxy.png -------------------------------------------------------------------------------- /Application/src/main/res/images/mipmap-hdpi/ic_proxy_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProxyApp/Proxy/bd7205fc3c329dc05525541c107c6ec3e48994a6/Application/src/main/res/images/mipmap-hdpi/ic_proxy_notification.png -------------------------------------------------------------------------------- /Application/src/main/res/images/mipmap-mdpi/ic_proxy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProxyApp/Proxy/bd7205fc3c329dc05525541c107c6ec3e48994a6/Application/src/main/res/images/mipmap-mdpi/ic_proxy.png -------------------------------------------------------------------------------- /Application/src/main/res/images/mipmap-mdpi/ic_proxy_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProxyApp/Proxy/bd7205fc3c329dc05525541c107c6ec3e48994a6/Application/src/main/res/images/mipmap-mdpi/ic_proxy_notification.png -------------------------------------------------------------------------------- /Application/src/main/res/images/mipmap-xhdpi/ic_proxy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProxyApp/Proxy/bd7205fc3c329dc05525541c107c6ec3e48994a6/Application/src/main/res/images/mipmap-xhdpi/ic_proxy.png -------------------------------------------------------------------------------- /Application/src/main/res/images/mipmap-xhdpi/ic_proxy_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProxyApp/Proxy/bd7205fc3c329dc05525541c107c6ec3e48994a6/Application/src/main/res/images/mipmap-xhdpi/ic_proxy_notification.png -------------------------------------------------------------------------------- /Application/src/main/res/images/mipmap-xxhdpi/ic_proxy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProxyApp/Proxy/bd7205fc3c329dc05525541c107c6ec3e48994a6/Application/src/main/res/images/mipmap-xxhdpi/ic_proxy.png -------------------------------------------------------------------------------- /Application/src/main/res/images/mipmap-xxhdpi/ic_proxy_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProxyApp/Proxy/bd7205fc3c329dc05525541c107c6ec3e48994a6/Application/src/main/res/images/mipmap-xxhdpi/ic_proxy_notification.png -------------------------------------------------------------------------------- /Application/src/main/res/images/mipmap-xxxhdpi/ic_proxy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProxyApp/Proxy/bd7205fc3c329dc05525541c107c6ec3e48994a6/Application/src/main/res/images/mipmap-xxxhdpi/ic_proxy.png -------------------------------------------------------------------------------- /Application/src/main/res/images/mipmap-xxxhdpi/ic_proxy_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProxyApp/Proxy/bd7205fc3c329dc05525541c107c6ec3e48994a6/Application/src/main/res/images/mipmap-xxxhdpi/ic_proxy_notification.png -------------------------------------------------------------------------------- /Application/src/main/res/images/raw/ic_account_circle.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 8 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Application/src/main/res/images/raw/ic_add.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Application/src/main/res/images/raw/ic_address.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Application/src/main/res/images/raw/ic_arrow_back.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Application/src/main/res/images/raw/ic_bug_report.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 10 | 11 | -------------------------------------------------------------------------------- /Application/src/main/res/images/raw/ic_call.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 8 | 9 | -------------------------------------------------------------------------------- /Application/src/main/res/images/raw/ic_chevron_right.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Application/src/main/res/images/raw/ic_clear.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Application/src/main/res/images/raw/ic_done.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Application/src/main/res/images/raw/ic_ello.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Application/src/main/res/images/raw/ic_email.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 7 | 8 | -------------------------------------------------------------------------------- /Application/src/main/res/images/raw/ic_exit_to_app.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 8 | 9 | -------------------------------------------------------------------------------- /Application/src/main/res/images/raw/ic_explore.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Application/src/main/res/images/raw/ic_facebook.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 7 | 8 | -------------------------------------------------------------------------------- /Application/src/main/res/images/raw/ic_facebook_messenger.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Application/src/main/res/images/raw/ic_flash_on.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Application/src/main/res/images/raw/ic_google_hangouts.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /Application/src/main/res/images/raw/ic_google_plus.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 14 | 15 | -------------------------------------------------------------------------------- /Application/src/main/res/images/raw/ic_group.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 8 | 9 | -------------------------------------------------------------------------------- /Application/src/main/res/images/raw/ic_groups.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 8 | 9 | -------------------------------------------------------------------------------- /Application/src/main/res/images/raw/ic_info_outline.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 8 | 9 | -------------------------------------------------------------------------------- /Application/src/main/res/images/raw/ic_instagram.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /Application/src/main/res/images/raw/ic_link.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 8 | 9 | -------------------------------------------------------------------------------- /Application/src/main/res/images/raw/ic_linkedin.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 9 | 11 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /Application/src/main/res/images/raw/ic_local_play.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /Application/src/main/res/images/raw/ic_lol.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Application/src/main/res/images/raw/ic_medium.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Application/src/main/res/images/raw/ic_menu.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Application/src/main/res/images/raw/ic_nintendo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 9 | 10 | 11 | 14 | 15 | 16 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /Application/src/main/res/images/raw/ic_periscope.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 8 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Application/src/main/res/images/raw/ic_playstation.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 11 | 13 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /Application/src/main/res/images/raw/ic_share.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 10 | 11 | -------------------------------------------------------------------------------- /Application/src/main/res/images/raw/ic_skype.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Application/src/main/res/images/raw/ic_slack.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 9 | 11 | 13 | 14 | 15 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /Application/src/main/res/images/raw/ic_sms.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 7 | 8 | -------------------------------------------------------------------------------- /Application/src/main/res/images/raw/ic_star.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Application/src/main/res/images/raw/ic_steam.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Application/src/main/res/images/raw/ic_tumblr.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Application/src/main/res/images/raw/ic_twitch.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Application/src/main/res/images/raw/ic_twitter.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /Application/src/main/res/images/raw/ic_venmo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Application/src/main/res/images/raw/ic_whatsapp.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 26 | -------------------------------------------------------------------------------- /Application/src/main/res/images/raw/ic_yo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 10 | 14 | 17 | 18 | -------------------------------------------------------------------------------- /Application/src/main/res/images/raw/ic_youtube.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Application/src/main/res/layouts/activity/layout/activity_about.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | -------------------------------------------------------------------------------- /Application/src/main/res/layouts/activity/layout/activity_login.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 17 | 18 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Application/src/main/res/layouts/adapter/layout/adapter_add_channel_list_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 18 | 19 | 27 | 28 | 36 | 37 | -------------------------------------------------------------------------------- /Application/src/main/res/layouts/adapter/layout/adapter_channel_view_content.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 17 | 18 | 32 | 33 | 41 | -------------------------------------------------------------------------------- /Application/src/main/res/layouts/adapter/layout/adapter_dismissible_notification.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | -------------------------------------------------------------------------------- /Application/src/main/res/layouts/adapter/layout/adapter_drawer_header.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 13 | 14 | 15 | 23 | 24 | 33 | 34 | -------------------------------------------------------------------------------- /Application/src/main/res/layouts/adapter/layout/adapter_drawer_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 20 | 21 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Application/src/main/res/layouts/adapter/layout/adapter_edit_group_channel_footer.xml: -------------------------------------------------------------------------------- 1 | 2 |