Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated some things #154

Closed
wants to merge 11 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 50 additions & 49 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -96,80 +96,81 @@ repositories {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
testCompile 'junit:junit:4.12'

// compile "com.android.support:support-annotations:${ANDROID_SUPPORT_VERSION}"

compile "com.android.support:support-v4:${ANDROID_SUPPORT_VERSION}"
// compile "com.android.support:support-v13:${ANDROID_SUPPORT_VERSION}"
compile "com.android.support:appcompat-v7:${ANDROID_SUPPORT_VERSION}"
compile "com.android.support:recyclerview-v7:${ANDROID_SUPPORT_VERSION}"
compile "com.android.support:design:${ANDROID_SUPPORT_VERSION}"
compile "com.android.support:cardview-v7:${ANDROID_SUPPORT_VERSION}"
compile "com.android.support:support-vector-drawable:${ANDROID_SUPPORT_VERSION}"
compile "com.android.support:preference-v7:${ANDROID_SUPPORT_VERSION}"
compile "com.android.support:preference-v14:${ANDROID_SUPPORT_VERSION}"
compile "com.android.support:customtabs:${ANDROID_SUPPORT_VERSION}"

compile "com.android.support.constraint:constraint-layout:${CONSTRAINT_VERSION}"
// compile "com.android.support:multidex:${MULTIDEX_VERSION}"

compile "com.thirtydegreesray:dataautoaccess:${DATAAUTOACCESS_VERSION}"
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.2', {
exclude group: 'com.android.support', module: 'support-annotations' })

testImplementation 'junit:junit:4.12'

// implementation "com.android.support:support-annotations:${ANDROID_SUPPORT_VERSION}"
implementation "com.android.support:support-v4:${ANDROID_SUPPORT_VERSION}"
// implementation "com.android.support:support-v13:${ANDROID_SUPPORT_VERSION}"
implementation "com.android.support:appcompat-v7:${ANDROID_SUPPORT_VERSION}"
implementation "com.android.support:recyclerview-v7:${ANDROID_SUPPORT_VERSION}"
implementation "com.android.support:design:${ANDROID_SUPPORT_VERSION}"
implementation "com.android.support:cardview-v7:${ANDROID_SUPPORT_VERSION}"
implementation "com.android.support:support-vector-drawable:${ANDROID_SUPPORT_VERSION}"
implementation "com.android.support:preference-v7:${ANDROID_SUPPORT_VERSION}"
implementation "com.android.support:preference-v14:${ANDROID_SUPPORT_VERSION}"
implementation "com.android.support:customtabs:${ANDROID_SUPPORT_VERSION}"

implementation "com.android.support.constraint:constraint-layout:${CONSTRAINT_VERSION}"
// implementation "com.android.support:multidex:${MULTIDEX_VERSION}"

implementation "com.thirtydegreesray:dataautoaccess:${DATAAUTOACCESS_VERSION}"
annotationProcessor "com.thirtydegreesray:dataautoaccess-compiler:${DATAAUTOACCESS_VERSION}"

compile "com.jakewharton:butterknife:${BUTTERKNIFE_VERSION}"
implementation "com.jakewharton:butterknife:${BUTTERKNIFE_VERSION}"
annotationProcessor "com.jakewharton:butterknife-compiler:${BUTTERKNIFE_VERSION}"

//数据库工具
compile "org.greenrobot:greendao:${GREEN_DAO_VERSION}"
implementation "org.greenrobot:greendao:${GREEN_DAO_VERSION}"
//事件总线
compile "org.greenrobot:eventbus:${EVENT_BUS_VERSION}"
implementation "org.greenrobot:eventbus:${EVENT_BUS_VERSION}"
//文件下载

//RxJava
compile "io.reactivex:rxjava:${RXJAVA_VERSION}"
compile "io.reactivex:rxandroid:${RXJAVA_VERSION}"
implementation "io.reactivex:rxjava:${RXJAVA_VERSION}"
// implementation "io.reactivex.rxjava2:rxjava:${RXJAVA2_VERSION}"
implementation "io.reactivex:rxandroid:${RXANDROID_VERSION}"
// implementation "io.reactivex.rxjava2:rxjava:${RXANDROID_VERSION}"

