mirror of
https://github.com/k0shk0sh/FastHub.git
synced 2025-12-08 19:05:54 +00:00
make project buildable
This commit is contained in:
parent
9210a2db63
commit
e11abe938a
@ -1,9 +1,9 @@
|
||||
apply plugin: 'com.android.application'
|
||||
apply plugin: 'com.apollographql.android'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply plugin: 'kotlin-android-extensions'
|
||||
apply plugin: 'kotlin-kapt'
|
||||
apply plugin: 'com.apollographql.android'
|
||||
apply plugin: 'com.novoda.build-properties'
|
||||
apply plugin: 'jacoco-android'
|
||||
apply plugin: 'io.fabric'
|
||||
|
||||
buildProperties {
|
||||
@ -25,7 +25,6 @@ android {
|
||||
}
|
||||
}
|
||||
compileSdkVersion 27
|
||||
buildToolsVersion '27.0.3'
|
||||
defaultConfig {
|
||||
applicationId "com.fastaccess.github"
|
||||
minSdkVersion 21
|
||||
@ -90,7 +89,8 @@ android {
|
||||
}
|
||||
|
||||
configurations {
|
||||
all*.exclude module: 'annotations'
|
||||
all*.exclude module: 'annotation'
|
||||
all*.exclude group: 'org.jetbrains', module: 'annotations-java5'
|
||||
}
|
||||
|
||||
packagingOptions { exclude 'META-INF/rxjava.properties' }
|
||||
@ -161,31 +161,25 @@ dependencies {
|
||||
implementation('com.github.b3er.rxfirebase:firebase-database:11.2.0') { transitive = false }
|
||||
implementation('com.crashlytics.sdk.android:crashlytics:2.9.0@aar') { transitive = true }
|
||||
implementation "com.github.miguelbcr:RxBillingService:0.0.3"
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:${kotlin_version}"
|
||||
implementation 'org.jsoup:jsoup:1.10.3'
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${kotlin_version}"
|
||||
implementation 'org.jsoup:jsoup:1.12.1'
|
||||
implementation "com.evernote:android-state:${state_version}"
|
||||
implementation "petrov.kristiyan:colorpicker-library:1.1.4"
|
||||
implementation 'com.apollographql.apollo:apollo-rx2-support:0.4.1'
|
||||
implementation 'com.apollographql.apollo:apollo-rx2-support:1.2.2'
|
||||
implementation("com.apollographql.apollo:apollo-runtime:1.2.2")
|
||||
implementation 'com.jaredrummler:android-device-names:1.1.5'
|
||||
implementation 'net.yslibrary.keyboardvisibilityevent:keyboardvisibilityevent:2.1.0'
|
||||
implementation 'com.airbnb.android:lottie:2.2.5'
|
||||
implementation 'com.firebase:firebase-jobdispatcher:0.8.2'
|
||||
|
||||
compileOnly "org.projectlombok:lombok:${lombokVersion}"
|
||||
|
||||
kapt "org.projectlombok:lombok:${lombokVersion}"
|
||||
kapt "com.evernote:android-state-processor:${state_version}"
|
||||
kapt "com.jakewharton:butterknife-compiler:${butterKnifeVersion}"
|
||||
kapt 'com.github.matthiasrobbers:shortbread-compiler:1.0.1'
|
||||
kapt "io.requery:requery-processor:${requery}"
|
||||
// testImplementation "net.grandcentrix.thirtyinch:thirtyinch-test:$thirtyinchVersion"
|
||||
testImplementation "junit:junit:${junitVersion}"
|
||||
testImplementation "org.mockito:mockito-core:${mockitoVersion}"
|
||||
testImplementation "org.assertj:assertj-core:${assertjVersion}"
|
||||
androidTestImplementation "com.android.support:support-annotations:${supportVersion}"
|
||||
androidTestImplementation "org.mockito:mockito-core:${mockitoVersion}"
|
||||
androidTestImplementation 'com.android.support.test:runner:1.0.1'
|
||||
androidTestImplementation 'com.android.support.test:rules:1.0.1'
|
||||
androidTestImplementation "com.android.support.test.espresso:espresso-intents:${espresseVersion}"
|
||||
androidTestImplementation "com.android.support.test.espresso:espresso-core:${espresseVersion}"
|
||||
|
||||
}
|
||||
|
||||
apply plugin: 'com.google.gms.google-services'
|
||||
@ -1,77 +0,0 @@
|
||||
package com.fastaccess.helper;
|
||||
|
||||
import android.support.annotation.IntRange;
|
||||
import android.support.design.widget.TextInputLayout;
|
||||
import android.support.test.espresso.UiController;
|
||||
import android.support.test.espresso.ViewAction;
|
||||
import android.view.View;
|
||||
|
||||
import org.hamcrest.Description;
|
||||
import org.hamcrest.Matcher;
|
||||
import org.hamcrest.TypeSafeMatcher;
|
||||
|
||||
import it.sephiroth.android.library.bottomnavigation.BottomNavigation;
|
||||
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.isAssignableFrom;
|
||||
|
||||
/**
|
||||
* Created by Kosh on 05 May 2017, 9:23 PM
|
||||
*/
|
||||
|
||||
public class TestHelper {
|
||||
|
||||
public static Matcher<View> textInputLayoutHasHint(final String expectedErrorText) {
|
||||
return new TypeSafeMatcher<View>() {
|
||||
@Override public boolean matchesSafely(View view) {
|
||||
if (!(view instanceof TextInputLayout)) {
|
||||
return false;
|
||||
}
|
||||
CharSequence error = ((TextInputLayout) view).getHint();
|
||||
return error != null && expectedErrorText.equals(error.toString());
|
||||
}
|
||||
|
||||
@Override public void describeTo(Description description) {}
|
||||
};
|
||||
}
|
||||
|
||||
public static Matcher<View> textInputLayoutHasError(final String expectedErrorText) {
|
||||
return new TypeSafeMatcher<View>() {
|
||||
@Override public boolean matchesSafely(View view) {
|
||||
if (!(view instanceof TextInputLayout)) {
|
||||
return false;
|
||||
}
|
||||
CharSequence error = ((TextInputLayout) view).getError();
|
||||
return error != null && expectedErrorText.equals(error.toString());
|
||||
}
|
||||
|
||||
@Override public void describeTo(Description description) {}
|
||||
};
|
||||
}
|
||||
|
||||
public static Matcher<View> bottomNavSelection(@IntRange(from = 0, to = 3) final int position) {
|
||||
return new TypeSafeMatcher<View>() {
|
||||
@Override public boolean matchesSafely(View view) {
|
||||
return view instanceof BottomNavigation && position == ((BottomNavigation) view).getSelectedIndex();
|
||||
}
|
||||
|
||||
@Override public void describeTo(Description description) {}
|
||||
};
|
||||
}
|
||||
|
||||
public static ViewAction bottomNavAction(@IntRange(from = 0, to = 3) final int index) {
|
||||
return new ViewAction() {
|
||||
|
||||
@Override public Matcher<View> getConstraints() {
|
||||
return isAssignableFrom(BottomNavigation.class);
|
||||
}
|
||||
|
||||
@Override public String getDescription() {
|
||||
return "BottomNavigation";
|
||||
}
|
||||
|
||||
@Override public void perform(UiController uiController, View view) {
|
||||
((BottomNavigation) view).setSelectedIndex(index, false);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@ -1,54 +0,0 @@
|
||||
package com.fastaccess.ui.modules.login;
|
||||
|
||||
|
||||
import android.support.test.filters.LargeTest;
|
||||
import android.support.test.rule.ActivityTestRule;
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
|
||||
import com.fastaccess.R;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
import static android.support.test.espresso.action.ViewActions.click;
|
||||
import static android.support.test.espresso.action.ViewActions.closeSoftKeyboard;
|
||||
import static android.support.test.espresso.action.ViewActions.typeText;
|
||||
import static android.support.test.espresso.assertion.ViewAssertions.matches;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withId;
|
||||
import static com.fastaccess.helper.TestHelper.textInputLayoutHasError;
|
||||
import static org.hamcrest.core.IsNot.not;
|
||||
|
||||
@RunWith(AndroidJUnit4.class) @LargeTest
|
||||
public class LoginActivityTest {
|
||||
|
||||
@Rule public ActivityTestRule<LoginActivity> testRule = new ActivityTestRule<>(LoginActivity.class);
|
||||
|
||||
@Test public void successLoginClickSuccessTest() {
|
||||
String username = "username";
|
||||
String password = "password";
|
||||
onView(withId(R.id.usernameEditText)).perform(typeText(username), closeSoftKeyboard());
|
||||
onView(withId(R.id.passwordEditText)).perform(typeText(password), closeSoftKeyboard());
|
||||
onView(withId(R.id.login)).perform(click());
|
||||
onView(withId(R.id.progress)).check(matches(isDisplayed()));
|
||||
}
|
||||
|
||||
@Test public void usernameErrorTest() {
|
||||
String password = "password";
|
||||
onView(withId(R.id.passwordEditText)).perform(typeText(password), closeSoftKeyboard());
|
||||
onView(withId(R.id.login)).perform(click());
|
||||
onView(withId(R.id.progress)).check(matches(not(isDisplayed())));
|
||||
onView(withId(R.id.username)).check(matches(textInputLayoutHasError(testRule.getActivity().getString(R.string.required_field))));
|
||||
}
|
||||
|
||||
@Test public void passwordErrorTest() {
|
||||
String username = "username";
|
||||
onView(withId(R.id.usernameEditText)).perform(typeText(username), closeSoftKeyboard());
|
||||
onView(withId(R.id.login)).perform(click());
|
||||
onView(withId(R.id.progress)).check(matches(not(isDisplayed())));
|
||||
onView(withId(R.id.password)).check(matches(textInputLayoutHasError(testRule.getActivity().getString(R.string.required_field))));
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,39 +0,0 @@
|
||||
package com.fastaccess.ui.modules.login;
|
||||
|
||||
|
||||
import android.support.test.espresso.intent.rule.IntentsTestRule;
|
||||
import android.support.test.filters.LargeTest;
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
|
||||
import com.fastaccess.R;
|
||||
import com.fastaccess.ui.modules.login.chooser.LoginChooserActivity;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
import static android.support.test.espresso.action.ViewActions.click;
|
||||
import static android.support.test.espresso.assertion.ViewAssertions.matches;
|
||||
import static android.support.test.espresso.intent.Intents.intended;
|
||||
import static android.support.test.espresso.intent.matcher.IntentMatchers.hasComponent;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withId;
|
||||
import static com.fastaccess.helper.TestHelper.textInputLayoutHasHint;
|
||||
|
||||
@RunWith(AndroidJUnit4.class) @LargeTest
|
||||
public class LoginChooserActivityTest {
|
||||
|
||||
@Rule public IntentsTestRule<LoginChooserActivity> intentTestRule = new IntentsTestRule<>(LoginChooserActivity.class);
|
||||
|
||||
@Test public void basicAuthButtonTest() {
|
||||
onView(withId(R.id.basicAuth)).perform(click());
|
||||
intended(hasComponent(LoginActivity.class.getName()));
|
||||
onView(withId(R.id.password)).check(matches(textInputLayoutHasHint(intentTestRule.getActivity().getString(R.string.password))));
|
||||
}
|
||||
|
||||
@Test public void accessTokenButtonTest() {
|
||||
onView(withId(R.id.accessToken)).perform(click());
|
||||
intended(hasComponent(LoginActivity.class.getName()));
|
||||
onView(withId(R.id.password)).check(matches(textInputLayoutHasHint(intentTestRule.getActivity().getString(R.string.access_token))));
|
||||
}
|
||||
}
|
||||
@ -1,69 +0,0 @@
|
||||
package com.fastaccess.ui.modules.main;
|
||||
|
||||
import android.support.test.espresso.intent.rule.IntentsTestRule;
|
||||
|
||||
import com.fastaccess.R;
|
||||
import com.fastaccess.helper.AppHelper;
|
||||
import com.fastaccess.ui.modules.feeds.FeedsFragment;
|
||||
import com.fastaccess.ui.modules.login.chooser.LoginChooserActivity;
|
||||
import com.fastaccess.ui.modules.main.issues.pager.MyIssuesPagerFragment;
|
||||
import com.fastaccess.ui.modules.main.pullrequests.pager.MyPullsPagerFragment;
|
||||
import com.fastaccess.ui.modules.notification.NotificationActivity;
|
||||
import com.fastaccess.ui.modules.search.SearchActivity;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
import static android.support.test.espresso.action.ViewActions.click;
|
||||
import static android.support.test.espresso.assertion.ViewAssertions.matches;
|
||||
import static android.support.test.espresso.intent.Intents.intended;
|
||||
import static android.support.test.espresso.intent.matcher.IntentMatchers.hasComponent;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withId;
|
||||
import static com.fastaccess.helper.TestHelper.bottomNavAction;
|
||||
import static com.fastaccess.helper.TestHelper.bottomNavSelection;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
|
||||
/**
|
||||
* Created by Kosh on 06 May 2017, 2:11 AM
|
||||
*/
|
||||
|
||||
public class MainActivityTest {
|
||||
@Rule public IntentsTestRule<MainActivity> testRule = new IntentsTestRule<>(MainActivity.class);
|
||||
|
||||
@Test public void noUserTest() {
|
||||
assertEquals(testRule.getActivity().isLoggedIn(), false);
|
||||
intended(hasComponent(LoginChooserActivity.class.getName()));
|
||||
}
|
||||
|
||||
@Test public void onInitTest() {
|
||||
assertEquals(testRule.getActivity().isLoggedIn(), true);
|
||||
onView(withId(R.id.bottomNavigation)).check(matches(bottomNavSelection(0)));
|
||||
assertNotNull(AppHelper.getFragmentByTag(testRule.getActivity().getSupportFragmentManager(), FeedsFragment.TAG));
|
||||
}
|
||||
|
||||
@Test public void onSelectIssuesTabTest() {
|
||||
assertEquals(testRule.getActivity().isLoggedIn(), true);
|
||||
onView(withId(R.id.bottomNavigation)).perform(bottomNavAction(1))
|
||||
.check(matches(bottomNavSelection(1)));
|
||||
assertNotNull(AppHelper.getFragmentByTag(testRule.getActivity().getSupportFragmentManager(), MyIssuesPagerFragment.TAG));
|
||||
}
|
||||
|
||||
@Test public void onSelectPullRequestsTabTest() {
|
||||
assertEquals(testRule.getActivity().isLoggedIn(), true);
|
||||
onView(withId(R.id.bottomNavigation)).perform(bottomNavAction(2))
|
||||
.check(matches(bottomNavSelection(2)));
|
||||
assertNotNull(AppHelper.getFragmentByTag(testRule.getActivity().getSupportFragmentManager(), MyPullsPagerFragment.TAG));
|
||||
}
|
||||
|
||||
@Test public void startNotificationsIntentTest() {
|
||||
onView(withId(R.id.notifications)).perform(click());
|
||||
intended(hasComponent(NotificationActivity.class.getName()));
|
||||
}
|
||||
|
||||
@Test public void startSearchIntentTest() {
|
||||
onView(withId(R.id.search)).perform(click());
|
||||
intended(hasComponent(SearchActivity.class.getName()));
|
||||
}
|
||||
}
|
||||
@ -1,22 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest package="com.fastaccess"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:installLocation="auto">
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="com.fastaccess"
|
||||
android:installLocation="auto">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
|
||||
<uses-permission android:name="com.android.vending.BILLING"/>
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||
<uses-permission android:name="com.android.vending.BILLING" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission
|
||||
android:name="android.permission.READ_PHONE_STATE"
|
||||
tools:node="remove"/>
|
||||
|
||||
<meta-data
|
||||
android:name="com.google.firebase.messaging.default_notification_icon"
|
||||
android:resource="@drawable/ic_notification"/>
|
||||
tools:node="remove" />
|
||||
|
||||
<application
|
||||
android:name=".App"
|
||||
@ -33,15 +29,15 @@
|
||||
<activity
|
||||
android:name=".ui.modules.main.donation.CheckPurchaseActivity"
|
||||
android:configChanges="keyboard|orientation|screenSize"
|
||||
android:theme="@style/ThemeTranslucent"/>
|
||||
android:theme="@style/ThemeTranslucent" />
|
||||
<activity
|
||||
android:name=".ui.modules.main.MainActivity"
|
||||
android:launchMode="singleTask"
|
||||
android:theme="@style/SplashTheme">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
@ -52,14 +48,14 @@
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/LoginTheme">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW"/>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT"/>
|
||||
<category android:name="android.intent.category.BROWSABLE"/>
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
|
||||
<data
|
||||
android:host="login"
|
||||
android:scheme="fasthub"/>
|
||||
android:scheme="fasthub" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
@ -68,14 +64,14 @@
|
||||
android:label="@string/app_name"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/LoginTheme"/>
|
||||
android:theme="@style/LoginTheme" />
|
||||
<activity
|
||||
android:name=".ui.modules.user.UserPagerActivity"
|
||||
android:label="@string/user"
|
||||
android:parentActivityName=".ui.modules.main.MainActivity">
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value=".ui.modules.main.MainActivity"/>
|
||||
android:value=".ui.modules.main.MainActivity" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".ui.modules.repos.RepoPagerActivity"
|
||||
@ -83,7 +79,7 @@
|
||||
android:parentActivityName=".ui.modules.main.MainActivity">
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value=".ui.modules.main.MainActivity"/>
|
||||
android:value=".ui.modules.main.MainActivity" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".ui.modules.repos.issues.issue.details.IssuePagerActivity"
|
||||
@ -92,19 +88,19 @@
|
||||
android:windowSoftInputMode="stateAlwaysHidden">
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value=".ui.modules.repos.RepoPagerActivity"/>
|
||||
android:value=".ui.modules.repos.RepoPagerActivity" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".ui.modules.repos.issues.create.CreateIssueActivity"
|
||||
android:configChanges="keyboard|orientation|screenSize"
|
||||
android:label="@string/create_issue"/>
|
||||
android:label="@string/create_issue" />
|
||||
<activity
|
||||
android:name=".ui.modules.repos.pull_requests.pull_request.details.PullRequestPagerActivity"
|
||||
android:label="@string/pull_request"
|
||||
android:parentActivityName=".ui.modules.repos.RepoPagerActivity">
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value=".ui.modules.repos.RepoPagerActivity"/>
|
||||
android:value=".ui.modules.repos.RepoPagerActivity" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".ui.modules.repos.code.commit.details.CommitPagerActivity"
|
||||
@ -113,21 +109,21 @@
|
||||
android:windowSoftInputMode="stateAlwaysHidden">
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value=".ui.modules.repos.RepoPagerActivity"/>
|
||||
android:value=".ui.modules.repos.RepoPagerActivity" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".ui.modules.code.CodeViewerActivity"
|
||||
android:configChanges="keyboard|orientation|screenSize"
|
||||
android:label="@string/viewer"/>
|
||||
android:label="@string/viewer" />
|
||||
<activity
|
||||
android:name=".ui.modules.editor.EditorActivity"
|
||||
android:configChanges="keyboard|orientation|screenSize"
|
||||
android:label="@string/markdown"
|
||||
android:windowSoftInputMode="adjustResize"/>
|
||||
android:windowSoftInputMode="adjustResize" />
|
||||
<activity
|
||||
android:name=".ui.modules.gists.create.CreateGistActivity"
|
||||
android:configChanges="keyboard|orientation|screenSize"
|
||||
android:label="@string/create_gist"/>
|
||||
android:label="@string/create_gist" />
|
||||
<activity
|
||||
android:name=".ui.modules.gists.gist.GistActivity"
|
||||
android:label="@string/gist"
|
||||
@ -135,14 +131,14 @@
|
||||
android:windowSoftInputMode="stateAlwaysHidden">
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value=".ui.modules.main.MainActivity"/>
|
||||
android:value=".ui.modules.main.MainActivity" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".ui.modules.search.SearchActivity"
|
||||
android:parentActivityName=".ui.modules.main.MainActivity">
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value=".ui.modules.main.MainActivity"/>
|
||||
android:value=".ui.modules.main.MainActivity" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".ui.modules.notification.NotificationActivity"
|
||||
@ -150,48 +146,48 @@
|
||||
android:parentActivityName=".ui.modules.main.MainActivity">
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value=".ui.modules.main.MainActivity"/>
|
||||
android:value=".ui.modules.main.MainActivity" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".ui.modules.about.FastHubAboutActivity"
|
||||
android:theme="@style/AppTheme.AboutActivity.Light"/>
|
||||
android:theme="@style/AppTheme.AboutActivity.Light" />
|
||||
<activity
|
||||
android:name=".ui.modules.pinned.PinnedReposActivity"
|
||||
android:label="@string/pinned"/>
|
||||
android:label="@string/pinned" />
|
||||
<activity
|
||||
android:name=".ui.modules.gists.GistsListActivity"
|
||||
android:label="@string/public_gists"/>
|
||||
<activity android:name=".ui.modules.profile.org.teams.details.TeamPagerActivity"/>
|
||||
android:label="@string/public_gists" />
|
||||
<activity android:name=".ui.modules.profile.org.teams.details.TeamPagerActivity" />
|
||||
<activity
|
||||
android:name=".ui.modules.repos.code.files.activity.RepoFilesActivity"
|
||||
android:parentActivityName=".ui.modules.repos.RepoPagerActivity">
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value=".ui.modules.repos.RepoPagerActivity"/>
|
||||
android:value=".ui.modules.repos.RepoPagerActivity" />
|
||||
</activity>
|
||||
<activity android:name=".ui.modules.filter.issues.FilterIssuesActivity"/>
|
||||
<activity android:name=".ui.modules.main.donation.DonationActivity"/>
|
||||
<activity android:name=".ui.modules.repos.code.commit.viewer.FullCommitFileActivity"/>
|
||||
<activity android:name=".ui.modules.filter.issues.FilterIssuesActivity" />
|
||||
<activity android:name=".ui.modules.main.donation.DonationActivity" />
|
||||
<activity android:name=".ui.modules.repos.code.commit.viewer.FullCommitFileActivity" />
|
||||
<activity
|
||||
android:name=".ui.modules.search.repos.files.SearchFileActivity"
|
||||
android:parentActivityName=".ui.modules.repos.RepoPagerActivity">
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value=".ui.modules.repos.RepoPagerActivity"/>
|
||||
android:value=".ui.modules.repos.RepoPagerActivity" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".ui.modules.settings.SettingsActivity"
|
||||
android:configChanges="keyboard|orientation|screenSize"/>
|
||||
android:configChanges="keyboard|orientation|screenSize" />
|
||||
<activity
|
||||
android:name=".ui.modules.settings.category.SettingsCategoryActivity"
|
||||
android:configChanges="keyboard|orientation|screenSize"/>
|
||||
android:configChanges="keyboard|orientation|screenSize" />
|
||||
<activity
|
||||
android:name=".ui.modules.repos.code.releases.ReleasesListActivity"
|
||||
android:label="@string/releases"
|
||||
android:parentActivityName=".ui.modules.repos.RepoPagerActivity">
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value=".ui.modules.repos.RepoPagerActivity"/>
|
||||
android:value=".ui.modules.repos.RepoPagerActivity" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".ui.modules.trending.TrendingActivity"
|
||||
@ -200,41 +196,41 @@
|
||||
android:windowSoftInputMode="stateAlwaysHidden">
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value=".ui.modules.main.MainActivity"/>
|
||||
android:value=".ui.modules.main.MainActivity" />
|
||||
</activity>
|
||||
<activity android:name=".ui.modules.theme.ThemeActivity"/>
|
||||
<activity android:name=".ui.modules.theme.ThemeActivity" />
|
||||
<activity
|
||||
android:name=".ui.modules.theme.code.ThemeCodeActivity"
|
||||
android:label="@string/theme_title"/>
|
||||
android:label="@string/theme_title" />
|
||||
<activity
|
||||
android:name=".ui.modules.main.donation.DonateActivity"
|
||||
android:configChanges="keyboard|orientation|screenSize"
|
||||
android:theme="@style/ThemeTranslucent"/>
|
||||
android:theme="@style/ThemeTranslucent" />
|
||||
<activity
|
||||
android:name=".ui.modules.repos.wiki.WikiActivity"
|
||||
android:label="@string/gollum"
|
||||
android:parentActivityName=".ui.modules.repos.RepoPagerActivity">
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value=".ui.modules.repos.RepoPagerActivity"/>
|
||||
android:value=".ui.modules.repos.RepoPagerActivity" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".ui.modules.main.premium.PremiumActivity"
|
||||
android:configChanges="keyboard|orientation|screenSize"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateAlwaysHidden"/>
|
||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||
<activity
|
||||
android:name=".ui.modules.repos.git.EditRepoFileActivity"
|
||||
android:configChanges="keyboard|orientation|screenSize"
|
||||
android:label="@string/markdown"
|
||||
android:windowSoftInputMode="adjustResize"/>
|
||||
android:windowSoftInputMode="adjustResize" />
|
||||
<activity
|
||||
android:name=".ui.modules.repos.code.commit.history.FileCommitHistoryActivity"
|
||||
android:label="@string/commits"
|
||||
android:parentActivityName=".ui.modules.repos.RepoPagerActivity">
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value=".ui.modules.repos.RepoPagerActivity"/>
|
||||
android:value=".ui.modules.repos.RepoPagerActivity" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".ui.modules.repos.projects.details.ProjectPagerActivity"
|
||||
@ -242,7 +238,7 @@
|
||||
android:parentActivityName=".ui.modules.repos.RepoPagerActivity">
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value=".ui.modules.repos.RepoPagerActivity"/>
|
||||
android:value=".ui.modules.repos.RepoPagerActivity" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".ui.modules.profile.org.project.OrgProjectActivity"
|
||||
@ -250,16 +246,16 @@
|
||||
android:parentActivityName=".ui.modules.user.UserPagerActivity">
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value=".ui.modules.user.UserPagerActivity"/>
|
||||
android:value=".ui.modules.user.UserPagerActivity" />
|
||||
</activity>
|
||||
|
||||
<activity android:name=".ui.modules.main.playstore.PlayStoreWarningActivity"/>
|
||||
<activity android:name=".ui.modules.main.playstore.PlayStoreWarningActivity" />
|
||||
|
||||
<activity
|
||||
android:name=".ui.modules.repos.pull_requests.pull_request.details.files.fullscreen.FullScreenFileChangeActivity"
|
||||
android:configChanges="keyboard|orientation|screenSize"/>
|
||||
android:configChanges="keyboard|orientation|screenSize" />
|
||||
|
||||
<activity android:name=".ui.modules.search.SearchUserActivity"/>
|
||||
<activity android:name=".ui.modules.search.SearchUserActivity" />
|
||||
|
||||
<activity
|
||||
android:name=".ui.modules.parser.LinksParserActivity"
|
||||
@ -267,37 +263,37 @@
|
||||
android:noHistory="true"
|
||||
android:theme="@android:style/Theme.NoDisplay">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW"/>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
<data
|
||||
android:host="github.com"
|
||||
android:scheme="http"/>
|
||||
android:scheme="http" />
|
||||
<data
|
||||
android:host="github.com"
|
||||
android:scheme="https"/>
|
||||
android:scheme="https" />
|
||||
<data
|
||||
android:host="gist.github.com"
|
||||
android:scheme="http"/>
|
||||
android:scheme="http" />
|
||||
<data
|
||||
android:host="gist.github.com"
|
||||
android:scheme="https"/>
|
||||
android:scheme="https" />
|
||||
<data
|
||||
android:host="raw.githubusercontent.com"
|
||||
android:scheme="https"/>
|
||||
android:scheme="https" />
|
||||
<data
|
||||
android:host="gist.githubusercontent.com"
|
||||
android:scheme="https"/>
|
||||
<data android:pathPattern=".*"/>
|
||||
android:scheme="https" />
|
||||
<data android:pathPattern=".*" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT"/>
|
||||
<category android:name="android.intent.category.BROWSABLE"/>
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.SEND"/>
|
||||
<action android:name="android.intent.action.SEND" />
|
||||
|
||||
<data android:mimeType="text/plain"/>
|
||||
<data android:mimeType="text/plain" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT"/>
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
@ -305,25 +301,29 @@
|
||||
android:name=".provider.tasks.notification.NotificationSchedulerJobTask"
|
||||
android:exported="false">
|
||||
<intent-filter>
|
||||
<action android:name="com.firebase.jobdispatcher.ACTION_EXECUTE"/>
|
||||
<action android:name="com.firebase.jobdispatcher.ACTION_EXECUTE" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
<service android:name=".provider.tasks.notification.ReadNotificationService"/>
|
||||
<service android:name=".provider.tasks.git.GithubActionService"/>
|
||||
<service android:name=".provider.tasks.git.ReactionService"/>
|
||||
<service android:name=".provider.tasks.slack.SlackInvitationService"/>
|
||||
<service android:name=".provider.tasks.version.CheckVersionService"/>
|
||||
<service android:name=".provider.tasks.notification.ReadNotificationService" />
|
||||
<service android:name=".provider.tasks.git.GithubActionService" />
|
||||
<service android:name=".provider.tasks.git.ReactionService" />
|
||||
<service android:name=".provider.tasks.slack.SlackInvitationService" />
|
||||
<service android:name=".provider.tasks.version.CheckVersionService" />
|
||||
<service
|
||||
android:name=".provider.fcm.PushNotificationService"
|
||||
android:exported="false">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
|
||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
<meta-data
|
||||
android:name="io.fabric.ApiKey"
|
||||
android:value="6ed82b6e0756853d7d782a3f547f84f9ecba217e"/>
|
||||
android:value="6ed82b6e0756853d7d782a3f547f84f9ecba217e" />
|
||||
|
||||
<meta-data
|
||||
android:name="com.google.firebase.messaging.default_notification_icon"
|
||||
android:resource="@drawable/ic_notification" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@ -5,10 +5,10 @@ query getPinnedRepos($login: String!) {
|
||||
node {
|
||||
name
|
||||
url
|
||||
issues(states: OPEN) {
|
||||
issues(states: [OPEN]) {
|
||||
totalCount
|
||||
}
|
||||
pullRequests(states: OPEN) {
|
||||
pullRequests(states: [OPEN]) {
|
||||
totalCount
|
||||
}
|
||||
stargazers {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
query repoProjectsOpen($owner: String!, $name: String!, $page: String) {
|
||||
repository(owner: $owner, name: $name) {
|
||||
projects(first: 30, states: OPEN, after: $page, orderBy: {field: CREATED_AT, direction: DESC}) {
|
||||
projects(first: 30, states: [OPEN], after: $page, orderBy: {field: CREATED_AT, direction: DESC}) {
|
||||
totalCount
|
||||
edges {
|
||||
cursor
|
||||
@ -27,7 +27,7 @@ repository(owner: $owner, name: $name) {
|
||||
}
|
||||
query repoProjectsClosed($owner: String!, $name: String!, $page: String) {
|
||||
repository(owner: $owner, name: $name) {
|
||||
projects(first: 30, states: CLOSED, after: $page, orderBy: {field: CREATED_AT, direction: DESC}) {
|
||||
projects(first: 30, states: [CLOSED], after: $page, orderBy: {field: CREATED_AT, direction: DESC}) {
|
||||
totalCount
|
||||
edges {
|
||||
cursor
|
||||
@ -55,7 +55,7 @@ repository(owner: $owner, name: $name) {
|
||||
|
||||
query orgProjectsOpen($owner: String!, $page: String) {
|
||||
organization(login: $owner) {
|
||||
projects(first: 30, states: OPEN, after: $page, orderBy: {field: CREATED_AT, direction: DESC}) {
|
||||
projects(first: 30, states: [OPEN], after: $page, orderBy: {field: CREATED_AT, direction: DESC}) {
|
||||
totalCount
|
||||
edges {
|
||||
cursor
|
||||
@ -82,7 +82,7 @@ organization(login: $owner) {
|
||||
}
|
||||
query orgProjectsClosed($owner: String!, $page: String) {
|
||||
organization(login: $owner) {
|
||||
projects(first: 30, states: CLOSED, after: $page, orderBy: {field: CREATED_AT, direction: DESC}) {
|
||||
projects(first: 30, states: [CLOSED], after: $page, orderBy: {field: CREATED_AT, direction: DESC}) {
|
||||
totalCount
|
||||
edges {
|
||||
cursor
|
||||
|
||||
@ -2,14 +2,13 @@ package com.fastaccess.data.dao.model;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
|
||||
import com.fastaccess.App;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import io.requery.Column;
|
||||
import io.requery.Entity;
|
||||
@ -33,11 +32,11 @@ import lombok.NoArgsConstructor;
|
||||
@io.requery.Nullable String title;
|
||||
@io.requery.Nullable NotificationType type;
|
||||
|
||||
public static void update(@Nonnull FastHubNotification notification) {
|
||||
public static void update(@NonNull FastHubNotification notification) {
|
||||
App.getInstance().getDataStore().toBlocking().update(notification);
|
||||
}
|
||||
|
||||
public static void save(@Nonnull FastHubNotification notification) {
|
||||
public static void save(@NonNull FastHubNotification notification) {
|
||||
App.getInstance().getDataStore().toBlocking().insert(notification);
|
||||
}
|
||||
|
||||
@ -51,7 +50,7 @@ import lombok.NoArgsConstructor;
|
||||
.firstOrNull();
|
||||
}
|
||||
|
||||
@Nonnull public static Observable<FastHubNotification> getNotifications() {
|
||||
@NonNull public static Observable<FastHubNotification> getNotifications() {
|
||||
return App.getInstance().getDataStore()
|
||||
.select(FastHubNotification.class)
|
||||
.orderBy(FastHubNotification.DATE.desc())
|
||||
|
||||
@ -2,6 +2,7 @@ package com.fastaccess.data.dao.model;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.support.annotation.Nullable;
|
||||
|
||||
import com.fastaccess.App;
|
||||
import com.fastaccess.helper.RxHelper;
|
||||
@ -9,8 +10,6 @@ import com.fastaccess.helper.RxHelper;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import io.requery.BlockingEntityStore;
|
||||
import io.requery.Entity;
|
||||
|
||||
@ -1,169 +0,0 @@
|
||||
package com.fastaccess.data.dao.timeline;
|
||||
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
|
||||
import com.fastaccess.data.dao.ReactionsModel;
|
||||
import com.fastaccess.helper.Logger;
|
||||
import com.fastaccess.helper.ParseDateFormat;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import github.PullRequestTimelineQuery;
|
||||
import github.type.PullRequestReviewState;
|
||||
|
||||
/**
|
||||
* Created by kosh on 20/08/2017.
|
||||
*/
|
||||
|
||||
public class PullRequestReviewModel {
|
||||
private PullRequestTimelineQuery.AsReviewDismissedEvent reviewDismissedEvent;
|
||||
private PullRequestTimelineQuery.AsReviewRequestedEvent reviewRequestedEvent;
|
||||
private PullRequestTimelineQuery.AsReviewRequestRemovedEvent reviewRequestRemovedEvent;
|
||||
private PullRequestTimelineQuery.Node2 node;
|
||||
private List<ReactionsModel> reaction;
|
||||
private List<PullRequestReviewModel> comments;
|
||||
private String id;
|
||||
private String url;
|
||||
private PullRequestTimelineQuery.Author2 author;
|
||||
private String bodyHTML;
|
||||
private String createdAt;
|
||||
private PullRequestReviewState state;
|
||||
|
||||
@Nullable public static PullRequestReviewModel build(@NonNull PullRequestTimelineQuery.Node node) {
|
||||
PullRequestReviewModel model = new PullRequestReviewModel();
|
||||
if (node.asReviewRequestRemovedEvent() != null) {
|
||||
model.reviewRequestRemovedEvent = node.asReviewRequestRemovedEvent();
|
||||
} else if (node.asReviewDismissedEvent() != null) {
|
||||
model.reviewDismissedEvent = node.asReviewDismissedEvent();
|
||||
} else if (node.asReviewRequestedEvent() != null) {
|
||||
model.reviewRequestedEvent = node.asReviewRequestedEvent();
|
||||
} else {
|
||||
PullRequestTimelineQuery.AsPullRequestReview pullRequestReview = node.asPullRequestReview();
|
||||
if (pullRequestReview != null) {
|
||||
model.state = pullRequestReview.state();
|
||||
model.url = pullRequestReview.url().toString();
|
||||
model.author = pullRequestReview.author();
|
||||
model.bodyHTML = pullRequestReview.bodyHTML().toString();
|
||||
model.createdAt = ParseDateFormat.getTimeAgo(pullRequestReview.createdAt().toString()).toString();
|
||||
model.id = pullRequestReview.id();
|
||||
model.url = pullRequestReview.url().toString();
|
||||
List<PullRequestTimelineQuery.Edge2> edges = pullRequestReview.comments().edges();
|
||||
if (edges != null && !edges.isEmpty()) {
|
||||
List<PullRequestReviewModel> comments = new ArrayList<>();
|
||||
for (PullRequestTimelineQuery.Edge2 edge : edges) {
|
||||
PullRequestTimelineQuery.Node2 node2 = edge.node();
|
||||
if (node2 != null) {
|
||||
PullRequestReviewModel comment = new PullRequestReviewModel();
|
||||
comment.node = node2;
|
||||
comment.reaction = ReactionsModel.getReaction(node2.reactionGroups());
|
||||
comments.add(comment);
|
||||
}
|
||||
}
|
||||
Logger.e(comments.size());
|
||||
model.comments = comments;
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return model;
|
||||
}
|
||||
|
||||
public PullRequestTimelineQuery.AsReviewDismissedEvent getReviewDismissedEvent() {
|
||||
return reviewDismissedEvent;
|
||||
}
|
||||
|
||||
public void setReviewDismissedEvent(PullRequestTimelineQuery.AsReviewDismissedEvent reviewDismissedEvent) {
|
||||
this.reviewDismissedEvent = reviewDismissedEvent;
|
||||
}
|
||||
|
||||
public PullRequestTimelineQuery.AsReviewRequestedEvent getReviewRequestedEvent() {
|
||||
return reviewRequestedEvent;
|
||||
}
|
||||
|
||||
public void setReviewRequestedEvent(PullRequestTimelineQuery.AsReviewRequestedEvent reviewRequestedEvent) {
|
||||
this.reviewRequestedEvent = reviewRequestedEvent;
|
||||
}
|
||||
|
||||
public PullRequestTimelineQuery.AsReviewRequestRemovedEvent getReviewRequestRemovedEvent() {
|
||||
return reviewRequestRemovedEvent;
|
||||
}
|
||||
|
||||
public void setReviewRequestRemovedEvent(PullRequestTimelineQuery.AsReviewRequestRemovedEvent reviewRequestRemovedEvent) {
|
||||
this.reviewRequestRemovedEvent = reviewRequestRemovedEvent;
|
||||
}
|
||||
|
||||
public PullRequestTimelineQuery.Node2 getNode() {
|
||||
return node;
|
||||
}
|
||||
|
||||
public void setNode(PullRequestTimelineQuery.Node2 node) {
|
||||
this.node = node;
|
||||
}
|
||||
|
||||
public List<ReactionsModel> getReaction() {
|
||||
return reaction;
|
||||
}
|
||||
|
||||
public void setReaction(List<ReactionsModel> reaction) {
|
||||
this.reaction = reaction;
|
||||
}
|
||||
|
||||
public List<PullRequestReviewModel> getComments() {
|
||||
return comments;
|
||||
}
|
||||
|
||||
public void setComments(List<PullRequestReviewModel> comments) {
|
||||
this.comments = comments;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public PullRequestTimelineQuery.Author2 getAuthor() {
|
||||
return author;
|
||||
}
|
||||
|
||||
public void setAuthor(PullRequestTimelineQuery.Author2 author) {
|
||||
this.author = author;
|
||||
}
|
||||
|
||||
public String getBodyHTML() {
|
||||
return bodyHTML;
|
||||
}
|
||||
|
||||
public void setBodyHTML(String bodyHTML) {
|
||||
this.bodyHTML = bodyHTML;
|
||||
}
|
||||
|
||||
public String getCreatedAt() {
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
public void setCreatedAt(String createdAt) {
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public PullRequestReviewState getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public void setState(PullRequestReviewState state) {
|
||||
this.state = state;
|
||||
}
|
||||
}
|
||||
@ -1,85 +0,0 @@
|
||||
package com.fastaccess.data.dao.timeline;
|
||||
|
||||
import com.fastaccess.data.dao.ReactionsModel;
|
||||
import com.fastaccess.data.dao.model.PullRequest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import github.PullRequestTimelineQuery;
|
||||
|
||||
/**
|
||||
* Created by kosh on 02/08/2017.
|
||||
*/
|
||||
|
||||
@Getter @Setter public class PullRequestTimelineModel {
|
||||
|
||||
public static final int HEADER = 1;
|
||||
public static final int EVENT = 2;
|
||||
public static final int COMMENT = 3;
|
||||
public static final int STATUS = 4;
|
||||
public static final int REVIEW = 5;
|
||||
public static final int COMMIT_COMMENTS = 6;
|
||||
public PullRequestTimelineQuery.Node node;
|
||||
public PullRequest pullRequest;
|
||||
public PullRequestTimelineQuery.Status status;
|
||||
public List<ReactionsModel> reactions;
|
||||
public boolean isMergeable;
|
||||
public PullRequestCommitModel commitThread;
|
||||
public PullRequestReviewModel reviewModel;
|
||||
|
||||
public PullRequestTimelineModel(PullRequest pullRequest) {
|
||||
this.pullRequest = pullRequest;
|
||||
}
|
||||
|
||||
public PullRequestTimelineModel(PullRequestTimelineQuery.Node node) {
|
||||
this.node = node;
|
||||
if (this.node.asCommitCommentThread() != null) {
|
||||
|
||||
} else {
|
||||
if (node.asPullRequestReview() != null || node.asReviewDismissedEvent() != null
|
||||
|| node.asReviewRequestedEvent() != null || node.asReviewRequestRemovedEvent() != null) {
|
||||
reviewModel = PullRequestReviewModel.build(node);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public PullRequestTimelineModel(PullRequestTimelineQuery.Status status, boolean isMergeable) {
|
||||
this.status = status;
|
||||
this.isMergeable = isMergeable;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
if (pullRequest != null) return HEADER;
|
||||
if (node != null) {
|
||||
if (node.asAssignedEvent() != null || node.asClosedEvent() != null
|
||||
|| node.asDemilestonedEvent() != null || node.asHeadRefDeletedEvent() != null
|
||||
|| node.asLabeledEvent() != null || node.asLockedEvent() != null
|
||||
|| node.asMergedEvent() != null || node.asMilestonedEvent() != null
|
||||
|| node.asReferencedEvent() != null || node.asRenamedTitleEvent() != null
|
||||
|| node.asReopenedEvent() != null || node.asUnassignedEvent() != null
|
||||
|| node.asUnlabeledEvent() != null || node.asUnlockedEvent() != null
|
||||
|| node.asCommit() != null || node.asHeadRefRestoredEvent() != null) {
|
||||
return EVENT;
|
||||
} else if (node.asIssueComment() != null) {
|
||||
if (reactions == null) {
|
||||
//noinspection ConstantConditions
|
||||
setReactions(ReactionsModel.getReaction2(node.asIssueComment().reactionGroups()));
|
||||
}
|
||||
return COMMENT;
|
||||
} else if (reviewModel != null) {
|
||||
return REVIEW;
|
||||
} else if (commitThread != null) {
|
||||
return COMMIT_COMMENTS;
|
||||
}
|
||||
} else if (status != null) {
|
||||
return STATUS;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
return String.valueOf(getType());
|
||||
}
|
||||
}
|
||||
@ -1,414 +0,0 @@
|
||||
package com.fastaccess.ui.adapter.viewholder
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.graphics.Color
|
||||
import android.support.v4.content.ContextCompat
|
||||
import android.text.style.BackgroundColorSpan
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import butterknife.BindView
|
||||
import com.fastaccess.R
|
||||
import com.fastaccess.data.dao.timeline.PullRequestTimelineModel
|
||||
import com.fastaccess.helper.ParseDateFormat
|
||||
import com.fastaccess.helper.PrefGetter
|
||||
import com.fastaccess.helper.ViewHelper
|
||||
import com.fastaccess.provider.scheme.LinkParserHelper
|
||||
import com.fastaccess.provider.timeline.HtmlHelper
|
||||
import com.fastaccess.ui.widgets.AvatarLayout
|
||||
import com.fastaccess.ui.widgets.FontTextView
|
||||
import com.fastaccess.ui.widgets.ForegroundImageView
|
||||
import com.fastaccess.ui.widgets.SpannableBuilder
|
||||
import com.fastaccess.ui.widgets.recyclerview.BaseRecyclerAdapter
|
||||
import com.fastaccess.ui.widgets.recyclerview.BaseViewHolder
|
||||
import com.zzhoujay.markdown.style.CodeSpan
|
||||
import github.PullRequestTimelineQuery
|
||||
import github.type.StatusState
|
||||
|
||||
/**
|
||||
* Created by kosh on 03/08/2017.
|
||||
*/
|
||||
|
||||
class PullRequestEventViewHolder private constructor(view: View, adapter: BaseRecyclerAdapter<*, *, *>) :
|
||||
BaseViewHolder<PullRequestTimelineModel>(view, adapter) {
|
||||
|
||||
@BindView(R.id.stateImage) lateinit var stateImage: ForegroundImageView
|
||||
@BindView(R.id.avatarLayout) lateinit var avatarLayout: AvatarLayout
|
||||
@BindView(R.id.stateText) lateinit var stateText: FontTextView
|
||||
@BindView(R.id.commitStatus) lateinit var commitStatus: ForegroundImageView
|
||||
|
||||
override fun bind(t: PullRequestTimelineModel) {
|
||||
val node = t.node
|
||||
commitStatus.visibility = View.GONE
|
||||
if (node != null) {
|
||||
when {
|
||||
node.asAssignedEvent() != null -> assignedEvent(node.asAssignedEvent()!!)
|
||||
node.asBaseRefForcePushedEvent() != null -> forcePushEvent(node.asBaseRefForcePushedEvent()!!)
|
||||
node.asClosedEvent() != null -> closedEvent(node.asClosedEvent()!!)
|
||||
node.asCommit() != null -> commitEvent(node.asCommit()!!)
|
||||
node.asDemilestonedEvent() != null -> demilestonedEvent(node.asDemilestonedEvent()!!)
|
||||
node.asDeployedEvent() != null -> deployedEvent(node.asDeployedEvent()!!)
|
||||
node.asHeadRefDeletedEvent() != null -> refDeletedEvent(node.asHeadRefDeletedEvent()!!)
|
||||
node.asHeadRefForcePushedEvent() != null -> refForPushedEvent(node.asHeadRefForcePushedEvent()!!)
|
||||
node.asHeadRefRestoredEvent() != null -> headRefRestoredEvent(node.asHeadRefRestoredEvent()!!)
|
||||
node.asLabeledEvent() != null -> labeledEvent(node.asLabeledEvent()!!)
|
||||
node.asLockedEvent() != null -> lockEvent(node.asLockedEvent()!!)
|
||||
node.asMergedEvent() != null -> mergedEvent(node.asMergedEvent()!!)
|
||||
node.asMilestonedEvent() != null -> milestoneEvent(node.asMilestonedEvent()!!)
|
||||
node.asReferencedEvent() != null -> referenceEvent(node.asReferencedEvent()!!)
|
||||
node.asRenamedTitleEvent() != null -> renamedEvent(node.asRenamedTitleEvent()!!)
|
||||
node.asReopenedEvent() != null -> reopenedEvent(node.asReopenedEvent()!!)
|
||||
node.asUnassignedEvent() != null -> unassignedEvent(node.asUnassignedEvent()!!)
|
||||
node.asUnlabeledEvent() != null -> unlabeledEvent(node.asUnlabeledEvent()!!)
|
||||
node.asUnlockedEvent() != null -> unlockedEvent(node.asUnlockedEvent()!!)
|
||||
else -> reset()
|
||||
}
|
||||
} else {
|
||||
reset()
|
||||
}
|
||||
}
|
||||
|
||||
private fun reset() {
|
||||
stateText.text = ""
|
||||
avatarLayout.setUrl(null, null, false, false)
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
private fun unlockedEvent(event: PullRequestTimelineQuery.AsUnlockedEvent) {
|
||||
event.actor()?.let {
|
||||
stateText.text = SpannableBuilder.builder()
|
||||
.bold(it.login())
|
||||
.append(" ")
|
||||
.append("unlocked this conversation")
|
||||
.append(" ")
|
||||
.append(ParseDateFormat.getTimeAgo((event.createdAt().toString())))
|
||||
stateImage.setImageResource(R.drawable.ic_lock)
|
||||
avatarLayout.setUrl(it.avatarUrl().toString(), it.login(), false, LinkParserHelper.isEnterprise(it.url().toString()))
|
||||
}
|
||||
}
|
||||
|
||||
private fun unlabeledEvent(event: PullRequestTimelineQuery.AsUnlabeledEvent) {
|
||||
event.actor()?.let {
|
||||
val color = Color.parseColor("#" + event.label().color())
|
||||
stateText.text = SpannableBuilder.builder()
|
||||
.bold(it.login())
|
||||
.append(" ")
|
||||
.append("removed")
|
||||
.append(" ")
|
||||
.append(event.label().name(), CodeSpan(color, ViewHelper.generateTextColor(color), 5.0f))
|
||||
.append(" ")
|
||||
.append(ParseDateFormat.getTimeAgo((event.createdAt().toString())))
|
||||
stateImage.setImageResource(R.drawable.ic_label)
|
||||
avatarLayout.setUrl(it.avatarUrl().toString(), it.login(), false, LinkParserHelper.isEnterprise(it.url().toString()))
|
||||
}
|
||||
}
|
||||
|
||||
private fun unassignedEvent(event: PullRequestTimelineQuery.AsUnassignedEvent) {
|
||||
event.actor()?.let {
|
||||
stateText.text = SpannableBuilder.builder()
|
||||
.bold(it.login())
|
||||
.append(" ")
|
||||
.append("unassigned") //TODO add "removed their assignment" for self
|
||||
.append(" ")
|
||||
.append(event.user()?.login())
|
||||
.append(" ")
|
||||
.append(ParseDateFormat.getTimeAgo((event.createdAt().toString())))
|
||||
stateImage.setImageResource(R.drawable.ic_profile)
|
||||
avatarLayout.setUrl(it.avatarUrl().toString(), it.login(), false, LinkParserHelper.isEnterprise(it.url().toString()))
|
||||
}
|
||||
}
|
||||
|
||||
private fun reopenedEvent(event: PullRequestTimelineQuery.AsReopenedEvent) {
|
||||
event.actor()?.let {
|
||||
stateText.text = SpannableBuilder.builder()
|
||||
.bold(it.login())
|
||||
.append(" ")
|
||||
.append("reopened this")
|
||||
.append(" ")
|
||||
.append(ParseDateFormat.getTimeAgo((event.createdAt().toString())))
|
||||
stateImage.setImageResource(R.drawable.ic_issue_opened)
|
||||
avatarLayout.setUrl(it.avatarUrl().toString(), it.login(), false, LinkParserHelper.isEnterprise(it.url().toString()))
|
||||
}
|
||||
}
|
||||
|
||||
private fun renamedEvent(event: PullRequestTimelineQuery.AsRenamedTitleEvent) {
|
||||
event.actor()?.let {
|
||||
stateText.text = SpannableBuilder.builder()
|
||||
.bold(it.login())
|
||||
.append(" ")
|
||||
.append("changed the title from").append(" ").append(event.previousTitle())
|
||||
.append(" ").append("to").append(" ").bold(event.currentTitle())
|
||||
.append(" ")
|
||||
.append(ParseDateFormat.getTimeAgo((event.createdAt().toString())))
|
||||
stateImage.setImageResource(R.drawable.ic_edit)
|
||||
avatarLayout.setUrl(it.avatarUrl().toString(), it.login(), false, LinkParserHelper.isEnterprise(it.url().toString()))
|
||||
}
|
||||
}
|
||||
|
||||
private fun referenceEvent(event: PullRequestTimelineQuery.AsReferencedEvent) {
|
||||
event.actor()?.let {
|
||||
stateText.text = SpannableBuilder.builder()
|
||||
.bold(it.login())
|
||||
.append(" ")
|
||||
.append("referenced in")
|
||||
.append(" ")
|
||||
.append("from").append(" ")
|
||||
.url(if (event.commit() != null) {
|
||||
substring(event.commit()?.oid()?.toString())
|
||||
} else if (event.subject().asIssue() != null) {
|
||||
if (event.isCrossRepository) {
|
||||
"${event.commitRepository().nameWithOwner()} ${event.subject().asIssue()?.title()}#${event.subject().asIssue()?.number()}"
|
||||
} else {
|
||||
"${event.subject().asIssue()?.title()}#${event.subject().asIssue()?.number()}"
|
||||
}
|
||||
} else if (event.subject().asPullRequest() != null) {
|
||||
if (event.isCrossRepository) {
|
||||
"${event.commitRepository().nameWithOwner()} ${event.subject().asPullRequest()?.title()}" +
|
||||
"#${event.subject().asPullRequest()?.number()}"
|
||||
} else {
|
||||
"${event.subject().asPullRequest()?.title()}#${event.subject().asPullRequest()?.number()}"
|
||||
}
|
||||
} else {
|
||||
event.commitRepository().nameWithOwner()
|
||||
})
|
||||
.append(" ")
|
||||
.append(ParseDateFormat.getTimeAgo((event.createdAt().toString())))
|
||||
stateImage.setImageResource(R.drawable.ic_push)
|
||||
avatarLayout.setUrl(it.avatarUrl().toString(), it.login(), false, LinkParserHelper.isEnterprise(it.url().toString()))
|
||||
}
|
||||
}
|
||||
|
||||
private fun milestoneEvent(event: PullRequestTimelineQuery.AsMilestonedEvent) {
|
||||
event.actor()?.let {
|
||||
stateText.text = SpannableBuilder.builder()
|
||||
.bold(it.login())
|
||||
.append(" ")
|
||||
.append("added this to the")
|
||||
.append(" ")
|
||||
.append(event.milestoneTitle()).append(" ").append("milestone")
|
||||
.append(" ")
|
||||
.append(ParseDateFormat.getTimeAgo((event.createdAt().toString())))
|
||||
stateImage.setImageResource(R.drawable.ic_milestone)
|
||||
avatarLayout.setUrl(it.avatarUrl().toString(), it.login(), false, LinkParserHelper.isEnterprise(it.url().toString()))
|
||||
}
|
||||
}
|
||||
|
||||
private fun mergedEvent(event: PullRequestTimelineQuery.AsMergedEvent) {
|
||||
event.actor()?.let {
|
||||
stateText.text = SpannableBuilder.builder()
|
||||
.bold(it.login())
|
||||
.append(" ")
|
||||
.append("merged commit")
|
||||
.append(" ")
|
||||
.url(substring(event.commit()?.oid()?.toString()))
|
||||
.append(" ")
|
||||
.append("into")
|
||||
.append(" ")
|
||||
.append(event.actor())
|
||||
.append(":")
|
||||
.append(event.mergeRefName(), BackgroundColorSpan(HtmlHelper.getWindowBackground(PrefGetter.getThemeType())))
|
||||
.append(" ")
|
||||
.append(ParseDateFormat.getTimeAgo((event.createdAt().toString())))
|
||||
stateImage.setImageResource(R.drawable.ic_merge)
|
||||
avatarLayout.setUrl(it.avatarUrl().toString(), it.login(), false, LinkParserHelper.isEnterprise(it.url().toString()))
|
||||
}
|
||||
}
|
||||
|
||||
private fun lockEvent(event: PullRequestTimelineQuery.AsLockedEvent) {
|
||||
event.actor()?.let {
|
||||
stateText.text = SpannableBuilder.builder()
|
||||
.bold(it.login())
|
||||
.append(" ")
|
||||
.append("locked and limited conversation to collaborators")
|
||||
.append(" ")
|
||||
.append(ParseDateFormat.getTimeAgo((event.createdAt().toString())))
|
||||
stateImage.setImageResource(R.drawable.ic_lock)
|
||||
avatarLayout.setUrl(it.avatarUrl().toString(), it.login(), false, LinkParserHelper.isEnterprise(it.url().toString()))
|
||||
}
|
||||
}
|
||||
|
||||
private fun labeledEvent(event: PullRequestTimelineQuery.AsLabeledEvent) {
|
||||
event.actor()?.let {
|
||||
val color = Color.parseColor("#" + event.label().color())
|
||||
stateText.text = SpannableBuilder.builder()
|
||||
.bold(it.login())
|
||||
.append(" ")
|
||||
.append("labeled")
|
||||
.append(" ")
|
||||
.append(event.label().name(), CodeSpan(color, ViewHelper.generateTextColor(color), 5.0f))
|
||||
.append(" ")
|
||||
.append(ParseDateFormat.getTimeAgo((event.createdAt().toString())))
|
||||
stateImage.setImageResource(R.drawable.ic_label)
|
||||
avatarLayout.setUrl(it.avatarUrl().toString(), it.login(), false, LinkParserHelper.isEnterprise(it.url().toString()))
|
||||
}
|
||||
}
|
||||
|
||||
private fun headRefRestoredEvent(event: PullRequestTimelineQuery.AsHeadRefRestoredEvent) {
|
||||
event.actor()?.let {
|
||||
stateText.text = SpannableBuilder.builder()
|
||||
.bold(it.login())
|
||||
.append(" ")
|
||||
.append("restored the")
|
||||
.append(" ")
|
||||
.append(it.login())
|
||||
.append(":")
|
||||
.append(event.pullRequest().headRefName(), BackgroundColorSpan(HtmlHelper.getWindowBackground(PrefGetter.getThemeType())))
|
||||
.append(" ")
|
||||
.append("branch")
|
||||
.append(" ")
|
||||
.append(ParseDateFormat.getTimeAgo((event.createdAt().toString())))
|
||||
stateImage.setImageResource(R.drawable.ic_push)
|
||||
avatarLayout.setUrl(it.avatarUrl().toString(), it.login(), false, LinkParserHelper.isEnterprise(it.url().toString()))
|
||||
}
|
||||
}
|
||||
|
||||
private fun refForPushedEvent(event: PullRequestTimelineQuery.AsHeadRefForcePushedEvent) {
|
||||
event.actor()?.let {
|
||||
stateText.text = SpannableBuilder.builder()
|
||||
.bold(it.login())
|
||||
.append(" ")
|
||||
.append("reference force pushed to", BackgroundColorSpan(HtmlHelper.getWindowBackground(PrefGetter.getThemeType())))
|
||||
.append(" ")
|
||||
.url(substring(event.afterCommit().oid().toString()))
|
||||
.append(" ")
|
||||
.append(ParseDateFormat.getTimeAgo((event.createdAt().toString())))
|
||||
stateImage.setImageResource(R.drawable.ic_push)
|
||||
avatarLayout.setUrl(it.avatarUrl().toString(), it.login(), false, LinkParserHelper.isEnterprise(it.url().toString()))
|
||||
}
|
||||
}
|
||||
|
||||
private fun refDeletedEvent(event: PullRequestTimelineQuery.AsHeadRefDeletedEvent) {
|
||||
event.actor()?.let {
|
||||
stateText.text = SpannableBuilder.builder()
|
||||
.bold(it.login())
|
||||
.append(" ")
|
||||
.append("deleted the")
|
||||
.append(" ")
|
||||
.append(it.login())
|
||||
.append(":")
|
||||
.append(substring(event.headRefName()), BackgroundColorSpan(HtmlHelper.getWindowBackground(PrefGetter.getThemeType())))
|
||||
.append(" ")
|
||||
.append("branch")
|
||||
.append(" ")
|
||||
.append(ParseDateFormat.getTimeAgo((event.createdAt().toString())))
|
||||
stateImage.setImageResource(R.drawable.ic_trash)
|
||||
avatarLayout.setUrl(it.avatarUrl().toString(), it.login(), false, LinkParserHelper.isEnterprise(it.url().toString()))
|
||||
}
|
||||
}
|
||||
|
||||
private fun deployedEvent(event: PullRequestTimelineQuery.AsDeployedEvent) {
|
||||
event.actor()?.let {
|
||||
stateText.text = SpannableBuilder.builder()
|
||||
.bold(it.login())
|
||||
.append(" ")
|
||||
.append("made a deployment", BackgroundColorSpan(HtmlHelper.getWindowBackground(PrefGetter.getThemeType())))
|
||||
.append(" ")
|
||||
.append(event.deployment().latestStatus()?.state()?.name)
|
||||
.append(" ")
|
||||
.append(ParseDateFormat.getTimeAgo((event.createdAt().toString())))
|
||||
stateImage.setImageResource(R.drawable.ic_push)
|
||||
avatarLayout.setUrl(it.avatarUrl().toString(), it.login(), false, LinkParserHelper.isEnterprise(it.url().toString()))
|
||||
}
|
||||
}
|
||||
|
||||
private fun demilestonedEvent(event: PullRequestTimelineQuery.AsDemilestonedEvent) {
|
||||
event.actor()?.let {
|
||||
stateText.text = SpannableBuilder.builder()
|
||||
.bold(it.login())
|
||||
.append(" ")
|
||||
.append("removed this from the")
|
||||
.append(" ")
|
||||
.append(event.milestoneTitle()).append(" ").append("milestone")
|
||||
.append(" ")
|
||||
.append(ParseDateFormat.getTimeAgo((event.createdAt().toString())))
|
||||
stateImage.setImageResource(R.drawable.ic_milestone)
|
||||
avatarLayout.setUrl(it.avatarUrl().toString(), it.login(), false, LinkParserHelper.isEnterprise(it.url().toString()))
|
||||
}
|
||||
}
|
||||
|
||||
private fun commitEvent(event: PullRequestTimelineQuery.AsCommit) {
|
||||
event.author()?.let {
|
||||
stateText.text = SpannableBuilder.builder()//Review[k0shk0sh] We may want to suppress more then 3 or 4 commits. since it will clog the it
|
||||
.bold(if (it.user() == null) it.name() else it.user()?.login())
|
||||
.append(" ")
|
||||
.append("committed")
|
||||
.append(" ")
|
||||
.append(event.messageHeadline())
|
||||
.append(" ")
|
||||
.url(substring(event.oid().toString()))
|
||||
.append(" ")
|
||||
.append(ParseDateFormat.getTimeAgo((event.committedDate().toString())))
|
||||
stateImage.setImageResource(R.drawable.ic_push)
|
||||
avatarLayout.setUrl(it.user()?.avatarUrl().toString(), it.user()?.login(), false,
|
||||
LinkParserHelper.isEnterprise(it.user()?.url().toString()))
|
||||
event.status()?.let {
|
||||
commitStatus.visibility = View.VISIBLE
|
||||
val context = commitStatus.context
|
||||
commitStatus.tintDrawableColor(when (it.state()) {
|
||||
StatusState.ERROR -> ContextCompat.getColor(context, R.color.material_red_700)
|
||||
StatusState.FAILURE -> ContextCompat.getColor(context, R.color.material_deep_orange_700)
|
||||
StatusState.SUCCESS -> ContextCompat.getColor(context, R.color.material_green_700)
|
||||
else -> ContextCompat.getColor(context, R.color.material_yellow_700)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun closedEvent(event: PullRequestTimelineQuery.AsClosedEvent) {
|
||||
event.actor()?.let {
|
||||
stateText.text = SpannableBuilder.builder()
|
||||
.bold(it.login())
|
||||
.append(" ")
|
||||
.append("closed this in")
|
||||
.append(" ")
|
||||
.url(substring(event.commit()?.oid()?.toString()))
|
||||
.append(" ")
|
||||
.append(ParseDateFormat.getTimeAgo((event.createdAt().toString())))
|
||||
stateImage.setImageResource(R.drawable.ic_merge)
|
||||
avatarLayout.setUrl(it.avatarUrl().toString(), it.login(), false, LinkParserHelper.isEnterprise(it.url().toString()))
|
||||
}
|
||||
}
|
||||
|
||||
private fun forcePushEvent(event: PullRequestTimelineQuery.AsBaseRefForcePushedEvent) {
|
||||
event.actor()?.let {
|
||||
stateText.text = SpannableBuilder.builder()
|
||||
.bold(it.login())
|
||||
.append(" ")
|
||||
.append("force pushed to", BackgroundColorSpan(HtmlHelper.getWindowBackground(PrefGetter.getThemeType())))
|
||||
.append(" ")
|
||||
.url(substring(event.afterCommit().oid().toString()))
|
||||
.append(" ")
|
||||
.append(ParseDateFormat.getTimeAgo((event.createdAt().toString())))
|
||||
stateImage.setImageResource(R.drawable.ic_push)
|
||||
avatarLayout.setUrl(it.avatarUrl().toString(), it.login(), false, LinkParserHelper.isEnterprise(it.url().toString()))
|
||||
}
|
||||
}
|
||||
|
||||
private fun assignedEvent(event: PullRequestTimelineQuery.AsAssignedEvent) {
|
||||
event.actor()?.let {
|
||||
stateText.text = SpannableBuilder.builder()
|
||||
.bold(it.login())
|
||||
.append(" ")
|
||||
.append("assigned") //TODO add "self-assigned" for self
|
||||
.append(" ")
|
||||
.append(event.user()?.login())
|
||||
.append(" ")
|
||||
.append(ParseDateFormat.getTimeAgo((event.createdAt().toString())))
|
||||
stateImage.setImageResource(R.drawable.ic_profile)
|
||||
avatarLayout.setUrl(it.avatarUrl().toString(), it.login(), false, LinkParserHelper.isEnterprise(it.url().toString()))
|
||||
}
|
||||
}
|
||||
|
||||
private fun substring(value: String?): String {
|
||||
if (value == null) {
|
||||
return ""
|
||||
}
|
||||
return if (value.length <= 7) value
|
||||
else value.substring(0, 7)
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun newInstance(parent: ViewGroup, adapter: BaseRecyclerAdapter<*, *, *>): PullRequestEventViewHolder {
|
||||
return PullRequestEventViewHolder(getView(parent, R.layout.issue_timeline_row_item), adapter)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -450,8 +450,8 @@
|
||||
<string name="projects">Proyectos</string>
|
||||
<string name="no_projects">No hay proyectos</string>
|
||||
<string name="no_cards">No hay cartas</string>
|
||||
<string name="card_added_by">Agregado por %s %s</string>
|
||||
<string name="too_large_changes">Muchas diferencias para mostrar. Por favor, ver via navegador web</string>
|
||||
<string name="card_added_by" formatted="false">Agregado por %s %s</string>
|
||||
<string name="too_large_changes">Muchas diferencias para mostrar. Por favor, ver vía navegador web</string>
|
||||
<string name="project">Proyecto</string>
|
||||
<string name="please_read">POR FAVOR, LEER!</string>
|
||||
<string name="fasthub_faq_description">
|
||||
@ -475,7 +475,7 @@
|
||||
Alternativamente, puedes iniciar sesión con un Access Token.</p>
|
||||
|
||||
<h5>• Estoy teniendo problemas! / Quiero sugerirles cosas!</h5>
|
||||
<p>Ve a https://github.com/k0shk0sh/FastHub/issues/new y crea un nuevo issue por cualquier 'bug' o solicitud de característica.
|
||||
<p>Ve a https://github.com/k0shk0sh/FastHub/issues/new y crea un nuevo issue por cualquier bug o solicitud de característica.
|
||||
Pedimos que busques por issues similares antes de abrir uno nuevo. Cualquier ticket duplicado será etiquetado y borrado inmediatamente.</p>
|
||||
|
||||
<h5>• Cómo puedo obtener un PROMO CODE?</h5>
|
||||
|
||||
@ -330,7 +330,7 @@
|
||||
<string name="basic_login">Se connecter via l\'authentification simple</string>
|
||||
<string name="no_orgs_description">Si vous êtes actuellement lié à une organisation et que vous ne pouvez pas la voir ici,
|
||||
veuillez suivre le lien ci-dessous.\nhttps://help.github.com/articles/about-third-party-application-restrictions\nPS: Vous pouvez
|
||||
utiliser le token Access pour vous connecter, ce qui permettra à FastHub d'accéder à la liste de vos organisations\nVous pouvez
|
||||
utiliser le token Access pour vous connecter, ce qui permettra à FastHub d\'accéder à la liste de vos organisations\nVous pouvez
|
||||
aussi ouvrir https://github.com/settings/applications et chercher FastHub. Ouvrez le puis faites défiler jusqu\'à Accès aux organisations
|
||||
et cliquez sur le bouton Accorder.</string>
|
||||
<string name="insert">Insérer</string>
|
||||
@ -422,7 +422,7 @@
|
||||
<string name="projects">Projets</string>
|
||||
<string name="no_projects">Aucun projet</string>
|
||||
<string name="no_cards">Aucune carte</string>
|
||||
<string name="card_added_by">Ajouté par %s %s</string>
|
||||
<string name="card_added_by" formatted="false">Ajouté par %s %s</string>
|
||||
<string name="too_large_changes">Trop de différences à afficher. Merci de les afficher via le navigateur</string>
|
||||
<string name="project">Projet</string>
|
||||
<string name="please_read">MERCI DE LIRE !</string>
|
||||
@ -451,7 +451,7 @@
|
||||
]]></string>
|
||||
<string name="faq">FAQ</string>
|
||||
<string name="comments_added_successfully">Commentaires ajoutés avec succès</string>
|
||||
<string name="clear_search_keywords">Vider l'historique de recherche</string>
|
||||
<string name="clear_search_keywords">Vider l\'historique de recherche</string>
|
||||
<string name="restore_purchases">Restorer les achats</string>
|
||||
<string name="include_forks">Inclure les Forks</string>
|
||||
<string name="comment_is_too_far_to_paginate">Le commentaire est trop loin pour être trouvé</string>
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:ignore="MissingTranslation">
|
||||
<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="MissingTranslation">
|
||||
<string name="in_progress">Caricamento, attendi per favore…</string>
|
||||
<string name="action">Azione</string>
|
||||
<string name="settings">Impostazioni</string>
|
||||
@ -432,27 +431,27 @@
|
||||
<string name="projects">Progetti</string>
|
||||
<string name="no_projects">Nessun Progetto</string>
|
||||
<string name="no_cards">Nessuna Card</string>
|
||||
<string name="card_added_by">Aggiunto da %s %s</string>
|
||||
<string name="card_added_by" formatted="false">Aggiunto da %s %s</string>
|
||||
<string name="too_large_changes">Troppe differenze da visualizzare. Perfavore, visualizzarli tramite un browser.</string>
|
||||
<string name="project">Progetto</string>
|
||||
<string name="please_read">PERFAVORE LEGGERE!</string>
|
||||
<string name="fasthub_faq_description">
|
||||
<![CDATA[
|
||||
<h5>• Perchè non posso visualizzare le mie <b>Organizzazioni</b> <i>Private</i> o <i>Pubbliche</i>?</h5>
|
||||
<h5>• Perché non posso visualizzare le mie <b>Organizzazioni</b> <i>Private</i> o <i>Pubbliche</i>?</h5>
|
||||
<p>Apri https://github.com/settings/applications e cerca FastHub, aprilo e scorri fino a Accesso organizzazione("Organization access") e cliccare il pulsante Permetti("Grant")
|
||||
Alternativamente puoi accedere utilizzando il <b>Token di Accesso</b> che faciliterà il processo..</p>
|
||||
|
||||
<h5>• Ho provato ad accedere con un Token di accesso e una Password One-Time (OTP) senza alcun successo. Cosa c\'è di sbagliato?</h5>
|
||||
<h5>• Ho provato ad accedere con un Token di accesso e una Password One-Time (OTP) senza alcun successo. Cosa c\è di sbagliato?</h5>
|
||||
<p>Non puoi accedere con il Token si accesso e con OTP tutto insieme. A causa del limitato tempo di vita do queste password, devi ripetere ogni procedura di accesso ogni qualche secondo.</p>
|
||||
|
||||
<h5>• Perché non sono le mie Wiki nei repository privati ed Enterprise mostrati?</h5>
|
||||
<p>Mentre FastHub ritrae le pagine Wiki di GitHub, l'applicazione non è in grado di ottenere alcun token di sessione richiesto dai repository privati.</p>
|
||||
<p>Mentre FastHub ritrae le pagine Wiki di GitHub, lapplicazione non è in grado di ottenere alcun token di sessione richiesto dai repository privati.</p>
|
||||
|
||||
<h5>• Ho effettuato l'accesso al mio account aziendale. Perché non posso interagire con qualcosa di diverso dal mio Enterprise GitHub?</h5>
|
||||
<h5>• Ho effettuato laccesso al mio account aziendale. Perché non posso interagire con qualcosa di diverso dal mio Enterprise GitHub?</h5>
|
||||
<p>Bene, logicamente, non puoi accedere ad altro che non sia la tua Enterprise. FastHub tenta di richiedere il maggior numero possibile di autorizzazioni, ma non può fare altro nella maggior parte dei casi, poiché le credenziali non sono sul server di GitHub. Ma in <b>alcuni</b> casi il token OAuth del tuo account GitHub farà tutto.</p>
|
||||
|
||||
<h5>• Perché ho problemi con la modifica di Problemi/Pull Requests (PRs)?</h5>
|
||||
<p>Se non si è in grado di modificare Problemi/PR nel repository di un'organizzazione pubblica, contattare la propria organizzazione per concedere l'accesso a FastHub. In alternativa puoi accedere con un token di accesso.</p>
|
||||
<p>Se non si è in grado di modificare Problemi/PR nel repository di unorganizzazione pubblica, contattare la propria organizzazione per concedere laccesso a FastHub. In alternativa puoi accedere con un token di accesso.</p>
|
||||
|
||||
<h5>• Sto avendo problemi! / Voglio suggerirti alcune cose!</h5>
|
||||
<p>Vai a https://github.com/k0shk0sh/FastHub/issues/new e crea un nuovo problema per eventuali bug e richieste di funzionalità. Ti incoraggio davvero a cercare problemi simili prima di aprirne uno nuovo. Qualsiasi ticket duplicato sarà etichettato come duplicato e chiuso immediatamente.</p>
|
||||
|
||||
@ -422,14 +422,14 @@
|
||||
<string name="projects">Проекты</string>
|
||||
<string name="no_projects">Проекты отсутствуют</string>
|
||||
<string name="no_cards">Карточки отсутствуют</string>
|
||||
<string name="card_added_by">Добавлено %s %s</string>
|
||||
<string name="card_added_by" formatted="false">Добавлено %s %s</string>
|
||||
<string name="too_large_changes">Слишком много изменений для отображения. Посмотрите их, пожалуйста, в браузере</string>
|
||||
<string name="project">Проект</string>
|
||||
<string name="please_read">ПОЖАЛУЙСТА, ОЗНАКОМЬТЕСЬ!</string>
|
||||
<string name="fasthub_faq_description">
|
||||
<![CDATA[
|
||||
<h5>• Почему я не вижу Организаций, в которых состою?</h5>
|
||||
<p>Перейдите по ссылке https://github.com/settings/applications, выберите FastHub, напротив 'Organization access' ('Доступ к организациям') нажмите кнопку 'Grant' ('Предоставить').
|
||||
<p>Перейдите по ссылке https://github.com/settings/applications, выберите FastHub, напротив Organization access (Доступ к организациям) нажмите кнопку Grant (Предоставить).
|
||||
Хорошей и простой альтернативой будет выполнение входа при помощи Маркера доступа (Access Token).</p>
|
||||
<h5>• Я попытался выполнить вход, используя Маркер доступа (Access Token) и одноразовый пароль, но безуспешно. В чём дело?</h5>
|
||||
<p>Вы не сможете выполнить вход при помощи Маркера доступа и одноразового пароля. Так как такие пароли имеют ограниченный срок действия, вам придётся проделывать операцию входа каждые несколько секунд.</p>
|
||||
|
||||
@ -23,5 +23,5 @@
|
||||
<dimen name="avatar_margin_end">16dp</dimen>
|
||||
<integer name="micro_spans">1</integer>
|
||||
<integer name="small_spans">1</integer>
|
||||
<item name="drawable_callback" type="id">drawable_callback</item>
|
||||
<item name="drawable_callback" type="id"/>
|
||||
</resources>
|
||||
|
||||
@ -1,40 +0,0 @@
|
||||
package com.fastaccess.login;
|
||||
|
||||
import com.fastaccess.ui.modules.login.LoginMvp;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
import org.mockito.Mock;
|
||||
|
||||
/**
|
||||
* Created by Kosh on 02 May 2017, 7:52 PM
|
||||
*/
|
||||
|
||||
@RunWith(JUnit4.class)
|
||||
public class LoginPresenterTest {
|
||||
|
||||
@Mock private LoginMvp.View view;
|
||||
|
||||
@Before public void setUp() throws Exception {
|
||||
// MockitoAnnotations.initMocks(this);
|
||||
// final TiPresenterInstructor<LoginMvp.View> instructor = new TiPresenterInstructor<>(new LoginPresenter());
|
||||
// instructor.attachView(view);
|
||||
}
|
||||
|
||||
@Test public void onTokenResponse() throws Exception {}
|
||||
|
||||
@Test public void onHandleAuthIntent() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
@Test public void onUserResponse() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
@Test public void login() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
13
build.gradle
13
build.gradle
@ -13,7 +13,7 @@ buildscript {
|
||||
assertjVersion = '2.5.0'
|
||||
espresseVersion = '2.2.2'
|
||||
requery = '1.3.2'
|
||||
kotlin_version = '1.2.10'
|
||||
kotlin_version = '1.3.61'
|
||||
commonmark = '0.10.0'
|
||||
glideVersion = '3.7.0'
|
||||
}
|
||||
@ -23,13 +23,12 @@ buildscript {
|
||||
maven { url 'https://maven.fabric.io/public' }
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.2.0-alpha08'
|
||||
classpath 'com.google.gms:google-services:3.2.0'
|
||||
classpath 'com.novoda:gradle-build-properties-plugin:0.3'
|
||||
classpath 'com.dicedmelon.gradle:jacoco-android:0.1.2'
|
||||
classpath 'io.fabric.tools:gradle:1.24.1'
|
||||
classpath 'com.apollographql.apollo:gradle-plugin:0.4.1'
|
||||
classpath 'com.android.tools.build:gradle:3.5.3'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlin_version}"
|
||||
classpath 'com.google.gms:google-services:3.2.0'
|
||||
classpath 'com.novoda:gradle-build-properties-plugin:0.4.1'
|
||||
classpath 'io.fabric.tools:gradle:1.31.2'
|
||||
classpath 'com.apollographql.apollo:apollo-gradle-plugin:1.2.2'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
4
gradle/wrapper/gradle-wrapper.properties
vendored
4
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,7 +1,7 @@
|
||||
#Fri Feb 16 18:31:07 CET 2018
|
||||
#Wed Dec 25 06:39:30 CET 2019
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.5-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
|
||||
android.enableD8=true
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user