Merge branch 'development'

This commit is contained in:
k0shk0sh 2019-12-27 22:13:34 +01:00
commit 429f984bf4
27 changed files with 381 additions and 272 deletions

View File

@ -8,10 +8,10 @@ apply plugin: 'io.fabric'
buildProperties {
notThere {
file rootProject.file('debug_gradle.properties')
using rootProject.file('debug_gradle.properties')
}
secrets {
file rootProject.file('release_gradle.properties')
using rootProject.file('release_gradle.properties')
}
}
@ -29,8 +29,8 @@ android {
applicationId "com.fastaccess.github"
minSdkVersion 21
targetSdkVersion 29
versionCode 469
versionName "4.6.9"
versionCode 470
versionName "4.7.0"
buildConfigString "GITHUB_CLIENT_ID", (buildProperties.secrets['github_client_id'] | buildProperties.notThere['github_client_id']).string
buildConfigString "GITHUB_SECRET", (buildProperties.secrets['github_secret'] | buildProperties.notThere['github_secret']).string
buildConfigString "IMGUR_CLIENT_ID", (buildProperties.secrets['imgur_client_id'] | buildProperties.notThere['imgur_client_id']).string
@ -38,7 +38,6 @@ android {
buildConfigField "String", "REST_URL", '"https://api.github.com/"'
buildConfigField "String", "IMGUR_URL", '"https://api.imgur.com/3/"'
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
javaCompileOptions {
annotationProcessorOptions {
includeCompileClasspath true
@ -54,14 +53,10 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
if (!rootProject.file('gradle.properties').exists()) {
signingConfig signingConfigs.signing
}
applicationIdSuffix ".debug"
versionNameSuffix "-debug"
ext.alwaysUpdateBuildId = false
}
}
sourceSets {
@ -99,14 +94,6 @@ android {
jumboMode true
javaMaxHeapSize "4g"
}
testOptions {
unitTests.returnDefaultValues = true
}
}
kapt {
generateStubs = true
}
repositories {
@ -139,7 +126,7 @@ dependencies {
implementation 'it.sephiroth.android.library.bottomnavigation:bottom-navigation:2.0.2'
implementation 'io.reactivex.rxjava2:rxjava:2.2.15'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
implementation 'com.squareup.okhttp3:logging-interceptor:4.2.1'
implementation 'com.squareup.okhttp3:logging-interceptor:4.2.2'
implementation 'com.annimon:stream:1.1.9'
implementation 'com.github.GrenderG:Toasty:1.1.3'
implementation 'com.github.k0shk0sh:RetainedDateTimePickers:1.0.2'
@ -156,7 +143,8 @@ dependencies {
implementation "com.atlassian.commonmark:commonmark-ext-gfm-tables:${commonmark}"
implementation "com.atlassian.commonmark:commonmark-ext-ins:${commonmark}"
implementation "com.atlassian.commonmark:commonmark-ext-yaml-front-matter:${commonmark}"
implementation "com.google.firebase:firebase-core:17.2.1"
implementation "com.google.firebase:firebase-analytics:17.2.1"
implementation "com.google.firebase:firebase-inappmessaging:19.0.2"
implementation "com.google.firebase:firebase-messaging:20.1.0"
implementation "com.google.firebase:firebase-database:19.2.0"
implementation "com.google.android.gms:play-services-base:17.1.0"
@ -170,10 +158,11 @@ dependencies {
implementation "petrov.kristiyan:colorpicker-library:1.1.4"
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 'com.jaredrummler:android-device-names:1.1.9'
implementation 'net.yslibrary.keyboardvisibilityevent:keyboardvisibilityevent:2.1.0'
implementation 'com.airbnb.android:lottie:3.0.7'
implementation 'com.airbnb.android:lottie:3.3.1'
implementation 'com.firebase:firebase-jobdispatcher:0.8.2'
implementation 'com.google.guava:guava:27.0.1-android' /*to be removed*/
debugImplementation 'com.github.whataa:pandora:2.0.6'
releaseImplementation 'com.github.whataa:pandora-no-op:2.0.3'
@ -185,7 +174,6 @@ dependencies {
kapt 'com.github.matthiasrobbers:shortbread-compiler:1.0.1'
kapt "io.requery:requery-processor:${requery}"
kapt "com.github.bumptech.glide:compiler:$glideVersion"
}
apply plugin: 'com.google.gms.google-services'

View File

@ -1,61 +1,37 @@
{
"project_info": {
"project_id": "this-is-a-sample",
"project_number": "999999999999",
"name": "FastHub Sample",
"firebase_url": "https://this-is-a-sample-do-not-use.firebaseio.com",
"storage_bucket": "this-is-a-sample-do-not-use.storage.firebase.com"
"project_number": "535903042804",
"firebase_url": "https://fasthub-dev-a1309.firebaseio.com",
"project_id": "fasthub-dev-a1309",
"storage_bucket": "fasthub-dev-a1309.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:999999999999:android:0000000000000000",
"mobilesdk_app_id": "1:535903042804:android:516309017e0298c938b2a1",
"android_client_info": {
"package_name": "com.fastaccess.github.debug"
}
},
"oauth_client": [
{
"client_id": "this-is-a-sample-do-not-use.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.fastaccess.github.debug",
"certificate_hash": "0000000000000000000000000000000000000000"
}
},
{
"client_id": "this-is-a-sample-do-not-use.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.fastaccess.github.debug",
"certificate_hash": "0000000000000000000000000000000000000000"
}
},
{
"client_id": "this-is-a-sample-do-not-use.apps.googleusercontent.com",
"client_id": "535903042804-14481m7poceb7ojv5roddqm28pg4ch5n.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "000000000000000000000000000000000000000"
"current_key": "AIzaSyBbRQtQN1UxFRgeSSfjZwQ5TRulc2lZUzI"
}
],
"services": {
"analytics_service": {
"status": 1
},
"appinvite_service": {
"status": 2,
"other_platform_oauth_client": [
{
"client_id": "this-is-a-sample-do-not-use.apps.googleusercontent.com",
"client_id": "535903042804-14481m7poceb7ojv5roddqm28pg4ch5n.apps.googleusercontent.com",
"client_type": 3
}
]
},
"ads_service": {
"status": 2
}
}
}

View File

@ -317,10 +317,6 @@
</intent-filter>
</service>
<meta-data
android:name="io.fabric.ApiKey"
android:value="6ed82b6e0756853d7d782a3f547f84f9ecba217e" />
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="@drawable/ic_notification" />

View File

@ -2,11 +2,14 @@ package com.fastaccess.data.dao;
import android.os.Parcel;
import android.os.Parcelable;
import androidx.annotation.Nullable;
import com.fastaccess.data.dao.model.User;
import com.google.gson.annotations.SerializedName;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.List;
@ -24,12 +27,14 @@ import github.PullRequestTimelineQuery;
public long id;
public String url;
public int total_count;
@SerializedName("+1") public int plusOne;
@SerializedName("-1") public int minusOne;
@SerializedName(value = "+1", alternate = "thumbs_up") public int plusOne;
@SerializedName(value = "-1", alternate = "thumbs_down") public int minusOne;
public int laugh;
public int hooray;
public int confused;
public int heart;
public int rocket;
public int eyes;
public String content;
public User user;
public boolean viewerHasReacted;
@ -37,7 +42,7 @@ import github.PullRequestTimelineQuery;
public ReactionsModel() {}
@Override public String toString() {
@NotNull @Override public String toString() {
return "ReactionsModel{" +
"id=" + id +
", url='" + url + '\'' +
@ -48,6 +53,8 @@ import github.PullRequestTimelineQuery;
", hooray=" + hooray +
", confused=" + confused +
", heart=" + heart +
", rocket=" + rocket +
", eyes=" + eyes +
'}';
}
@ -63,6 +70,8 @@ import github.PullRequestTimelineQuery;
dest.writeInt(this.hooray);
dest.writeInt(this.confused);
dest.writeInt(this.heart);
dest.writeInt(this.rocket);
dest.writeInt(this.eyes);
dest.writeString(this.content);
dest.writeParcelable(this.user, flags);
dest.writeByte(this.isCallingApi ? (byte) 1 : (byte) 0);
@ -78,6 +87,8 @@ import github.PullRequestTimelineQuery;
this.hooray = in.readInt();
this.confused = in.readInt();
this.heart = in.readInt();
this.rocket = in.readInt();
this.eyes = in.readInt();
this.content = in.readString();
this.user = in.readParcelable(User.class.getClassLoader());
this.isCallingApi = in.readByte() != 0;
@ -88,46 +99,4 @@ import github.PullRequestTimelineQuery;
@Override public ReactionsModel[] newArray(int size) {return new ReactionsModel[size];}
};
@NonNull public static List<ReactionsModel> getReactionGroup(@Nullable List<PullRequestTimelineQuery.ReactionGroup> reactions) {
List<ReactionsModel> models = new ArrayList<>();
if (reactions != null && !reactions.isEmpty()) {
for (PullRequestTimelineQuery.ReactionGroup reaction : reactions) {
ReactionsModel model = new ReactionsModel();
model.setContent(reaction.content().name());
model.setViewerHasReacted(reaction.viewerHasReacted());
model.setTotal_count(reaction.users().totalCount());
models.add(model);
}
}
return models;
}
@NonNull public static List<ReactionsModel> getReaction(@Nullable List<PullRequestTimelineQuery.ReactionGroup1> reactions) {
List<ReactionsModel> models = new ArrayList<>();
if (reactions != null && !reactions.isEmpty()) {
for (PullRequestTimelineQuery.ReactionGroup1 reaction : reactions) {
ReactionsModel model = new ReactionsModel();
model.setContent(reaction.content().name());
model.setViewerHasReacted(reaction.viewerHasReacted());
model.setTotal_count(reaction.users().totalCount());
models.add(model);
}
}
return models;
}
@NonNull public static List<ReactionsModel> getReaction2(@Nullable List<PullRequestTimelineQuery.ReactionGroup2> reactions) {
List<ReactionsModel> models = new ArrayList<>();
if (reactions != null && !reactions.isEmpty()) {
for (PullRequestTimelineQuery.ReactionGroup2 reaction : reactions) {
ReactionsModel model = new ReactionsModel();
model.setContent(reaction.content().name());
model.setViewerHasReacted(reaction.viewerHasReacted());
model.setTotal_count(reaction.users().totalCount());
models.add(model);
}
}
return models;
}
}

View File

@ -14,10 +14,12 @@ public enum ReactionTypes {
HEART("heart", R.id.heart, R.id.heartReaction),
HOORAY("hooray", R.id.hurray, R.id.hurrayReaction),
PLUS_ONE("+1", R.id.thumbsUp, R.id.thumbsUpReaction),
MINUS_ONE("-1", R.id.thumbsDown, R.id.thumbsDownReaction),
PLUS_ONE("thumbs_up", R.id.thumbsUp, R.id.thumbsUpReaction),
MINUS_ONE("thumbs_down", R.id.thumbsDown, R.id.thumbsDownReaction),
CONFUSED("confused", R.id.sad, R.id.sadReaction),
LAUGH("laugh", R.id.laugh, R.id.laughReaction);
LAUGH("laugh", R.id.laugh, R.id.laughReaction),
ROCKET("rocket", R.id.rocket, R.id.rocketReaction),
EYES("eyes", R.id.eyes, R.id.eyeReaction);
private String content;
private int vId;

View File

@ -120,7 +120,6 @@ public class RestProvider {
public static int getErrorCode(Throwable throwable) {
if (throwable instanceof HttpException) {
return ((HttpException) throwable).code();
}
return -1;
}

View File

@ -1,8 +1,10 @@
package com.fastaccess.provider.timeline;
import android.content.Context;
import androidx.annotation.IdRes;
import androidx.annotation.NonNull;
import android.view.View;
import android.widget.TextView;
@ -16,6 +18,8 @@ import com.fastaccess.data.dao.types.ReactionTypes;
import com.fastaccess.provider.tasks.git.ReactionService;
import com.fastaccess.ui.widgets.SpannableBuilder;
import org.w3c.dom.Text;
import java.util.ArrayList;
import java.util.List;
@ -31,41 +35,14 @@ public class CommentsHelper {
private static final int THUMBS_DOWN = 0x1f44e;
private static final int HOORAY = 0x1f389;
private static final int HEART = 0x2764;
private static final int ROCKET = 0x1f680;
private static final int EYES = 0x1f440;
public static boolean isOwner(@NonNull String currentLogin, @NonNull String repoOwner, @NonNull String commentUser) {
return currentLogin.equalsIgnoreCase(repoOwner) || currentLogin.equalsIgnoreCase(commentUser);
}
public static void handleReactions(@NonNull Context context, @NonNull String login, @NonNull String repoId,
@IdRes int id, long commentId, boolean commit, boolean isDelete,
boolean isEnterprise) {
ReactionTypes type = null;
switch (id) {
case R.id.heart:
type = ReactionTypes.HEART;
break;
case R.id.sad:
type = ReactionTypes.CONFUSED;
break;
case R.id.thumbsDown:
type = ReactionTypes.MINUS_ONE;
break;
case R.id.thumbsUp:
type = ReactionTypes.PLUS_ONE;
break;
case R.id.laugh:
type = ReactionTypes.LAUGH;
break;
case R.id.hurray:
type = ReactionTypes.HOORAY;
break;
}
if (type != null) {
ReactionService.start(context, login, repoId, commentId, type, commit, isDelete, isEnterprise);
}
}
private static String getEmojiByUnicode(int unicode) {
return new String(Character.toChars(unicode));
}
@ -76,14 +53,16 @@ public class CommentsHelper {
return getHeart();
case HOORAY:
return getHooray();
case PLUS_ONE:
return getThumbsUp();
case MINUS_ONE:
return getThumbsDown();
case CONFUSED:
return getSad();
case LAUGH:
return getLaugh();
case ROCKET:
return getRocket();
case EYES:
return getEyes();
default:
return getThumbsUp();
}
@ -113,6 +92,14 @@ public class CommentsHelper {
return getEmojiByUnicode(HEART);
}
public static String getRocket() {
return getEmojiByUnicode(ROCKET);
}
public static String getEyes() {
return getEmojiByUnicode(EYES);
}
@NonNull public static ArrayList<String> getUsers(@NonNull List<Comment> comments) {
return Stream.of(comments)
.filter(comment -> comment.getUser() != null)
@ -129,13 +116,17 @@ public class CommentsHelper {
.collect(Collectors.toCollection(ArrayList::new));
}
public static void appendEmojies(@NonNull ReactionsModel reaction, @NonNull TextView thumbsUp,
@NonNull TextView thumbsUpReaction, @NonNull TextView thumbsDown,
@NonNull TextView thumbsDownReaction, @NonNull TextView hurray,
@NonNull TextView hurrayReaction, @NonNull TextView sad,
@NonNull TextView sadReaction, @NonNull TextView laugh,
@NonNull TextView laughReaction, @NonNull TextView heart,
@NonNull TextView heartReaction, @NonNull View reactionsList) {
public static void appendEmojies(
@NonNull ReactionsModel reaction, @NonNull TextView thumbsUp,
@NonNull TextView thumbsUpReaction, @NonNull TextView thumbsDown,
@NonNull TextView thumbsDownReaction, @NonNull TextView hurray,
@NonNull TextView hurrayReaction, @NonNull TextView sad,
@NonNull TextView sadReaction, @NonNull TextView laugh,
@NonNull TextView laughReaction, @NonNull TextView heart,
@NonNull TextView heartReaction, @NonNull TextView rocket,
@NonNull TextView rocketReaction, @NonNull TextView eye,
@NonNull TextView eyeReaction, @NonNull View reactionsList
) {
SpannableBuilder spannableBuilder = SpannableBuilder.builder()
.append(CommentsHelper.getThumbsUp()).append(" ")
.append(String.valueOf(reaction.getPlusOne()))
@ -173,10 +164,27 @@ public class CommentsHelper {
laughReaction.setVisibility(reaction.getLaugh() > 0 ? View.VISIBLE : View.GONE);
spannableBuilder = SpannableBuilder.builder()
.append(CommentsHelper.getHeart()).append(" ")
.append(String.valueOf(reaction.getHeart()));
.append(String.valueOf(reaction.getHeart()))
.append(" ");
heart.setText(spannableBuilder);
heartReaction.setText(spannableBuilder);
heartReaction.setVisibility(reaction.getHeart() > 0 ? View.VISIBLE : View.GONE);
spannableBuilder = SpannableBuilder.builder()
.append(CommentsHelper.getRocket()).append(" ")
.append(String.valueOf(reaction.getRocket()))
.append(" ");
rocket.setText(spannableBuilder);
rocketReaction.setText(spannableBuilder);
rocketReaction.setVisibility(reaction.getRocket() > 0 ? View.VISIBLE : View.GONE);
spannableBuilder = SpannableBuilder.builder()
.append(CommentsHelper.getEyes()).append(" ")
.append(String.valueOf(reaction.getEyes()));
eye.setText(spannableBuilder);
eyeReaction.setText(spannableBuilder);
eyeReaction.setVisibility(reaction.getEyes() > 0 ? View.VISIBLE : View.GONE);
if (reaction.getPlusOne() > 0 || reaction.getMinusOne() > 0
|| reaction.getLaugh() > 0 || reaction.getHooray() > 0
|| reaction.getConfused() > 0 || reaction.getHeart() > 0) {

View File

@ -41,7 +41,6 @@ import static android.text.Spanned.SPAN_EXCLUSIVE_EXCLUSIVE;
builder.append("\n");
DrawableGetter imageGetter = new DrawableGetter(textView, width);
builder.setSpan(new ImageSpan(imageGetter.getDrawable(src)), start, builder.length(), SPAN_EXCLUSIVE_EXCLUSIVE);
builder.setSpan(new CenterSpan(), start, builder.length(), SPAN_EXCLUSIVE_EXCLUSIVE);
builder.append("\n");
} else {
builder.append(SpannableBuilder.builder().clickable("Image", v -> SchemeParser.launchUri(v.getContext(), src)));

View File

@ -71,7 +71,7 @@ import static android.text.Spanned.SPAN_EXCLUSIVE_EXCLUSIVE;
this.appendNewLine(builder);
this.appendNewLine(builder);
} else {
StringBuffer text = node.getText();
CharSequence text = node.getText();
builder.append(" ");
builder.append(replace(text.toString()));
builder.append(" ");

View File

@ -40,8 +40,8 @@ public class DrawableGetter implements Html.ImageGetter, Drawable.Callback {
final RequestBuilder load = Glide.with(context)
.load(url)
.placeholder(ContextCompat.getDrawable(context, R.drawable.ic_image))
.dontAnimate()
.override(width, width / 2);
.dontAnimate();
final GlideDrawableTarget target = new GlideDrawableTarget(urlDrawable, container, width);
load.into(target);
cachedTargets.add(target);

View File

@ -37,9 +37,8 @@ class GlideDrawableTarget extends SimpleTarget<Drawable> {
width = (float) (resource.getIntrinsicWidth() / downScale / 1.3);
height = (float) (resource.getIntrinsicHeight() / downScale / 1.3);
} else {
float multiplier = (float) this.width / resource.getIntrinsicWidth();
width = (float) resource.getIntrinsicWidth() * multiplier;
height = (float) resource.getIntrinsicHeight() * multiplier;
width = (float) resource.getIntrinsicWidth();
height = (float) resource.getIntrinsicHeight();
}
Rect rect = new Rect(0, 0, Math.round(width), Math.round(height));
resource.setBounds(rect);

View File

@ -1,11 +1,14 @@
package com.fastaccess.provider.timeline.handler.drawable;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import androidx.annotation.NonNull;
import com.bumptech.glide.load.resource.gif.GifDrawable;
import com.crashlytics.android.Crashlytics;
class UrlDrawable extends BitmapDrawable implements Drawable.Callback {
private Drawable drawable;
@ -14,7 +17,12 @@ class UrlDrawable extends BitmapDrawable implements Drawable.Callback {
@Override public void draw(Canvas canvas) {
if (drawable != null) {
drawable.draw(canvas);
try {
drawable.draw(canvas);
} catch (Exception e) {
Crashlytics.logException(e);
e.printStackTrace();
}
if (drawable instanceof GifDrawable) {
if (!((GifDrawable) drawable).isRunning()) {
((GifDrawable) drawable).start();

View File

@ -69,6 +69,10 @@ public class IssueDetailsViewHolder extends BaseViewHolder<TimelineModel> {
@BindView(R.id.hurrayReaction) FontTextView hurrayReaction;
@BindView(R.id.sadReaction) FontTextView sadReaction;
@BindView(R.id.heartReaction) FontTextView heartReaction;
@BindView(R.id.rocketReaction) FontTextView rocketReaction;
@BindView(R.id.eyeReaction) FontTextView eyeReaction;
@BindView(R.id.rocket) FontTextView rocket;
@BindView(R.id.eyes) FontTextView eyes;
private OnToggleView onToggleView;
private ReactionsCallback reactionsCallback;
private ViewGroup viewGroup;
@ -113,6 +117,14 @@ public class IssueDetailsViewHolder extends BaseViewHolder<TimelineModel> {
thumbsUpReaction.setOnLongClickListener(this);
hurrayReaction.setOnLongClickListener(this);
heartReaction.setOnLongClickListener(this);
rocketReaction.setOnLongClickListener(this);
rocketReaction.setOnClickListener(this);
rocket.setOnLongClickListener(this);
rocket.setOnClickListener(this);
eyeReaction.setOnLongClickListener(this);
eyeReaction.setOnClickListener(this);
eyes.setOnLongClickListener(this);
eyes.setOnClickListener(this);
}
public static IssueDetailsViewHolder newInstance(@NonNull ViewGroup viewGroup, @Nullable BaseRecyclerAdapter adapter,
@ -187,6 +199,14 @@ public class IssueDetailsViewHolder extends BaseViewHolder<TimelineModel> {
case R.id.hurrayReaction:
reactionsModel.setHooray(!isReacted ? reactionsModel.getHooray() + 1 : reactionsModel.getHooray() - 1);
break;
case R.id.rocket:
case R.id.rocketReaction:
reactionsModel.setRocket(!isReacted ? reactionsModel.getRocket() + 1 : reactionsModel.getRocket() - 1);
break;
case R.id.eyes:
case R.id.eyeReaction:
reactionsModel.setEyes(!isReacted ? reactionsModel.getEyes() + 1 : reactionsModel.getEyes() - 1);
break;
}
if (pullRequest != null) {
pullRequest.setReactions(reactionsModel);
@ -254,7 +274,7 @@ public class IssueDetailsViewHolder extends BaseViewHolder<TimelineModel> {
private void appendEmojies(ReactionsModel reaction) {
CommentsHelper.appendEmojies(reaction, thumbsUp, thumbsUpReaction, thumbsDown, thumbsDownReaction, hooray, hurrayReaction, sad,
sadReaction, laugh, laughReaction, heart, heartReaction, reactionsList);
sadReaction, laugh, laughReaction, heart, heartReaction, rocket, rocketReaction, eyes, eyeReaction, reactionsList);
}
private void onToggle(boolean expanded, boolean animate) {

View File

@ -56,6 +56,10 @@ public class ReviewCommentsViewHolder extends BaseViewHolder<ReviewCommentModel>
@BindView(R.id.hurrayReaction) FontTextView hurrayReaction;
@BindView(R.id.sadReaction) FontTextView sadReaction;
@BindView(R.id.heartReaction) FontTextView heartReaction;
@BindView(R.id.rocketReaction) FontTextView rocketReaction;
@BindView(R.id.eyeReaction) FontTextView eyeReaction;
@BindView(R.id.rocket) FontTextView rocket;
@BindView(R.id.eyes) FontTextView eyes;
private OnToggleView onToggleView;
private ReactionsCallback reactionsCallback;
private ViewGroup viewGroup;
@ -122,6 +126,14 @@ public class ReviewCommentsViewHolder extends BaseViewHolder<ReviewCommentModel>
thumbsUpReaction.setOnLongClickListener(this);
hurrayReaction.setOnLongClickListener(this);
heartReaction.setOnLongClickListener(this);
rocketReaction.setOnLongClickListener(this);
rocketReaction.setOnClickListener(this);
rocket.setOnLongClickListener(this);
rocket.setOnClickListener(this);
eyeReaction.setOnLongClickListener(this);
eyeReaction.setOnClickListener(this);
eyes.setOnLongClickListener(this);
eyes.setOnClickListener(this);
}
public static ReviewCommentsViewHolder newInstance(ViewGroup viewGroup, BaseRecyclerAdapter adapter,
@ -201,6 +213,14 @@ public class ReviewCommentsViewHolder extends BaseViewHolder<ReviewCommentModel>
case R.id.hurrayReaction:
reactionsModel.setHooray(!isReacted ? reactionsModel.getHooray() + 1 : reactionsModel.getHooray() - 1);
break;
case R.id.rocket:
case R.id.rocketReaction:
reactionsModel.setRocket(!isReacted ? reactionsModel.getRocket() + 1 : reactionsModel.getRocket() - 1);
break;
case R.id.eyes:
case R.id.eyeReaction:
reactionsModel.setEyes(!isReacted ? reactionsModel.getEyes() + 1 : reactionsModel.getEyes() - 1);
break;
}
comment.setReactions(reactionsModel);
appendEmojies(reactionsModel);
@ -210,7 +230,7 @@ public class ReviewCommentsViewHolder extends BaseViewHolder<ReviewCommentModel>
private void appendEmojies(ReactionsModel reaction) {
CommentsHelper.appendEmojies(reaction, thumbsUp, thumbsUpReaction, thumbsDown, thumbsDownReaction, hurray, hurrayReaction, sad,
sadReaction, laugh, laughReaction, heart, heartReaction, reactionsList);
sadReaction, laugh, laughReaction, heart, heartReaction, rocket, rocketReaction, eyes, eyeReaction, reactionsList);
}
private long getId() {

View File

@ -64,6 +64,10 @@ public class TimelineCommentsViewHolder extends BaseViewHolder<TimelineModel> {
@BindView(R.id.hurrayReaction) FontTextView hurrayReaction;
@BindView(R.id.sadReaction) FontTextView sadReaction;
@BindView(R.id.heartReaction) FontTextView heartReaction;
@BindView(R.id.rocketReaction) FontTextView rocketReaction;
@BindView(R.id.eyeReaction) FontTextView eyeReaction;
@BindView(R.id.rocket) FontTextView rocket;
@BindView(R.id.eyes) FontTextView eyes;
private OnToggleView onToggleView;
private boolean showEmojies;
private ReactionsCallback reactionsCallback;
@ -133,6 +137,14 @@ public class TimelineCommentsViewHolder extends BaseViewHolder<TimelineModel> {
thumbsUpReaction.setOnLongClickListener(this);
hurrayReaction.setOnLongClickListener(this);
heartReaction.setOnLongClickListener(this);
rocketReaction.setOnLongClickListener(this);
rocketReaction.setOnClickListener(this);
rocket.setOnLongClickListener(this);
rocket.setOnClickListener(this);
eyeReaction.setOnLongClickListener(this);
eyeReaction.setOnClickListener(this);
eyes.setOnLongClickListener(this);
eyes.setOnClickListener(this);
}
public static TimelineCommentsViewHolder newInstance(@NonNull ViewGroup viewGroup, @Nullable IssuesTimelineAdapter adapter,
@ -237,6 +249,14 @@ public class TimelineCommentsViewHolder extends BaseViewHolder<TimelineModel> {
case R.id.hurrayReaction:
reactionsModel.setHooray(!isReacted ? reactionsModel.getHooray() + 1 : reactionsModel.getHooray() - 1);
break;
case R.id.rocket:
case R.id.rocketReaction:
reactionsModel.setRocket(!isReacted ? reactionsModel.getRocket() + 1 : reactionsModel.getRocket() - 1);
break;
case R.id.eyes:
case R.id.eyeReaction:
reactionsModel.setEyes(!isReacted ? reactionsModel.getEyes() + 1 : reactionsModel.getEyes() - 1);
break;
}
comment.setReactions(reactionsModel);
appendEmojies(reactionsModel);
@ -247,7 +267,7 @@ public class TimelineCommentsViewHolder extends BaseViewHolder<TimelineModel> {
private void appendEmojies(ReactionsModel reaction) {
CommentsHelper.appendEmojies(reaction, thumbsUp, thumbsUpReaction, thumbsDown, thumbsDownReaction, hurray, hurrayReaction, sad,
sadReaction, laugh, laughReaction, heart, heartReaction, reactionsList);
sadReaction, laugh, laughReaction, heart, heartReaction, rocket, rocketReaction, eyes, eyeReaction, reactionsList);
}
private void onToggle(boolean expanded, boolean animate) {

View File

@ -3,11 +3,18 @@ package com.fastaccess.ui.modules.main;
import android.content.Intent;
import android.graphics.Typeface;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.fastaccess.BuildConfig;
import com.fastaccess.helper.Logger;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import androidx.fragment.app.FragmentManager;
import androidx.core.view.GravityCompat;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.Toast;
@ -29,6 +36,8 @@ import com.fastaccess.ui.modules.notification.NotificationActivity;
import com.fastaccess.ui.modules.search.SearchActivity;
import com.fastaccess.ui.modules.settings.SlackBottomSheetDialog;
import com.fastaccess.ui.modules.user.UserPagerActivity;
import com.google.firebase.iid.FirebaseInstanceId;
import com.google.firebase.iid.InstanceIdResult;
import butterknife.BindView;
import butterknife.OnClick;
@ -72,6 +81,13 @@ public class MainActivity extends BaseActivity<MainMvp.View, MainPresenter> impl
new SlackBottomSheetDialog().show(getSupportFragmentManager(), SlackBottomSheetDialog.TAG);
}
}
if (BuildConfig.DEBUG) {
FirebaseInstanceId.getInstance().getInstanceId().addOnSuccessListener(o -> {
Logger.e(o.getId(), o.getToken());
});
}
getPresenter().setEnterprise(PrefGetter.isEnterprise());
selectHome(false);
hideShowShadow(navType == MainMvp.FEEDS);

View File

@ -15,8 +15,6 @@ import com.fastaccess.helper.InputHelper;
import com.fastaccess.provider.scheme.SchemeParser;
import com.fastaccess.ui.modules.login.chooser.LoginChooserActivity;
import org.apache.tools.ant.ExitException;
/**
* Created by Kosh on 09 Dec 2016, 12:31 PM
*/
@ -51,7 +49,7 @@ public class LinksParserActivity extends Activity {
Uri uri = Uri.parse(sharedText);
onUriReceived(uri);
}
} catch (ExitException ignored) {}
} catch (Exception ignored) {}
} else if (intent.getAction().equals(Intent.ACTION_VIEW)) {
if (intent.getData() != null) {
onUriReceived(intent.getData());

View File

@ -115,6 +115,7 @@ public class RepoFilesFragment extends BaseFragment<RepoFilesMvp.View, RepoFiles
boolean canOpen = canOpen(item);
popup.getMenu().findItem(R.id.editFile).setVisible(isOwner && item.getType() == FilesType.file && canOpen);
popup.getMenu().findItem(R.id.deleteFile).setVisible(isOwner && item.getType() == FilesType.file);
popup.getMenu().findItem(R.id.history).setVisible(true);
popup.setOnMenuItemClickListener(item1 -> {
switch (item1.getItemId()) {
case R.id.share:
@ -147,6 +148,9 @@ public class RepoFilesFragment extends BaseFragment<RepoFilesMvp.View, RepoFiles
PremiumActivity.Companion.startActivity(getContext());
}
break;
case R.id.history:
getPresenter().onItemLongClick(position, v, item);
break;
}
return true;
});
@ -178,7 +182,7 @@ public class RepoFilesFragment extends BaseFragment<RepoFilesMvp.View, RepoFiles
adapter = new RepoFilesAdapter(getPresenter().getFiles());
adapter.setListener(getPresenter());
recycler.setAdapter(adapter);
fastScroller.attachRecyclerView(recycler);
fastScroller.setVisibility(View.GONE);
}
@Override public void showProgress(@StringRes int resId) {

View File

@ -43,26 +43,21 @@ class WikiPresenter : BasePresenter<WikiMvp.View>(), WikiMvp.Presenter {
}
override fun onSidebarClicked(sidebar: WikiSideBarModel) {
if (BuildConfig.DEBUG) {
firebaseWikiConfigModel = FirebaseWikiConfigModel()
callApi(sidebar)
if (firebaseWikiConfigModel == null) {
manageDisposable(
RxHelper.getSingle(RxFirebaseDatabase.data(FirebaseDatabase.getInstance().reference.child("github_wiki")))
.doOnSubscribe { sendToView { it.showProgress(0) } }
.map {
firebaseWikiConfigModel = FirebaseWikiConfigModel.map(it.value as? HashMap<String, String>)
return@map firebaseWikiConfigModel
}
.subscribe(
{ callApi(sidebar) },
{ callApi(sidebar) }
)
)
} else {
if (firebaseWikiConfigModel == null) {
manageDisposable(
RxHelper.getSingle(RxFirebaseDatabase.data(FirebaseDatabase.getInstance().reference.child("github_wiki")))
.doOnSubscribe { sendToView { it.showProgress(0) } }
.map {
firebaseWikiConfigModel = FirebaseWikiConfigModel.map(it.value as? HashMap<String, String>)
return@map firebaseWikiConfigModel
}
.subscribe(
{ callApi(sidebar) },
{ callApi(sidebar) }
)
)
} else {
callApi(sidebar)
}
callApi(sidebar)
}
}

View File

@ -42,25 +42,21 @@ class TrendingFragmentPresenter : BasePresenter<TrendingFragmentMvp.View>(), Tre
disposel?.let { if (!it.isDisposed) it.dispose() }
val config = firebaseTrendingConfigModel
if (com.fastaccess.BuildConfig.DEBUG) {
callApi(lang, since)
} else {
if (config == null) {
manageDisposable(RxHelper.getSingle(RxFirebaseDatabase.data(FirebaseDatabase.getInstance().reference.child("github_trending")))
.doOnSubscribe { sendToView { it.showProgress(0) } }
.map {
firebaseTrendingConfigModel = FirebaseTrendingConfigModel
.map(it.value as? HashMap<String, String>)
return@map firebaseTrendingConfigModel
}
.subscribe(
{ callApi(lang, since) },
{ callApi(lang, since) }
)
if (config == null) {
manageDisposable(RxHelper.getSingle(RxFirebaseDatabase.data(FirebaseDatabase.getInstance().reference.child("github_trending")))
.doOnSubscribe { sendToView { it.showProgress(0) } }
.map {
firebaseTrendingConfigModel = FirebaseTrendingConfigModel
.map(it.value as? HashMap<String, String>)
return@map firebaseTrendingConfigModel
}
.subscribe(
{ callApi(lang, since) },
{ callApi(lang, since) }
)
} else {
callApi(lang, since)
}
)
} else {
callApi(lang, since)
}
}

View File

@ -1,18 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
android:id="@+id/commentOptions"
xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/commentOptions"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/spacing_normal"
android:layout_marginTop="@dimen/spacing_normal"
android:layout_marginBottom="@dimen/spacing_normal"
android:background="?card_background"
android:elevation="2dp"
android:orientation="horizontal"
android:outlineProvider="background"
android:paddingBottom="@dimen/spacing_xs_large"
android:paddingTop="@dimen/spacing_xs_large"
android:paddingBottom="@dimen/spacing_xs_large"
tools:ignore="RtlSymmetry"
tools:showIn="@layout/comments_row_item">
@ -21,8 +20,8 @@
android:id="@+id/emojiesList"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:scrollbarStyle="insideOverlay">
<LinearLayout
@ -38,7 +37,7 @@
android:layout_marginEnd="@dimen/spacing_micro"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100"/>
tools:text="100" />
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/thumbsDown"
@ -49,7 +48,7 @@
android:layout_marginEnd="@dimen/spacing_micro"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100"/>
tools:text="100" />
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/laugh"
@ -60,7 +59,7 @@
android:layout_marginEnd="@dimen/spacing_micro"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100"/>
tools:text="100" />
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/hurray"
@ -71,7 +70,7 @@
android:layout_marginEnd="@dimen/spacing_micro"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100"/>
tools:text="100" />
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/sad"
@ -82,7 +81,7 @@
android:layout_marginEnd="@dimen/spacing_micro"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100"/>
tools:text="100" />
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/heart"
@ -90,9 +89,32 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginEnd="@dimen/spacing_micro"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100"/>
tools:text="100" />
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/rocket"
style="@style/TextAppearance.AppCompat.Medium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginEnd="@dimen/spacing_micro"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100" />
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/eyes"
style="@style/TextAppearance.AppCompat.Medium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginEnd="@dimen/spacing_micro"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100" />
</LinearLayout>
</HorizontalScrollView>

View File

@ -203,6 +203,29 @@
style="@style/TextAppearance.AppCompat.Medium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/spacing_micro"
android:layout_gravity="center"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100"/>
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/rocketReaction"
style="@style/TextAppearance.AppCompat.Medium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/spacing_micro"
android:layout_gravity="center"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100"/>
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/eyeReaction"
style="@style/TextAppearance.AppCompat.Medium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/spacing_micro"
android:layout_gravity="center"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -9,13 +8,13 @@
<com.fastaccess.ui.widgets.ForegroundRelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/spacing_normal"
android:layout_marginEnd="@dimen/grid_spacing"
android:layout_marginStart="@dimen/grid_spacing"
android:layout_marginTop="@dimen/grid_spacing"
android:layout_marginEnd="@dimen/grid_spacing"
android:layout_marginBottom="@dimen/spacing_normal"
android:background="?card_background"
android:paddingBottom="@dimen/spacing_normal"
android:paddingTop="@dimen/spacing_normal"
android:paddingBottom="@dimen/spacing_normal"
tools:ignore="RtlSymmetry">
<LinearLayout
@ -35,8 +34,8 @@
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_gravity="center"
android:layout_marginEnd="@dimen/avatar_margin_end"
android:layout_marginStart="@dimen/avatar_margin"/>
android:layout_marginStart="@dimen/avatar_margin"
android:layout_marginEnd="@dimen/avatar_margin_end" />
<LinearLayout
android:layout_width="0dp"
@ -61,7 +60,7 @@
android:ellipsize="end"
android:maxLines="1"
android:textColor="?android:textColorPrimary"
tools:text="When one acquires"/>
tools:text="When one acquires" />
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/date"
@ -71,7 +70,7 @@
android:layout_gravity="center"
android:maxLines="1"
android:textColor="?android:attr/textColorSecondary"
tools:text="50 minutes"/>
tools:text="50 minutes" />
</LinearLayout>
@ -85,7 +84,7 @@
android:textColor="?android:attr/textColorSecondary"
android:visibility="gone"
tools:text="@string/owner"
tools:visibility="visible"/>
tools:visibility="visible" />
</LinearLayout>
<com.fastaccess.ui.widgets.ForegroundImageView
@ -96,7 +95,7 @@
android:background="?selectableItemBackgroundBorderless"
android:contentDescription="@string/options"
android:padding="@dimen/spacing_micro"
android:src="@drawable/ic_add_emoji"/>
android:src="@drawable/ic_add_emoji" />
<com.fastaccess.ui.widgets.ForegroundImageView
android:id="@+id/commentMenu"
@ -106,33 +105,33 @@
android:background="?selectableItemBackgroundBorderless"
android:contentDescription="@string/options"
android:padding="@dimen/spacing_micro"
android:src="@drawable/ic_overflow"/>
android:src="@drawable/ic_overflow" />
</LinearLayout>
<include layout="@layout/comments_dropdown_layout"/>
<include layout="@layout/comments_dropdown_layout" />
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/comment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/spacing_micro"
android:layout_marginEnd="@dimen/spacing_xs_large"
android:layout_marginStart="@dimen/spacing_xs_large"
android:layout_marginTop="@dimen/spacing_micro"
android:textIsSelectable="true"/>
android:layout_marginEnd="@dimen/spacing_xs_large"
android:layout_marginBottom="@dimen/spacing_micro"
android:textIsSelectable="true" />
<HorizontalScrollView
android:id="@+id/reactionsList"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:layout_marginEnd="@dimen/spacing_xs_large"
android:layout_marginStart="@dimen/spacing_xs_large"
android:paddingBottom="@dimen/spacing_normal"
android:layout_marginEnd="@dimen/spacing_xs_large"
android:paddingTop="@dimen/spacing_normal"
android:paddingBottom="@dimen/spacing_normal"
android:scrollbarStyle="insideOverlay"
tools:visibility="visible"
android:visibility="gone">
android:visibility="gone"
tools:visibility="visible">
<LinearLayout
android:layout_width="wrap_content"
@ -147,7 +146,7 @@
android:layout_marginEnd="@dimen/spacing_micro"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100"/>
tools:text="100" />
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/thumbsDownReaction"
@ -158,7 +157,7 @@
android:layout_marginEnd="@dimen/spacing_micro"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100"/>
tools:text="100" />
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/laughReaction"
@ -169,7 +168,7 @@
android:layout_marginEnd="@dimen/spacing_micro"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100"/>
tools:text="100" />
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/hurrayReaction"
@ -180,7 +179,7 @@
android:layout_marginEnd="@dimen/spacing_micro"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100"/>
tools:text="100" />
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/sadReaction"
@ -191,7 +190,7 @@
android:layout_marginEnd="@dimen/spacing_micro"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100"/>
tools:text="100" />
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/heartReaction"
@ -199,9 +198,32 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginEnd="@dimen/spacing_micro"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100"/>
tools:text="100" />
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/rocketReaction"
style="@style/TextAppearance.AppCompat.Medium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginEnd="@dimen/spacing_micro"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100" />
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/eyeReaction"
style="@style/TextAppearance.AppCompat.Medium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginEnd="@dimen/spacing_micro"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100" />
</LinearLayout>
</HorizontalScrollView>
@ -214,13 +236,13 @@
android:id="@+id/labelsHolder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/spacing_normal"
android:layout_marginEnd="@dimen/grid_spacing"
android:layout_marginStart="@dimen/grid_spacing"
android:layout_marginTop="@dimen/spacing_normal"
android:layout_marginEnd="@dimen/grid_spacing"
android:layout_marginBottom="@dimen/spacing_normal"
android:background="?card_background"
android:paddingBottom="@dimen/spacing_normal"
android:paddingTop="@dimen/spacing_normal"
android:paddingBottom="@dimen/spacing_normal"
android:visibility="gone"
tools:visibility="visible">
@ -229,7 +251,7 @@
style="@style/TextAppearance.AppCompat.Caption"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"/>
android:gravity="center" />
</LinearLayout>
</LinearLayout>

View File

@ -1,12 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<com.fastaccess.ui.widgets.ForegroundRelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<com.fastaccess.ui.widgets.ForegroundRelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/grid_spacing"
android:paddingBottom="@dimen/spacing_normal"
android:paddingTop="@dimen/spacing_normal"
android:paddingBottom="@dimen/spacing_normal"
tools:ignore="RtlSymmetry">
<LinearLayout
@ -26,8 +25,8 @@
android:layout_width="34dp"
android:layout_height="34dp"
android:layout_gravity="center"
android:layout_marginEnd="@dimen/avatar_margin_end"
android:layout_marginStart="@dimen/avatar_margin"/>
android:layout_marginStart="@dimen/avatar_margin"
android:layout_marginEnd="@dimen/avatar_margin_end" />
<LinearLayout
android:layout_width="0dp"
@ -52,7 +51,7 @@
android:ellipsize="end"
android:maxLines="1"
android:textColor="?android:textColorPrimary"
tools:text="When one acquires"/>
tools:text="When one acquires" />
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/date"
@ -62,7 +61,7 @@
android:layout_gravity="center"
android:maxLines="1"
android:textColor="?android:attr/textColorSecondary"
tools:text="50 minutes"/>
tools:text="50 minutes" />
</LinearLayout>
@ -76,7 +75,7 @@
android:textColor="?android:attr/textColorSecondary"
android:visibility="gone"
tools:text="@string/owner"
tools:visibility="visible"/>
tools:visibility="visible" />
</LinearLayout>
<com.fastaccess.ui.widgets.ForegroundImageView
@ -87,7 +86,7 @@
android:background="?selectableItemBackgroundBorderless"
android:contentDescription="@string/reactions"
android:padding="@dimen/spacing_micro"
android:src="@drawable/ic_add_emoji"/>
android:src="@drawable/ic_add_emoji" />
<com.fastaccess.ui.widgets.ForegroundImageView
android:id="@+id/commentMenu"
@ -97,33 +96,34 @@
android:background="?selectableItemBackgroundBorderless"
android:contentDescription="@string/options"
android:padding="@dimen/spacing_micro"
android:src="@drawable/ic_overflow"/>
android:src="@drawable/ic_overflow" />
</LinearLayout>
<include layout="@layout/comments_dropdown_layout"/>
<include layout="@layout/comments_dropdown_layout" />
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/comment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/spacing_micro"
android:layout_marginEnd="@dimen/spacing_xs_large"
android:layout_marginStart="@dimen/spacing_xs_large"
android:layout_marginTop="@dimen/spacing_micro"
android:layout_marginEnd="@dimen/spacing_xs_large"
android:layout_marginBottom="@dimen/spacing_micro"
android:textIsSelectable="true"
tools:text="Hello World"/>
tools:text="Hello World" />
<HorizontalScrollView
android:id="@+id/reactionsList"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:layout_marginEnd="@dimen/spacing_xs_large"
android:layout_marginStart="@dimen/avatar_margin"
android:paddingBottom="@dimen/spacing_normal"
android:layout_marginEnd="@dimen/spacing_xs_large"
android:paddingTop="@dimen/spacing_normal"
android:paddingBottom="@dimen/spacing_normal"
android:scrollbarStyle="insideOverlay"
android:visibility="gone">
android:visibility="gone"
tools:visibility="visible">
<LinearLayout
android:layout_width="wrap_content"
@ -138,7 +138,7 @@
android:layout_marginEnd="@dimen/spacing_micro"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100"/>
tools:text="100" />
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/thumbsDownReaction"
@ -149,7 +149,7 @@
android:layout_marginEnd="@dimen/spacing_micro"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100"/>
tools:text="100" />
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/laughReaction"
@ -160,7 +160,7 @@
android:layout_marginEnd="@dimen/spacing_micro"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100"/>
tools:text="100" />
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/hurrayReaction"
@ -171,7 +171,7 @@
android:layout_marginEnd="@dimen/spacing_micro"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100"/>
tools:text="100" />
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/sadReaction"
@ -182,7 +182,7 @@
android:layout_marginEnd="@dimen/spacing_micro"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100"/>
tools:text="100" />
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/heartReaction"
@ -190,9 +190,32 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginEnd="@dimen/spacing_micro"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100"/>
tools:text="100" />
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/rocketReaction"
style="@style/TextAppearance.AppCompat.Medium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginEnd="@dimen/spacing_micro"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100" />
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/eyeReaction"
style="@style/TextAppearance.AppCompat.Medium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginEnd="@dimen/spacing_micro"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100" />
</LinearLayout>
</HorizontalScrollView>

View File

@ -1,38 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/editFile"
android:icon="@drawable/ic_edit"
android:title="@string/edit"
android:visible="false"
app:showAsAction="ifRoom"/>
app:showAsAction="ifRoom" />
<item
android:id="@+id/deleteFile"
android:icon="@drawable/ic_trash"
android:title="@string/delete"
android:visible="false"
app:showAsAction="ifRoom"/>
app:showAsAction="ifRoom" />
<item
android:id="@+id/download"
android:icon="@drawable/ic_download"
android:title="@string/download"
app:showAsAction="ifRoom"/>
app:showAsAction="ifRoom" />
<item
android:id="@+id/share"
android:icon="@drawable/ic_share"
android:title="@string/share"
app:showAsAction="ifRoom"/>
app:showAsAction="ifRoom" />
<item
android:id="@+id/copy"
android:icon="@drawable/ic_copy"
android:title="@string/copy"
app:showAsAction="ifRoom"/>
app:showAsAction="ifRoom" />
<item
android:id="@+id/history"
android:icon="@drawable/ic_time"
android:title="@string/file_history"
android:visible="false" />
</menu>

View File

@ -604,4 +604,5 @@
<string name="commit_file_required">No file changes</string>
<string name="send_feedback">Send feedback</string>
<string name="private_wiki_error_msg">Unfortunately we cannot access private repos wiki</string>
<string name="file_history">File History</string>
</resources>

View File

@ -3,11 +3,10 @@ buildscript {
ext {
butterKnifeVersion = '10.2.1'
state_version = '1.4.1'
lombokVersion = '1.16.20'
lombokVersion = '1.18.10'
supportVersion = "27.1.0"
gms = "12.0.0"
thirtyinchVersion = '0.9.6'
retrofit = '2.3.0'
retrofit = '2.7.0'
junitVersion = '4.12'
mockitoVersion = '1.10.19'
assertjVersion = '2.5.0'