//Type-safe HTTP client for Android and Java by Square, Inc.
compile "com.squareup.retrofit2:retrofit:${RETROFIT_VERSION}"
compile "com.squareup.retrofit2:converter-gson:${RETROFIT_VERSION}"
compile "com.squareup.retrofit2:adapter-rxjava:${RETROFIT_VERSION}"
compile ("com.squareup.retrofit2:converter-simplexml:${RETROFIT_VERSION}"){
implementation "com.squareup.retrofit2:retrofit:${RETROFIT_VERSION}"
implementation "com.squareup.retrofit2:converter-gson:${RETROFIT_VERSION}"
implementation "com.squareup.retrofit2:adapter-rxjava:${RETROFIT_VERSION}"
implementation ("com.squareup.retrofit2:converter-simplexml:${RETROFIT_VERSION}") {
exclude group: 'xpp3', module: 'xpp3'
exclude group: 'stax', module: 'stax-api'
exclude group: 'stax', module: 'stax'
}

//dagger依赖注入
compile "com.google.dagger:dagger:${DAGGER_VERSION}"
implementation "com.google.dagger:dagger:${DAGGER_VERSION}"
annotationProcessor "com.google.dagger:dagger-compiler:${DAGGER_VERSION}"

compile "com.tbruyelle.rxpermissions:rxpermissions:${RX_PERMISSION_VERSION}"
implementation "com.tbruyelle.rxpermissions:rxpermissions:${RX_PERMISSION_VERSION}"

compile "com.github.bumptech.glide:glide:${GLIDE_VERSION}"
implementation "com.github.bumptech.glide:glide:${GLIDE_VERSION}"
annotationProcessor "com.github.bumptech.glide:compiler:${GLIDE_VERSION}"

// compile "com.makeramen:roundedimageview:${ROUNDED_IMAGEVIEW_VERSION}"
compile "de.hdodenhof:circleimageview:${CIRCLE_IMAGEVIEW_VERSION}"
// implementation "com.makeramen:roundedimageview:${ROUNDED_IMAGEVIEW_VERSION}"
implementation "de.hdodenhof:circleimageview:${CIRCLE_IMAGEVIEW_VERSION}"

compile "com.github.GrenderG:Toasty:${TOASTY_VERSION}"
compile "com.github.daniel-stoneuk:material-about-library:${MATERIAL_ABOUT_VERSION}"
compile "com.unstoppable:submitbutton:${SUBMIT_BUTTON_VERSION}"
implementation "com.github.GrenderG:Toasty:${TOASTY_VERSION}"
implementation "com.github.daniel-stoneuk:material-about-library:${MATERIAL_ABOUT_VERSION}"
implementation "com.unstoppable:submitbutton:${SUBMIT_BUTTON_VERSION}"

compile "com.afollestad.material-dialogs:core:${MATERIAL_DIALOG_VERSION}"
compile "com.afollestad.material-dialogs:commons:${MATERIAL_DIALOG_VERSION}"
implementation "com.afollestad.material-dialogs:core:${MATERIAL_DIALOG_VERSION}"
implementation "com.afollestad.material-dialogs:commons:${MATERIAL_DIALOG_VERSION}"

compile (name: 'bugly_crashreport_upgrade-1.3.4', ext: 'aar')
compile "com.tencent.bugly:nativecrashreport:${BUGGLY_NATIVE_VERSION}"
compile "com.zzhoujay.richtext:richtext:${RICKTEXT_VERSION}"
compile 'com.zzhoujay.glideimagegetter:glideimagegetter:1.0.5'
implementation (name: 'bugly_crashreport_upgrade-1.3.5', ext: 'aar')
implementation "com.tencent.bugly:nativecrashreport:${BUGLY_NATIVE_VERSION}"
implementation "com.zzhoujay.richtext:richtext:${RICKTEXT_VERSION}"
implementation 'com.zzhoujay.glideimagegetter:glideimagegetter:1.0.5'

compile "com.orhanobut:logger:${LOGGER_VERSION}"
compile "com.timehop.stickyheadersrecyclerview:library:${STICKY_HEAD_VERSION}"
implementation "com.orhanobut:logger:${LOGGER_VERSION}"
implementation "com.timehop.stickyheadersrecyclerview:library:${STICKY_HEAD_VERSION}"

compile "org.jsoup:jsoup:${JSOUP_VERSION}"
implementation "org.jsoup:jsoup:${JSOUP_VERSION}"
}
4 changes: 2 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.thirtydegreesray.openhub">
package="com.thirtydegreesray.openhub" android:installLocation="auto">

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
Expand Down Expand Up @@ -121,4 +121,4 @@

</application>

</manifest>
</manifest>
17 changes: 7 additions & 10 deletions app/src/main/java/com/thirtydegreesray/openhub/AppApplication.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


package com.thirtydegreesray.openhub;

import android.app.Application;
Expand Down Expand Up @@ -66,14 +64,14 @@ public void onCreate() {

}

private void initLogger(){
private void initLogger() {
PrettyFormatStrategy strategy = PrettyFormatStrategy.newBuilder()
.showThreadInfo(false)
.methodCount(0)
.methodOffset(0)
.tag("OpenHub_Logger")
.build();
Logger.addLogAdapter(new AndroidLogAdapter(strategy){
Logger.addLogAdapter(new AndroidLogAdapter(strategy) {
@Override
public boolean isLoggable(int priority, String tag) {
return BuildConfig.DEBUG;
Expand All @@ -86,7 +84,7 @@ public void log(int priority, String tag, String message) {
});
}

private void initBugly(){
private void initBugly() {

Beta.initDelay = 6 * 1000;
Beta.enableHotfix = false;
Expand All @@ -104,7 +102,7 @@ private void initBugly(){

}

private void initNetwork(){
private void initNetwork() {
NetBroadcastReceiver receiver = new NetBroadcastReceiver();
IntentFilter filter;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
Expand All @@ -118,15 +116,15 @@ private void initNetwork(){
NetHelper.INSTANCE.init(this);
}

public static AppApplication get(){
public static AppApplication get() {
return application;
}

public AppComponent getAppComponent(){
public AppComponent getAppComponent() {
return mAppComponent;
}

private String getAppChannel(){
private String getAppChannel() {
String channel = "normal";
try {
ApplicationInfo applicationInfo = getPackageManager()
Expand All @@ -137,5 +135,4 @@ private String getAppChannel(){
}
return channel;
}

}
26 changes: 7 additions & 19 deletions app/src/main/java/com/thirtydegreesray/openhub/AppConfig.java
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@


package com.thirtydegreesray.openhub;

import com.thirtydegreesray.openhub.util.StringUtils;

import java.util.Arrays;
import java.util.List;

/**
* Created on 2016/11/23.
*
* @author ThirtyDegreesRay
*/
/* Created on 2016/11/23. @author ThirtyDegreesRay */

public class AppConfig {

Expand All @@ -22,7 +16,7 @@ public class AppConfig {
public final static String GITHUB_CONTENT_BASE_URL = "https://raw.githubusercontent.com/";

/**
* This link are for OpenHub only. Please do not use this endpoint in your applications.
* This link is for OpenHub only. Please do not use this endpoint in your applications.
* If you want to get trending repositories, you may stand up your own instance.
* https://github.com/thedillonb/GitHub-Trending
*/
Expand All @@ -38,15 +32,12 @@ public class AppConfig {

public final static String DB_NAME = "OpenHub.db";



public final static String OPENHUB_CLIENT_ID = BuildConfig.OPENHUB_CLIENT_ID;

public final static String OPENHUB_CLIENT_SECRET = BuildConfig.OPENHUB_CLIENT_SECRET;

public final static String OAUTH2_SCOPE = "user,repo,gist,notifications";


public final static String OAUTH2_URL = GITHUB_BASE_URL + "login/oauth/authorize";

public final static String AUTH_HOME = GITHUB_BASE_URL + "ThirtyDegreesRay";
Expand All @@ -59,20 +50,17 @@ public class AppConfig {

public final static String OPENHUB_RELEASE_SIGN_MD5 = "C0:99:37:D9:6A:36:FB:B7:AB:4C:5E:3D:42:96:FA:AF";

public final static List<String> COMMON_PAGE_URL_LIST = Arrays.asList(
"https://github.com/trending"
);
public final static List<String> COMMON_PAGE_URL_LIST = Arrays.asList("https://github.com/trending");

public final static boolean isCommonPageUrl(String url){
if(StringUtils.isBlank(url)){
public final static boolean isCommonPageUrl(String url) {
if(StringUtils.isBlank(url)) {
return false;
}
for(String commonUrl : COMMON_PAGE_URL_LIST){
if(url.contains(commonUrl)){
for(String commonUrl : COMMON_PAGE_URL_LIST) {
if(url.contains(commonUrl)) {
return true;
}
}
return false;
}

}
10 changes: 2 additions & 8 deletions app/src/main/java/com/thirtydegreesray/openhub/AppData.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


package com.thirtydegreesray.openhub;

import android.support.annotation.Nullable;
Expand All @@ -10,11 +8,7 @@

import java.util.Locale;

/**
* Created on 2017/7/14.
*
* @author ThirtyDegreesRay
*/
/* Created on 2017/7/14. @author ThirtyDegreesRay */

public enum AppData {
INSTANCE;
Expand Down Expand Up @@ -44,7 +38,7 @@ public void setAuthUser(AuthUser authUser) {
}

public Locale getSystemDefaultLocal() {
if(systemDefaultLocal == null){
if(systemDefaultLocal == null) {
systemDefaultLocal = Locale.getDefault();
}
return systemDefaultLocal;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,20 @@


package com.thirtydegreesray.openhub.common;

import org.greenrobot.eventbus.EventBus;

/**
* 事件总线
* Created by ThirtyDegreesRay on 2016/8/22 14:55
*/
/* 事件总线 Created by ThirtyDegreesRay on 2016/8/22 14:55 */

public enum AppEventBus {
public enum AppEventBus {
INSTANCE;

AppEventBus(){
AppEventBus() {
init();
}

private EventBus eventBus ;
private EventBus eventBus;

private void init(){
eventBus = EventBus.builder()
.installDefaultEventBus();
private void init() {
eventBus = EventBus.builder().installDefaultEventBus();
}

public EventBus getEventBus() {
Expand Down
Loading