mirror of
https://github.com/k0shk0sh/FastHub.git
synced 2025-12-08 19:05:54 +00:00
parent
268f7fc35e
commit
ddc41e36a7
@ -31,9 +31,11 @@ Yet another **open-source** GitHub client app but unlike any other app, FastHub
|
||||
- FastHub & GitHub Pinned Repos
|
||||
- Trending
|
||||
- Wiki
|
||||
- Projects
|
||||
- **Repositories**
|
||||
- Browse & Read Wiki
|
||||
- Edit, Create & Delete files (commit)
|
||||
- Edit, Create & Delete files (Project Columns Cards)
|
||||
- Search Repos
|
||||
- Browse and search Repos
|
||||
- See your public, private and forked Repos
|
||||
|
||||
@ -213,12 +213,6 @@
|
||||
android:configChanges="keyboard|orientation|screenSize"
|
||||
android:theme="@style/ThemeTranslucent"/>
|
||||
|
||||
<activity
|
||||
android:name=".ui.modules.reviews.changes.ReviewChangesActivity"
|
||||
android:configChanges="keyboard|orientation|screenSize"
|
||||
android:label="@string/review_changes"
|
||||
android:theme="@style/ThemeTranslucent"/>
|
||||
|
||||
<activity
|
||||
android:name=".ui.modules.repos.wiki.WikiActivity"
|
||||
android:label="@string/gollum"
|
||||
@ -258,6 +252,21 @@
|
||||
android:value=".ui.modules.repos.RepoPagerActivity"/>
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name=".ui.modules.profile.org.project.OrgProjectActivity"
|
||||
android:label="@string/projects"
|
||||
android:parentActivityName=".ui.modules.user.UserPagerActivity">
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value=".ui.modules.user.UserPagerActivity"/>
|
||||
</activity>
|
||||
|
||||
<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"/>
|
||||
|
||||
|
||||
<activity
|
||||
android:name=".ui.modules.parser.LinksParserActivity"
|
||||
@ -297,7 +306,6 @@
|
||||
<category android:name="android.intent.category.DEFAULT"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity android:name=".ui.modules.main.playstore.PlayStoreWarningActivity"/>
|
||||
|
||||
<service
|
||||
android:name=".provider.tasks.notification.NotificationSchedulerJobTask"
|
||||
|
||||
@ -53,6 +53,61 @@ 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}) {
|
||||
totalCount
|
||||
edges {
|
||||
cursor
|
||||
}
|
||||
pageInfo {
|
||||
hasNextPage
|
||||
startCursor
|
||||
endCursor
|
||||
}
|
||||
nodes {
|
||||
name
|
||||
number
|
||||
body
|
||||
createdAt
|
||||
id
|
||||
viewerCanUpdate
|
||||
columns(first: 1) {
|
||||
totalCount
|
||||
}
|
||||
databaseId
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
query orgProjectsClosed($owner: String!, $page: String) {
|
||||
organization(login: $owner) {
|
||||
projects(first: 30, states: CLOSED, after: $page, orderBy: {field: CREATED_AT, direction: DESC}) {
|
||||
totalCount
|
||||
edges {
|
||||
cursor
|
||||
}
|
||||
pageInfo {
|
||||
hasNextPage
|
||||
startCursor
|
||||
endCursor
|
||||
}
|
||||
nodes {
|
||||
name
|
||||
number
|
||||
body
|
||||
createdAt
|
||||
id
|
||||
viewerCanUpdate
|
||||
columns(first: 1) {
|
||||
totalCount
|
||||
}
|
||||
databaseId
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
query getColumns($owner: String!, $name:String!,$number:Int!) {
|
||||
repository(owner: $owner, name: $name) {
|
||||
project(number: $number) {
|
||||
|
||||
@ -25,9 +25,9 @@ import lombok.Setter;
|
||||
|
||||
private CommitFileChanges() {}
|
||||
|
||||
public static Observable<CommitFileChanges> constructToObservable(@Nullable List<CommitFileModel> files) {
|
||||
public static Observable<CommitFileChanges> constructToObservable(@Nullable ArrayList<CommitFileModel> files) {
|
||||
if (files == null || files.isEmpty()) return Observable.empty();
|
||||
return Observable.fromIterable(files).map(CommitFileChanges::getCommitFileChanges);
|
||||
return Observable.fromIterable(construct(files));
|
||||
}
|
||||
|
||||
@NonNull public static List<CommitFileChanges> construct(@Nullable List<CommitFileModel> files) {
|
||||
@ -66,4 +66,11 @@ import lombok.Setter;
|
||||
|
||||
@Override public CommitFileChanges[] newArray(int size) {return new CommitFileChanges[size];}
|
||||
};
|
||||
|
||||
public static boolean canAttachToBundle(CommitFileChanges model) {
|
||||
Parcel parcel = Parcel.obtain();
|
||||
model.writeToParcel(parcel, 0);
|
||||
int size = parcel.dataSize();
|
||||
return size < 600000;
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,14 +3,9 @@ package com.fastaccess.data.dao;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* Created by Kosh on 01 Jan 2017, 9:00 PM
|
||||
*/
|
||||
@Getter @Setter @NoArgsConstructor
|
||||
public class CommitFileModel implements Parcelable {
|
||||
|
||||
private String sha;
|
||||
@ -72,4 +67,84 @@ public class CommitFileModel implements Parcelable {
|
||||
", patch='" + patch + '\'' +
|
||||
'}';
|
||||
}
|
||||
|
||||
public String getSha() {
|
||||
return sha;
|
||||
}
|
||||
|
||||
public void setSha(String sha) {
|
||||
this.sha = sha;
|
||||
}
|
||||
|
||||
public String getFilename() {
|
||||
return filename;
|
||||
}
|
||||
|
||||
public void setFilename(String filename) {
|
||||
this.filename = filename;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public int getAdditions() {
|
||||
return additions;
|
||||
}
|
||||
|
||||
public void setAdditions(int additions) {
|
||||
this.additions = additions;
|
||||
}
|
||||
|
||||
public int getDeletions() {
|
||||
return deletions;
|
||||
}
|
||||
|
||||
public void setDeletions(int deletions) {
|
||||
this.deletions = deletions;
|
||||
}
|
||||
|
||||
public int getChanges() {
|
||||
return changes;
|
||||
}
|
||||
|
||||
public void setChanges(int changes) {
|
||||
this.changes = changes;
|
||||
}
|
||||
|
||||
public String getBlobUrl() {
|
||||
return blobUrl;
|
||||
}
|
||||
|
||||
public void setBlobUrl(String blobUrl) {
|
||||
this.blobUrl = blobUrl;
|
||||
}
|
||||
|
||||
public String getRawUrl() {
|
||||
return rawUrl;
|
||||
}
|
||||
|
||||
public void setRawUrl(String rawUrl) {
|
||||
this.rawUrl = rawUrl;
|
||||
}
|
||||
|
||||
public String getContentsUrl() {
|
||||
return contentsUrl;
|
||||
}
|
||||
|
||||
public void setContentsUrl(String contentsUrl) {
|
||||
this.contentsUrl = contentsUrl;
|
||||
}
|
||||
|
||||
public String getPatch() {
|
||||
return patch;
|
||||
}
|
||||
|
||||
public void setPatch(String patch) {
|
||||
this.patch = patch;
|
||||
}
|
||||
}
|
||||
|
||||
@ -12,8 +12,6 @@ import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import static com.fastaccess.ui.widgets.DiffLineSpan.HUNK_TITLE;
|
||||
|
||||
@ -21,7 +19,7 @@ import static com.fastaccess.ui.widgets.DiffLineSpan.HUNK_TITLE;
|
||||
* Created by Kosh on 20 Jun 2017, 7:32 PM
|
||||
*/
|
||||
|
||||
@Getter @Setter @AllArgsConstructor public class CommitLinesModel implements Parcelable {
|
||||
@AllArgsConstructor public class CommitLinesModel implements Parcelable {
|
||||
|
||||
public static final int TRANSPARENT = 0;
|
||||
public static final int ADDITION = 1;
|
||||
@ -115,4 +113,60 @@ import static com.fastaccess.ui.widgets.DiffLineSpan.HUNK_TITLE;
|
||||
|
||||
@Override public CommitLinesModel[] newArray(int size) {return new CommitLinesModel[size];}
|
||||
};
|
||||
|
||||
public String getText() {
|
||||
return text;
|
||||
}
|
||||
|
||||
public void setText(String text) {
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
public int getColor() {
|
||||
return color;
|
||||
}
|
||||
|
||||
public void setColor(int color) {
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
public int getLeftLineNo() {
|
||||
return leftLineNo;
|
||||
}
|
||||
|
||||
public void setLeftLineNo(int leftLineNo) {
|
||||
this.leftLineNo = leftLineNo;
|
||||
}
|
||||
|
||||
public int getRightLineNo() {
|
||||
return rightLineNo;
|
||||
}
|
||||
|
||||
public void setRightLineNo(int rightLineNo) {
|
||||
this.rightLineNo = rightLineNo;
|
||||
}
|
||||
|
||||
public boolean isNoNewLine() {
|
||||
return noNewLine;
|
||||
}
|
||||
|
||||
public void setNoNewLine(boolean noNewLine) {
|
||||
this.noNewLine = noNewLine;
|
||||
}
|
||||
|
||||
public int getPosition() {
|
||||
return position;
|
||||
}
|
||||
|
||||
public void setPosition(int position) {
|
||||
this.position = position;
|
||||
}
|
||||
|
||||
public boolean isHasCommentedOn() {
|
||||
return hasCommentedOn;
|
||||
}
|
||||
|
||||
public void setHasCommentedOn(boolean hasCommentedOn) {
|
||||
this.hasCommentedOn = hasCommentedOn;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@ package com.fastaccess.data.dao;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v4.app.Fragment;
|
||||
|
||||
import com.annimon.stream.Collectors;
|
||||
@ -239,7 +240,7 @@ import lombok.Setter;
|
||||
.toList();
|
||||
}
|
||||
|
||||
@NonNull public static List<FragmentPagerAdapterModel> buildForRepoProjects(@NonNull Context context, @NonNull String repoId,
|
||||
@NonNull public static List<FragmentPagerAdapterModel> buildForRepoProjects(@NonNull Context context, @Nullable String repoId,
|
||||
@NonNull String login) {
|
||||
return Stream.of(new FragmentPagerAdapterModel(context.getString(R.string.open),
|
||||
RepoProjectFragment.Companion.newInstance(login, repoId, IssueState.open)),
|
||||
|
||||
@ -19,6 +19,7 @@ import io.requery.Entity;
|
||||
import io.requery.Key;
|
||||
import io.requery.Persistable;
|
||||
import io.requery.Table;
|
||||
import io.requery.Transient;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import static com.fastaccess.data.dao.model.User.FOLLOWER_NAME;
|
||||
@ -68,6 +69,7 @@ public abstract class AbstractUser implements Parcelable {
|
||||
@Column(name = "date_column") Date date;
|
||||
String repoId;
|
||||
String description;
|
||||
@Transient boolean hasOrganizationProjects;
|
||||
|
||||
public void save(User entity) {
|
||||
if (getUser(entity.getId()) != null) {
|
||||
|
||||
@ -200,5 +200,4 @@ public class Bundler {
|
||||
return get();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -62,7 +62,7 @@ public class FileHelper {
|
||||
title = cur.getString(cur.getColumnIndex(MediaStore.Audio.Media.TITLE));
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception ignored) {}
|
||||
}
|
||||
}
|
||||
return title;
|
||||
|
||||
@ -10,6 +10,7 @@ import android.widget.TextView;
|
||||
|
||||
import com.annimon.stream.IntStream;
|
||||
import com.fastaccess.helper.InputHelper;
|
||||
import com.fastaccess.helper.Logger;
|
||||
import com.fastaccess.provider.markdown.extension.emoji.EmojiExtension;
|
||||
import com.fastaccess.provider.markdown.extension.mention.MentionExtension;
|
||||
import com.fastaccess.provider.timeline.HtmlHelper;
|
||||
@ -256,19 +257,11 @@ public class MarkDownProvider {
|
||||
|
||||
}
|
||||
|
||||
public static void addPhoto(@NonNull EditText editText) {
|
||||
addLink(editText, "", "");
|
||||
}
|
||||
|
||||
public static void addPhoto(@NonNull EditText editText, @NonNull String title, @NonNull String link) {
|
||||
String result = " + ")";
|
||||
insertAtCursor(editText, result);
|
||||
}
|
||||
|
||||
public static void addLink(@NonNull EditText editText) {
|
||||
addLink(editText, "", "");
|
||||
}
|
||||
|
||||
public static void addLink(@NonNull EditText editText, @NonNull String title, @NonNull String link) {
|
||||
String result = "[" + InputHelper.toString(title) + "](" + InputHelper.toString(link) + ")";
|
||||
insertAtCursor(editText, result);
|
||||
@ -319,10 +312,17 @@ public class MarkDownProvider {
|
||||
|
||||
public static void insertAtCursor(@NonNull EditText editText, @NonNull String text) {
|
||||
String oriContent = editText.getText().toString();
|
||||
int index = editText.getSelectionStart() >= 0 ? editText.getSelectionStart() : 0;
|
||||
StringBuilder builder = new StringBuilder(oriContent);
|
||||
builder.insert(index, text);
|
||||
editText.setText(builder.toString());
|
||||
editText.setSelection(index + text.length());
|
||||
int start = editText.getSelectionStart();
|
||||
int end = editText.getSelectionEnd();
|
||||
int index = start >= 0 ? start : 0;
|
||||
Logger.e(start, end);
|
||||
if (start >= 0 && end > 0) {
|
||||
editText.setText(editText.getText().replace(start, end, text));
|
||||
} else {
|
||||
StringBuilder builder = new StringBuilder(oriContent);
|
||||
builder.insert(index, text);
|
||||
editText.setText(builder.toString());
|
||||
editText.setSelection(index + text.length());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -108,8 +108,13 @@ public class PullRequestFilesViewHolder extends BaseViewHolder<CommitFileChanges
|
||||
if (model.getLinesModel().size() <= 100) {
|
||||
patch.setAdapter(new CommitLinesAdapter(model.getLinesModel(), this));
|
||||
patch.setVisibility(View.VISIBLE);
|
||||
} else if (CommitFileChanges.canAttachToBundle(model)) {
|
||||
if (adapter.getListener() != null) {
|
||||
//noinspection unchecked
|
||||
adapter.getListener().onItemClick(position, patch, model);
|
||||
}
|
||||
} else {
|
||||
Toasty.warning(itemView.getContext(),itemView.getResources().getString(R.string.too_large_changes)).show();
|
||||
Toasty.warning(itemView.getContext(), itemView.getResources().getString(R.string.too_large_changes)).show();
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -22,6 +22,7 @@ import com.fastaccess.helper.AppHelper;
|
||||
import com.fastaccess.helper.PrefGetter;
|
||||
import com.fastaccess.ui.base.mvp.BaseMvp;
|
||||
import com.fastaccess.ui.base.mvp.presenter.BasePresenter;
|
||||
import com.fastaccess.ui.widgets.dialog.ProgressDialogFragment;
|
||||
|
||||
import net.grandcentrix.thirtyinch.TiDialogFragment;
|
||||
|
||||
@ -103,7 +104,7 @@ public abstract class BaseDialogFragment<V extends BaseMvp.FAView, P extends Bas
|
||||
|
||||
@NonNull @Override public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
final Dialog dialog = super.onCreateDialog(savedInstanceState);
|
||||
if (!PrefGetter.isAppAnimationDisabled()) {
|
||||
if (!PrefGetter.isAppAnimationDisabled() && !(this instanceof ProgressDialogFragment)) {
|
||||
dialog.setOnShowListener(dialogInterface -> AnimHelper.revealDialog(dialog,
|
||||
getResources().getInteger(android.R.integer.config_longAnimTime)));
|
||||
}
|
||||
|
||||
@ -38,11 +38,12 @@ public class EditorLinkImageDialogFragment extends BaseDialogFragment<EditorLink
|
||||
@BindView(R.id.link) TextInputLayout link;
|
||||
@BindView(R.id.select) FontButton select;
|
||||
|
||||
public static EditorLinkImageDialogFragment newInstance(boolean isLink) {
|
||||
public static EditorLinkImageDialogFragment newInstance(boolean isLink, @Nullable String link) {
|
||||
EditorLinkImageDialogFragment fragment = new EditorLinkImageDialogFragment();
|
||||
fragment.setArguments(Bundler
|
||||
.start()
|
||||
.put(BundleConstant.YES_NO_EXTRA, isLink)
|
||||
.put(BundleConstant.ITEM, link)
|
||||
.end());
|
||||
return fragment;
|
||||
}
|
||||
@ -75,6 +76,9 @@ public class EditorLinkImageDialogFragment extends BaseDialogFragment<EditorLink
|
||||
|
||||
@Override protected void onFragmentCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
select.setVisibility(isLink() ? View.GONE : View.VISIBLE);
|
||||
if (savedInstanceState == null) {
|
||||
link.getEditText().setText(getArguments().getString(BundleConstant.ITEM));
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull @Override public EditorLinkImagePresenter providePresenter() {
|
||||
|
||||
@ -21,6 +21,7 @@ import com.fastaccess.helper.InputHelper;
|
||||
import com.fastaccess.helper.ParseDateFormat;
|
||||
import com.fastaccess.provider.emoji.EmojiParser;
|
||||
import com.fastaccess.ui.base.BaseFragment;
|
||||
import com.fastaccess.ui.modules.profile.org.project.OrgProjectActivity;
|
||||
import com.fastaccess.ui.widgets.AvatarLayout;
|
||||
import com.fastaccess.ui.widgets.FontTextView;
|
||||
|
||||
@ -44,6 +45,7 @@ public class OrgProfileOverviewFragment extends BaseFragment<OrgProfileOverviewM
|
||||
@BindView(R.id.link) FontTextView link;
|
||||
@BindView(R.id.joined) FontTextView joined;
|
||||
@BindView(R.id.progress) LinearLayout progress;
|
||||
@BindView(R.id.projects) View projects;
|
||||
|
||||
@State User userModel;
|
||||
|
||||
@ -57,7 +59,15 @@ public class OrgProfileOverviewFragment extends BaseFragment<OrgProfileOverviewM
|
||||
if (userModel != null) ActivityHelper.startCustomTab(getActivity(), userModel.getAvatarUrl());
|
||||
}
|
||||
|
||||
@OnClick(R.id.projects) void onOpenProjects() {
|
||||
OrgProjectActivity.Companion.startActivity(getContext(), getPresenter().getLogin(), isEnterprise());
|
||||
}
|
||||
|
||||
@SuppressLint("ClickableViewAccessibility") @Override public void onInitViews(@Nullable User userModel) {
|
||||
if (getView() != null) {
|
||||
TransitionManager.beginDelayedTransition((ViewGroup) getView());
|
||||
}
|
||||
if (this.userModel != null) return;
|
||||
progress.setVisibility(View.GONE);
|
||||
if (userModel == null) return;
|
||||
this.userModel = userModel;
|
||||
@ -80,21 +90,23 @@ public class OrgProfileOverviewFragment extends BaseFragment<OrgProfileOverviewM
|
||||
email.setText(userModel.getEmail());
|
||||
link.setText(userModel.getBlog());
|
||||
joined.setText(ParseDateFormat.getTimeAgo(userModel.getCreatedAt()));
|
||||
if (InputHelper.isEmpty(userModel.getLocation())) {
|
||||
location.setVisibility(GONE);
|
||||
|
||||
if (!InputHelper.isEmpty(userModel.getLocation())) {
|
||||
location.setVisibility(View.VISIBLE);
|
||||
}
|
||||
if (InputHelper.isEmpty(userModel.getEmail())) {
|
||||
email.setVisibility(GONE);
|
||||
if (!InputHelper.isEmpty(userModel.getEmail())) {
|
||||
email.setVisibility(View.VISIBLE);
|
||||
}
|
||||
if (InputHelper.isEmpty(userModel.getBlog())) {
|
||||
link.setVisibility(GONE);
|
||||
if (!InputHelper.isEmpty(userModel.getBlog())) {
|
||||
link.setVisibility(View.VISIBLE);
|
||||
}
|
||||
if (InputHelper.isEmpty(userModel.getCreatedAt())) {
|
||||
joined.setVisibility(GONE);
|
||||
if (!InputHelper.isEmpty(userModel.getCreatedAt())) {
|
||||
joined.setVisibility(View.VISIBLE);
|
||||
}
|
||||
if (getView() != null) {
|
||||
TransitionManager.beginDelayedTransition((ViewGroup) getView());
|
||||
if (!InputHelper.isEmpty(userModel.getEmail())) {
|
||||
email.setVisibility(View.VISIBLE);
|
||||
}
|
||||
projects.setVisibility(userModel.isHasOrganizationProjects() ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
|
||||
@Override protected int fragmentLayout() {
|
||||
|
||||
@ -0,0 +1,63 @@
|
||||
package com.fastaccess.ui.modules.profile.org.project
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.support.design.widget.AppBarLayout
|
||||
import butterknife.BindView
|
||||
import com.evernote.android.state.State
|
||||
import com.fastaccess.R
|
||||
import com.fastaccess.helper.BundleConstant
|
||||
import com.fastaccess.helper.Bundler
|
||||
import com.fastaccess.ui.base.BaseActivity
|
||||
import com.fastaccess.ui.base.mvp.BaseMvp
|
||||
import com.fastaccess.ui.base.mvp.presenter.BasePresenter
|
||||
import com.fastaccess.ui.modules.repos.projects.RepoProjectsFragmentPager
|
||||
|
||||
/**
|
||||
* Created by Hashemsergani on 24.09.17.
|
||||
*/
|
||||
|
||||
class OrgProjectActivity : BaseActivity<BaseMvp.FAView, BasePresenter<BaseMvp.FAView>>() {
|
||||
|
||||
@State var org: String? = null
|
||||
|
||||
@BindView(R.id.appbar) lateinit var appBar: AppBarLayout
|
||||
|
||||
override fun layout(): Int = R.layout.activity_fragment_layout
|
||||
|
||||
override fun isTransparent(): Boolean = true
|
||||
|
||||
override fun canBack(): Boolean = true
|
||||
|
||||
override fun isSecured(): Boolean = false
|
||||
|
||||
override fun providePresenter(): BasePresenter<BaseMvp.FAView> = BasePresenter()
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
appBar.elevation = 0f
|
||||
appBar.stateListAnimator = null
|
||||
if (savedInstanceState == null) {
|
||||
org = intent.extras.getString(BundleConstant.ITEM)
|
||||
val org = org
|
||||
if (org != null) {
|
||||
supportFragmentManager.beginTransaction()
|
||||
.replace(R.id.container, RepoProjectsFragmentPager.newInstance(org),
|
||||
RepoProjectsFragmentPager.TAG)
|
||||
.commit()
|
||||
}
|
||||
}
|
||||
toolbar?.apply { subtitle = org }
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun startActivity(context: Context, org: String, isEnterprise: Boolean) {
|
||||
val intent = Intent(context, OrgProjectActivity::class.java)
|
||||
intent.putExtras(Bundler.start().put(BundleConstant.ITEM, org)
|
||||
.put(BundleConstant.IS_ENTERPRISE, isEnterprise)
|
||||
.end())
|
||||
context.startActivity(intent)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -236,7 +236,7 @@ class RepoPagerPresenter extends BasePresenter<RepoPagerMvp.View> implements Rep
|
||||
break;
|
||||
case RepoPagerMvp.PROJECTS:
|
||||
if (projectsFragmentPager == null) {
|
||||
onAddAndHide(fragmentManager, RepoProjectsFragmentPager.Companion.newInstance(repoId(), login()), currentVisible);
|
||||
onAddAndHide(fragmentManager, RepoProjectsFragmentPager.Companion.newInstance(login(), repoId()), currentVisible);
|
||||
} else {
|
||||
onShowHideFragment(fragmentManager, projectsFragmentPager, currentVisible);
|
||||
}
|
||||
|
||||
@ -188,9 +188,20 @@ public class CommitCommentsFragment extends BaseFragment<CommitCommentsMvp.View,
|
||||
}
|
||||
|
||||
@Override public void onTagUser(@Nullable User user) {
|
||||
if (commentsCallback != null && user != null) {
|
||||
commentsCallback.onTagUser(user.getLogin());
|
||||
}
|
||||
Intent intent = new Intent(getContext(), EditorActivity.class);
|
||||
intent.putExtras(Bundler
|
||||
.start()
|
||||
.put(BundleConstant.ID, getPresenter().repoId())
|
||||
.put(BundleConstant.EXTRA_TWO, getPresenter().login())
|
||||
.put(BundleConstant.EXTRA_THREE, getPresenter().sha())
|
||||
.put(BundleConstant.EXTRA, user != null ? "@" + user.getLogin() : "")
|
||||
.put(BundleConstant.EXTRA_TYPE, BundleConstant.ExtraType.NEW_COMMIT_COMMENT_EXTRA)
|
||||
.putStringArrayList("participants", CommentsHelper.getUsersByTimeline(adapter.getData()))
|
||||
.put(BundleConstant.IS_ENTERPRISE, isEnterprise())
|
||||
.end());
|
||||
View view = getActivity() != null && getActivity().findViewById(R.id.fab) != null ? getActivity().findViewById(R.id.fab) : recycler;
|
||||
ActivityHelper.startReveal(this, intent, view, BundleConstant.REQUEST_CODE);
|
||||
|
||||
}
|
||||
|
||||
@Override public void onReply(User user, String message) {
|
||||
|
||||
@ -39,7 +39,7 @@ class RepoProjectsFragmentPager : BaseFragment<BaseMvp.FAView, BasePresenter<Bas
|
||||
|
||||
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) {
|
||||
pager.adapter = FragmentsPagerAdapter(childFragmentManager, FragmentPagerAdapterModel.buildForRepoProjects(context,
|
||||
arguments.getString(BundleConstant.EXTRA), arguments.getString(BundleConstant.ID)))
|
||||
arguments.getString(BundleConstant.ID), arguments.getString(BundleConstant.EXTRA)))
|
||||
tabs.setupWithViewPager(pager)
|
||||
if (savedInstanceState != null) {
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
@ -71,7 +71,7 @@ class RepoProjectsFragmentPager : BaseFragment<BaseMvp.FAView, BasePresenter<Bas
|
||||
|
||||
companion object {
|
||||
val TAG = RepoProjectsFragmentPager::class.java.simpleName
|
||||
fun newInstance(login: String, repoId: String): RepoProjectsFragmentPager {
|
||||
fun newInstance(login: String, repoId: String? = null): RepoProjectsFragmentPager {
|
||||
val fragment = RepoProjectsFragmentPager()
|
||||
fragment.arguments = Bundler.start()
|
||||
.put(BundleConstant.ID, repoId)
|
||||
|
||||
@ -37,6 +37,9 @@ class ProjectColumnFragment : BaseFragment<ProjectColumnMvp.View, ProjectColumnP
|
||||
@BindView(R.id.fastScroller) lateinit var fastScroller: RecyclerViewFastScroller
|
||||
@BindView(R.id.columnName) lateinit var columnName: FontTextView
|
||||
@BindView(R.id.editColumnHolder) lateinit var editColumnHolder: View
|
||||
@BindView(R.id.editColumn) lateinit var editColumn: View
|
||||
@BindView(R.id.addCard) lateinit var addCard: View
|
||||
@BindView(R.id.deleteColumn) lateinit var deleteColumn: View
|
||||
|
||||
private var onLoadMore: OnLoadMore<Long>? = null
|
||||
private val adapter by lazy { ColumnCardAdapter(presenter.getCards(), isOwner()) }
|
||||
@ -119,6 +122,9 @@ class ProjectColumnFragment : BaseFragment<ProjectColumnMvp.View, ProjectColumnP
|
||||
if (presenter.getCards().isEmpty() && !presenter.isApiCalled) {
|
||||
presenter.onCallApi(1, column.id)
|
||||
}
|
||||
addCard.visibility = if(isOwner()) View.VISIBLE else View.GONE
|
||||
deleteColumn.visibility = if(isOwner()) View.VISIBLE else View.GONE
|
||||
editColumn.visibility = if(isOwner()) View.VISIBLE else View.GONE
|
||||
}
|
||||
|
||||
override fun showProgress(@StringRes resId: Int) {
|
||||
|
||||
@ -18,6 +18,7 @@ import com.fastaccess.helper.Bundler
|
||||
import com.fastaccess.ui.adapter.FragmentsPagerAdapter
|
||||
import com.fastaccess.ui.base.BaseActivity
|
||||
import com.fastaccess.ui.modules.repos.RepoPagerActivity
|
||||
import com.fastaccess.ui.modules.user.UserPagerActivity
|
||||
import com.fastaccess.ui.widgets.CardsPagerTransformerBasic
|
||||
|
||||
/**
|
||||
@ -76,12 +77,17 @@ class ProjectPagerActivity : BaseActivity<ProjectPagerMvp.View, ProjectPagerPres
|
||||
override fun onOptionsItemSelected(item: MenuItem?): Boolean {
|
||||
return when (item?.itemId) {
|
||||
android.R.id.home -> {
|
||||
if (!presenter.login.isBlank() && !presenter.repoId.isBlank()) {
|
||||
val nameParse = NameParser("")
|
||||
nameParse.name = presenter.repoId
|
||||
nameParse.username = presenter.login
|
||||
nameParse.isEnterprise = isEnterprise
|
||||
RepoPagerActivity.startRepoPager(this, nameParse)
|
||||
val repoId = presenter.repoId
|
||||
if (repoId != null && !repoId.isNullOrBlank()) {
|
||||
if (!presenter.login.isBlank()) {
|
||||
val nameParse = NameParser("")
|
||||
nameParse.name = presenter.repoId
|
||||
nameParse.username = presenter.login
|
||||
nameParse.isEnterprise = isEnterprise
|
||||
RepoPagerActivity.startRepoPager(this, nameParse)
|
||||
}
|
||||
} else if (!presenter.login.isBlank()) {
|
||||
UserPagerActivity.startActivity(this, presenter.login, true, isEnterprise, 0)
|
||||
}
|
||||
finish()
|
||||
true
|
||||
@ -112,7 +118,11 @@ class ProjectPagerActivity : BaseActivity<ProjectPagerMvp.View, ProjectPagerPres
|
||||
} else {
|
||||
onInitPager(presenter.getColumns())
|
||||
}
|
||||
toolbar?.subtitle = "${presenter.login}/${presenter.repoId}"
|
||||
if (presenter.repoId.isNullOrBlank()) {
|
||||
toolbar?.subtitle = presenter.login
|
||||
} else {
|
||||
toolbar?.subtitle = "${presenter.login}/${presenter.repoId}"
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDeletePage(model: ProjectColumnModel) {
|
||||
@ -121,11 +131,11 @@ class ProjectPagerActivity : BaseActivity<ProjectPagerMvp.View, ProjectPagerPres
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun startActivity(context: Context, login: String, repoId: String, projectId: Long, isEnterprise: Boolean = false) {
|
||||
fun startActivity(context: Context, login: String, repoId: String? = null, projectId: Long, isEnterprise: Boolean = false) {
|
||||
context.startActivity(getIntent(context, login, repoId, projectId, isEnterprise))
|
||||
}
|
||||
|
||||
fun getIntent(context: Context, login: String, repoId: String, projectId: Long, isEnterprise: Boolean = false): Intent {
|
||||
fun getIntent(context: Context, login: String, repoId: String? = null, projectId: Long, isEnterprise: Boolean = false): Intent {
|
||||
val intent = Intent(context, ProjectPagerActivity::class.java)
|
||||
intent.putExtras(Bundler.start()
|
||||
.put(BundleConstant.ID, projectId)
|
||||
|
||||
@ -19,7 +19,7 @@ class ProjectPagerPresenter : BasePresenter<ProjectPagerMvp.View>(), ProjectPage
|
||||
|
||||
private val columns = arrayListOf<ProjectColumnModel>()
|
||||
@com.evernote.android.state.State var projectId: Long = -1
|
||||
@com.evernote.android.state.State var repoId: String = ""
|
||||
@com.evernote.android.state.State var repoId: String? = null
|
||||
@com.evernote.android.state.State var login: String = ""
|
||||
@com.evernote.android.state.State var viewerCanUpdate: Boolean = false
|
||||
|
||||
@ -27,23 +27,39 @@ class ProjectPagerPresenter : BasePresenter<ProjectPagerMvp.View>(), ProjectPage
|
||||
|
||||
|
||||
override fun onRetrieveColumns() {
|
||||
makeRestCall(Observable.zip(RestProvider.getProjectsService(isEnterprise).getProjectColumns(projectId),
|
||||
RestProvider.getRepoService(isEnterprise).isCollaborator(login, repoId, Login.getUser().login),
|
||||
BiFunction { items: Pageable<ProjectColumnModel>, response: Response<Boolean> ->
|
||||
viewerCanUpdate = response.code() == 204
|
||||
return@BiFunction items
|
||||
})
|
||||
.flatMap {
|
||||
if (it.items != null) {
|
||||
return@flatMap Observable.just(it.items)
|
||||
}
|
||||
return@flatMap Observable.just(listOf<ProjectColumnModel>())
|
||||
},
|
||||
{ t ->
|
||||
columns.clear()
|
||||
columns.addAll(t)
|
||||
sendToView { it.onInitPager(columns) }
|
||||
})
|
||||
val repoId = repoId
|
||||
if (repoId != null && !repoId.isNullOrBlank()) {
|
||||
makeRestCall(Observable.zip(RestProvider.getProjectsService(isEnterprise).getProjectColumns(projectId),
|
||||
RestProvider.getRepoService(isEnterprise).isCollaborator(login, repoId, Login.getUser().login),
|
||||
BiFunction { items: Pageable<ProjectColumnModel>, response: Response<Boolean> ->
|
||||
viewerCanUpdate = response.code() == 204
|
||||
return@BiFunction items
|
||||
})
|
||||
.flatMap {
|
||||
if (it.items != null) {
|
||||
return@flatMap Observable.just(it.items)
|
||||
}
|
||||
return@flatMap Observable.just(listOf<ProjectColumnModel>())
|
||||
},
|
||||
{ t ->
|
||||
columns.clear()
|
||||
columns.addAll(t)
|
||||
sendToView { it.onInitPager(columns) }
|
||||
})
|
||||
} else {
|
||||
makeRestCall(RestProvider.getProjectsService(isEnterprise).getProjectColumns(projectId)
|
||||
.flatMap {
|
||||
if (it.items != null) {
|
||||
return@flatMap Observable.just(it.items)
|
||||
}
|
||||
return@flatMap Observable.just(listOf<ProjectColumnModel>())
|
||||
},
|
||||
{ t ->
|
||||
columns.clear()
|
||||
columns.addAll(t)
|
||||
sendToView { it.onInitPager(columns) }
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
override fun onActivityCreated(intent: Intent?) {
|
||||
|
||||
@ -134,7 +134,7 @@ class RepoProjectFragment : BaseFragment<RepoProjectMvp.View, RepoProjectPresent
|
||||
private fun getState(): IssueState = arguments.getSerializable(BundleConstant.EXTRA_TYPE) as IssueState
|
||||
|
||||
companion object {
|
||||
fun newInstance(login: String, repoId: String, state: IssueState): RepoProjectFragment {
|
||||
fun newInstance(login: String, repoId: String? = null, state: IssueState): RepoProjectFragment {
|
||||
val fragment = RepoProjectFragment()
|
||||
fragment.arguments = Bundler.start()
|
||||
.put(BundleConstant.ID, repoId)
|
||||
|
||||
@ -5,9 +5,12 @@ import android.view.View
|
||||
import com.apollographql.apollo.rx2.Rx2Apollo
|
||||
import com.fastaccess.data.dao.types.IssueState
|
||||
import com.fastaccess.helper.BundleConstant
|
||||
import com.fastaccess.helper.Logger
|
||||
import com.fastaccess.provider.rest.ApolloProdivder
|
||||
import com.fastaccess.ui.base.mvp.presenter.BasePresenter
|
||||
import com.fastaccess.ui.modules.repos.projects.details.ProjectPagerActivity
|
||||
import github.OrgProjectsClosedQuery
|
||||
import github.OrgProjectsOpenQuery
|
||||
import github.RepoProjectsClosedQuery
|
||||
import github.RepoProjectsOpenQuery
|
||||
import io.reactivex.Observable
|
||||
@ -22,7 +25,7 @@ class RepoProjectPresenter : BasePresenter<RepoProjectMvp.View>(), RepoProjectMv
|
||||
private var previousTotal: Int = 0
|
||||
private var lastPage = Integer.MAX_VALUE
|
||||
@com.evernote.android.state.State var login: String = ""
|
||||
@com.evernote.android.state.State var repoId: String = ""
|
||||
@com.evernote.android.state.State var repoId: String? = null
|
||||
var count: Int = 0
|
||||
val pages = arrayListOf<String>()
|
||||
|
||||
@ -65,74 +68,152 @@ class RepoProjectPresenter : BasePresenter<RepoProjectMvp.View>(), RepoProjectMv
|
||||
return false
|
||||
}
|
||||
currentPage = page
|
||||
Logger.e(login)
|
||||
val repoId = repoId
|
||||
val apollo = ApolloProdivder.getApollo(isEnterprise)
|
||||
if (parameter == IssueState.open) {
|
||||
val query = RepoProjectsOpenQuery.builder()
|
||||
.name(repoId)
|
||||
.owner(login)
|
||||
.page(getPage())
|
||||
.build()
|
||||
makeRestCall(Rx2Apollo.from(apollo.query(query))
|
||||
.flatMap {
|
||||
val list = arrayListOf<RepoProjectsOpenQuery.Node>()
|
||||
it.data()?.repository()?.let {
|
||||
it.projects().let {
|
||||
lastPage = if (it.pageInfo().hasNextPage()) Int.MAX_VALUE else 0
|
||||
pages.clear()
|
||||
count = it.totalCount()
|
||||
it.edges()?.let {
|
||||
pages.addAll(it.map { it.cursor() })
|
||||
}
|
||||
it.nodes()?.let {
|
||||
list.addAll(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
return@flatMap Observable.just(list)
|
||||
},
|
||||
{
|
||||
sendToView({ v ->
|
||||
v.onNotifyAdapter(it, page)
|
||||
if (page == 1) v.onChangeTotalCount(count)
|
||||
})
|
||||
})
|
||||
} else {
|
||||
val query = RepoProjectsClosedQuery.builder()
|
||||
.name(repoId)
|
||||
.owner(login)
|
||||
.page(getPage())
|
||||
.build()
|
||||
makeRestCall(Rx2Apollo.from(apollo.query(query))
|
||||
.flatMap {
|
||||
val list = arrayListOf<RepoProjectsOpenQuery.Node>()
|
||||
it.data()?.repository()?.let {
|
||||
it.projects().let {
|
||||
lastPage = if (it.pageInfo().hasNextPage()) Int.MAX_VALUE else 0
|
||||
pages.clear()
|
||||
count = it.totalCount()
|
||||
it.edges()?.let {
|
||||
pages.addAll(it.map { it.cursor() })
|
||||
}
|
||||
it.nodes()?.let {
|
||||
val toConvert = arrayListOf<RepoProjectsOpenQuery.Node>()
|
||||
it.onEach {
|
||||
val columns = RepoProjectsOpenQuery.Columns(it.columns().__typename(), it.columns().totalCount())
|
||||
val node = RepoProjectsOpenQuery.Node(it.__typename(), it.name(), it.number(), it.body(),
|
||||
it.createdAt(), it.id(), it.viewerCanUpdate(), columns, it.databaseId())
|
||||
toConvert.add(node)
|
||||
if (repoId != null && !repoId.isNullOrBlank()) {
|
||||
if (parameter == IssueState.open) {
|
||||
val query = RepoProjectsOpenQuery.builder()
|
||||
.name(repoId)
|
||||
.owner(login)
|
||||
.page(getPage())
|
||||
.build()
|
||||
makeRestCall(Rx2Apollo.from(apollo.query(query))
|
||||
.flatMap {
|
||||
val list = arrayListOf<RepoProjectsOpenQuery.Node>()
|
||||
it.data()?.repository()?.let {
|
||||
it.projects().let {
|
||||
lastPage = if (it.pageInfo().hasNextPage()) Int.MAX_VALUE else 0
|
||||
pages.clear()
|
||||
count = it.totalCount()
|
||||
it.edges()?.let {
|
||||
pages.addAll(it.map { it.cursor() })
|
||||
}
|
||||
it.nodes()?.let {
|
||||
list.addAll(it)
|
||||
}
|
||||
list.addAll(toConvert)
|
||||
}
|
||||
}
|
||||
}
|
||||
return@flatMap Observable.just(list)
|
||||
},
|
||||
{
|
||||
sendToView({ v ->
|
||||
v.onNotifyAdapter(it, page)
|
||||
if (page == 1) v.onChangeTotalCount(count)
|
||||
return@flatMap Observable.just(list)
|
||||
},
|
||||
{
|
||||
sendToView({ v ->
|
||||
v.onNotifyAdapter(it, page)
|
||||
if (page == 1) v.onChangeTotalCount(count)
|
||||
})
|
||||
})
|
||||
})
|
||||
} else {
|
||||
val query = RepoProjectsClosedQuery.builder()
|
||||
.name(repoId)
|
||||
.owner(login)
|
||||
.page(getPage())
|
||||
.build()
|
||||
makeRestCall(Rx2Apollo.from(apollo.query(query))
|
||||
.flatMap {
|
||||
val list = arrayListOf<RepoProjectsOpenQuery.Node>()
|
||||
it.data()?.repository()?.let {
|
||||
it.projects().let {
|
||||
lastPage = if (it.pageInfo().hasNextPage()) Int.MAX_VALUE else 0
|
||||
pages.clear()
|
||||
count = it.totalCount()
|
||||
it.edges()?.let {
|
||||
pages.addAll(it.map { it.cursor() })
|
||||
}
|
||||
it.nodes()?.let {
|
||||
val toConvert = arrayListOf<RepoProjectsOpenQuery.Node>()
|
||||
it.onEach {
|
||||
val columns = RepoProjectsOpenQuery.Columns(it.columns().__typename(), it.columns().totalCount())
|
||||
val node = RepoProjectsOpenQuery.Node(it.__typename(), it.name(), it.number(), it.body(),
|
||||
it.createdAt(), it.id(), it.viewerCanUpdate(), columns, it.databaseId())
|
||||
toConvert.add(node)
|
||||
}
|
||||
list.addAll(toConvert)
|
||||
}
|
||||
}
|
||||
}
|
||||
return@flatMap Observable.just(list)
|
||||
},
|
||||
{
|
||||
sendToView({ v ->
|
||||
v.onNotifyAdapter(it, page)
|
||||
if (page == 1) v.onChangeTotalCount(count)
|
||||
})
|
||||
})
|
||||
}
|
||||
} else {
|
||||
if (parameter == IssueState.open) {
|
||||
val query = OrgProjectsOpenQuery.builder()
|
||||
.owner(login)
|
||||
.page(getPage())
|
||||
.build()
|
||||
makeRestCall(Rx2Apollo.from(apollo.query(query))
|
||||
.flatMap {
|
||||
val list = arrayListOf<RepoProjectsOpenQuery.Node>()
|
||||
it.data()?.organization()?.let {
|
||||
it.projects().let {
|
||||
lastPage = if (it.pageInfo().hasNextPage()) Int.MAX_VALUE else 0
|
||||
pages.clear()
|
||||
count = it.totalCount()
|
||||
it.edges()?.let {
|
||||
pages.addAll(it.map { it.cursor() })
|
||||
}
|
||||
it.nodes()?.let {
|
||||
val toConvert = arrayListOf<RepoProjectsOpenQuery.Node>()
|
||||
it.onEach {
|
||||
val columns = RepoProjectsOpenQuery.Columns(it.columns().__typename(), it.columns().totalCount())
|
||||
val node = RepoProjectsOpenQuery.Node(it.__typename(), it.name(), it.number(), it.body(),
|
||||
it.createdAt(), it.id(), it.viewerCanUpdate(), columns, it.databaseId())
|
||||
toConvert.add(node)
|
||||
}
|
||||
list.addAll(toConvert)
|
||||
}
|
||||
}
|
||||
}
|
||||
return@flatMap Observable.just(list)
|
||||
},
|
||||
{
|
||||
sendToView({ v ->
|
||||
v.onNotifyAdapter(it, page)
|
||||
if (page == 1) v.onChangeTotalCount(count)
|
||||
})
|
||||
})
|
||||
} else {
|
||||
val query = OrgProjectsClosedQuery.builder()
|
||||
.owner(login)
|
||||
.page(getPage())
|
||||
.build()
|
||||
makeRestCall(Rx2Apollo.from(apollo.query(query))
|
||||
.flatMap {
|
||||
val list = arrayListOf<RepoProjectsOpenQuery.Node>()
|
||||
it.data()?.organization()?.let {
|
||||
it.projects().let {
|
||||
lastPage = if (it.pageInfo().hasNextPage()) Int.MAX_VALUE else 0
|
||||
pages.clear()
|
||||
count = it.totalCount()
|
||||
it.edges()?.let {
|
||||
pages.addAll(it.map { it.cursor() })
|
||||
}
|
||||
it.nodes()?.let {
|
||||
val toConvert = arrayListOf<RepoProjectsOpenQuery.Node>()
|
||||
it.onEach {
|
||||
val columns = RepoProjectsOpenQuery.Columns(it.columns().__typename(), it.columns().totalCount())
|
||||
val node = RepoProjectsOpenQuery.Node(it.__typename(), it.name(), it.number(), it.body(),
|
||||
it.createdAt(), it.id(), it.viewerCanUpdate(), columns, it.databaseId())
|
||||
toConvert.add(node)
|
||||
}
|
||||
list.addAll(toConvert)
|
||||
}
|
||||
}
|
||||
}
|
||||
return@flatMap Observable.just(list)
|
||||
},
|
||||
{
|
||||
sendToView({ v ->
|
||||
v.onNotifyAdapter(it, page)
|
||||
if (page == 1) v.onChangeTotalCount(count)
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
package com.fastaccess.ui.modules.repos.pull_requests.pull_request.details.files;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
@ -24,6 +26,7 @@ import com.fastaccess.ui.adapter.CommitFilesAdapter;
|
||||
import com.fastaccess.ui.base.BaseFragment;
|
||||
import com.fastaccess.ui.modules.main.premium.PremiumActivity;
|
||||
import com.fastaccess.ui.modules.repos.issues.issue.details.IssuePagerMvp;
|
||||
import com.fastaccess.ui.modules.repos.pull_requests.pull_request.details.files.fullscreen.FullScreenFileChangeActivity;
|
||||
import com.fastaccess.ui.modules.reviews.AddReviewDialogFragment;
|
||||
import com.fastaccess.ui.widgets.FontTextView;
|
||||
import com.fastaccess.ui.widgets.StateLayout;
|
||||
@ -169,6 +172,10 @@ public class PullRequestFilesFragment extends BaseFragment<PullRequestFilesMvp.V
|
||||
return onLoadMore;
|
||||
}
|
||||
|
||||
@Override public void onOpenForResult(int position, @NonNull CommitFileChanges model) {
|
||||
FullScreenFileChangeActivity.Companion.startActivityForResult(this, model, position);
|
||||
}
|
||||
|
||||
@Override public void onRefresh() {
|
||||
getPresenter().onCallApi(1, null);
|
||||
}
|
||||
@ -232,6 +239,23 @@ public class PullRequestFilesFragment extends BaseFragment<PullRequestFilesMvp.V
|
||||
}
|
||||
}
|
||||
|
||||
@Override public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
if (resultCode == Activity.RESULT_OK) {
|
||||
if (requestCode == FullScreenFileChangeActivity.Companion.getFOR_RESULT_CODE() && data != null) {
|
||||
List<CommentRequestModel> comments = data.getParcelableArrayListExtra(BundleConstant.ITEM);
|
||||
if (comments != null && !comments.isEmpty()) {
|
||||
if (viewCallback != null) {
|
||||
for (CommentRequestModel comment : comments) {
|
||||
viewCallback.onAddComment(comment);
|
||||
}
|
||||
showMessage(R.string.success, R.string.comments_added_successfully);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
}
|
||||
|
||||
private void showReload() {
|
||||
hideProgress();
|
||||
stateLayout.showReload(adapter.getItemCount());
|
||||
|
||||
@ -29,6 +29,8 @@ public interface PullRequestFilesMvp {
|
||||
void onNotifyAdapter(@Nullable List<CommitFileChanges> items, int page);
|
||||
|
||||
@NonNull OnLoadMore getLoadMore();
|
||||
|
||||
void onOpenForResult(int position, @NonNull CommitFileChanges linesModel);
|
||||
}
|
||||
|
||||
interface Presenter extends BaseMvp.FAPresenter,
|
||||
|
||||
@ -104,7 +104,9 @@ class PullRequestFilesPresenter extends BasePresenter<PullRequestFilesMvp.View>
|
||||
}
|
||||
|
||||
@Override public void onItemClick(int position, View v, CommitFileChanges model) {
|
||||
if (v.getId() == R.id.open) {
|
||||
if (v.getId() == R.id.patchList) {
|
||||
sendToView(view -> view.onOpenForResult(position, model));
|
||||
} else if (v.getId() == R.id.open) {
|
||||
CommitFileModel item = model.getCommitFileModel();
|
||||
PopupMenu popup = new PopupMenu(v.getContext(), v);
|
||||
MenuInflater inflater = popup.getMenuInflater();
|
||||
|
||||
@ -0,0 +1,168 @@
|
||||
package com.fastaccess.ui.modules.repos.pull_requests.pull_request.details.files.fullscreen
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import android.support.v4.app.Fragment
|
||||
import android.support.v4.widget.SwipeRefreshLayout
|
||||
import android.view.Menu
|
||||
import android.view.MenuItem
|
||||
import android.view.View
|
||||
import android.widget.TextView
|
||||
import butterknife.BindView
|
||||
import com.fastaccess.R
|
||||
import com.fastaccess.data.dao.CommentRequestModel
|
||||
import com.fastaccess.data.dao.CommitFileChanges
|
||||
import com.fastaccess.data.dao.CommitLinesModel
|
||||
import com.fastaccess.helper.BundleConstant
|
||||
import com.fastaccess.helper.Bundler
|
||||
import com.fastaccess.helper.PrefGetter
|
||||
import com.fastaccess.ui.adapter.CommitLinesAdapter
|
||||
import com.fastaccess.ui.base.BaseActivity
|
||||
import com.fastaccess.ui.modules.main.premium.PremiumActivity
|
||||
import com.fastaccess.ui.modules.reviews.AddReviewDialogFragment
|
||||
import com.fastaccess.ui.widgets.StateLayout
|
||||
import com.fastaccess.ui.widgets.recyclerview.DynamicRecyclerView
|
||||
import com.fastaccess.ui.widgets.recyclerview.scroll.RecyclerViewFastScroller
|
||||
|
||||
/**
|
||||
* Created by Hashemsergani on 24.09.17.
|
||||
*/
|
||||
|
||||
class FullScreenFileChangeActivity : BaseActivity<FullScreenFileChangeMvp.View, FullScreenFileChangePresenter>(), FullScreenFileChangeMvp.View {
|
||||
|
||||
@BindView(R.id.recycler) lateinit var recycler: DynamicRecyclerView
|
||||
@BindView(R.id.refresh) lateinit var refresh: SwipeRefreshLayout
|
||||
@BindView(R.id.stateLayout) lateinit var stateLayout: StateLayout
|
||||
@BindView(R.id.fastScroller) lateinit var fastScroller: RecyclerViewFastScroller
|
||||
@BindView(R.id.changes) lateinit var changes: TextView
|
||||
@BindView(R.id.deletion) lateinit var deletion: TextView
|
||||
@BindView(R.id.addition) lateinit var addition: TextView
|
||||
|
||||
val commentList = arrayListOf<CommentRequestModel>()
|
||||
|
||||
private val adapter by lazy { CommitLinesAdapter(arrayListOf(), this) }
|
||||
|
||||
override fun layout(): Int = R.layout.full_screen_file_changes_layout
|
||||
|
||||
override fun isTransparent(): Boolean = false
|
||||
|
||||
override fun canBack(): Boolean = true
|
||||
|
||||
override fun isSecured(): Boolean = false
|
||||
|
||||
override fun providePresenter(): FullScreenFileChangePresenter = FullScreenFileChangePresenter()
|
||||
|
||||
override fun onNotifyAdapter(model: CommitLinesModel) {
|
||||
adapter.addItem(model)
|
||||
}
|
||||
|
||||
override fun showMessage(titleRes: Int, msgRes: Int) {
|
||||
hideProgress()
|
||||
super.showMessage(titleRes, msgRes)
|
||||
}
|
||||
|
||||
override fun showMessage(titleRes: String, msgRes: String) {
|
||||
hideProgress()
|
||||
super.showMessage(titleRes, msgRes)
|
||||
}
|
||||
|
||||
override fun showErrorMessage(msgRes: String) {
|
||||
hideProgress()
|
||||
super.showErrorMessage(msgRes)
|
||||
}
|
||||
|
||||
override fun showProgress(resId: Int) {
|
||||
stateLayout.showProgress()
|
||||
refresh.isRefreshing = true
|
||||
}
|
||||
|
||||
override fun hideProgress() {
|
||||
stateLayout.hideProgress()
|
||||
refresh.isRefreshing = false
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
refresh.isEnabled = false
|
||||
recycler.adapter = adapter
|
||||
val padding = resources.getDimensionPixelSize(R.dimen.spacing_normal)
|
||||
recycler.setPadding(padding, 0, padding, 0)
|
||||
fastScroller.attachRecyclerView(recycler)
|
||||
presenter.onLoad(intent)
|
||||
presenter.model?.let { model ->
|
||||
title = Uri.parse(model.commitFileModel.filename).lastPathSegment
|
||||
addition.text = model.commitFileModel?.additions.toString()
|
||||
deletion.text = model.commitFileModel?.deletions.toString()
|
||||
changes.text = model.commitFileModel?.changes.toString()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreateOptionsMenu(menu: Menu?): Boolean {
|
||||
menuInflater.inflate(R.menu.done_menu, menu)
|
||||
menu?.findItem(R.id.submit)?.setIcon(R.drawable.ic_done)
|
||||
return super.onCreateOptionsMenu(menu)
|
||||
}
|
||||
|
||||
override fun onOptionsItemSelected(item: MenuItem?): Boolean {
|
||||
return when (item?.itemId) {
|
||||
R.id.submit -> {
|
||||
val intent = Intent()
|
||||
intent.putExtras(Bundler.start().putParcelableArrayList(BundleConstant.ITEM, commentList).end())
|
||||
setResult(Activity.RESULT_OK, intent)
|
||||
finish()
|
||||
true
|
||||
}
|
||||
else -> super.onOptionsItemSelected(item)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onItemClick(position: Int, v: View, item: CommitLinesModel) {
|
||||
if (item.text.startsWith("@@")) return
|
||||
val commit = presenter.model?.commitFileModel ?: return
|
||||
if (PrefGetter.isProEnabled()) {
|
||||
AddReviewDialogFragment.newInstance(item, Bundler.start()
|
||||
.put(BundleConstant.ITEM, commit.filename)
|
||||
.put(BundleConstant.EXTRA_TWO, presenter.position)
|
||||
.put(BundleConstant.EXTRA_THREE, position)
|
||||
.end())
|
||||
.show(supportFragmentManager, "AddReviewDialogFragment")
|
||||
} else {
|
||||
PremiumActivity.startActivity(this)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onItemLongClick(position: Int, v: View?, item: CommitLinesModel?) {
|
||||
|
||||
}
|
||||
|
||||
override fun onCommentAdded(comment: String, item: CommitLinesModel, bundle: Bundle?) {
|
||||
if (bundle != null) {
|
||||
val path = bundle.getString(BundleConstant.ITEM) ?: return
|
||||
val commentRequestModel = CommentRequestModel()
|
||||
commentRequestModel.body = comment
|
||||
commentRequestModel.path = path
|
||||
commentRequestModel.position = item.position
|
||||
commentList.add(commentRequestModel)
|
||||
val childPosition = bundle.getInt(BundleConstant.EXTRA_THREE)
|
||||
val current = adapter.getItem(childPosition)
|
||||
if (current != null) {
|
||||
current.isHasCommentedOn = true
|
||||
adapter.swapItem(current, childPosition)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
val FOR_RESULT_CODE = 1002
|
||||
fun startActivityForResult(fragment: Fragment, model: CommitFileChanges, position: Int) {
|
||||
val intent = Intent(fragment.context, FullScreenFileChangeActivity::class.java)
|
||||
intent.putExtras(Bundler.start()
|
||||
.put(BundleConstant.EXTRA, model)
|
||||
.put(BundleConstant.ITEM, position)
|
||||
.end())
|
||||
fragment.startActivityForResult(intent, FOR_RESULT_CODE)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
package com.fastaccess.ui.modules.repos.pull_requests.pull_request.details.files.fullscreen
|
||||
|
||||
import android.content.Intent
|
||||
import com.fastaccess.data.dao.CommitLinesModel
|
||||
import com.fastaccess.ui.base.mvp.BaseMvp
|
||||
import com.fastaccess.ui.modules.reviews.callback.ReviewCommentListener
|
||||
import com.fastaccess.ui.widgets.recyclerview.BaseViewHolder
|
||||
|
||||
/**
|
||||
* Created by Hashemsergani on 24.09.17.
|
||||
*/
|
||||
|
||||
interface FullScreenFileChangeMvp {
|
||||
interface View : BaseMvp.FAView, BaseViewHolder.OnItemClickListener<CommitLinesModel>, ReviewCommentListener {
|
||||
fun onNotifyAdapter(model: CommitLinesModel)
|
||||
}
|
||||
|
||||
interface Presenter {
|
||||
fun onLoad(intent: Intent)
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
package com.fastaccess.ui.modules.repos.pull_requests.pull_request.details.files.fullscreen
|
||||
|
||||
import android.content.Intent
|
||||
import com.fastaccess.data.dao.CommitFileChanges
|
||||
import com.fastaccess.helper.BundleConstant
|
||||
import com.fastaccess.helper.RxHelper
|
||||
import com.fastaccess.ui.base.mvp.presenter.BasePresenter
|
||||
import io.reactivex.Observable
|
||||
|
||||
/**
|
||||
* Created by Hashemsergani on 24.09.17.
|
||||
*/
|
||||
class FullScreenFileChangePresenter : BasePresenter<FullScreenFileChangeMvp.View>(), FullScreenFileChangeMvp.Presenter {
|
||||
|
||||
var model: CommitFileChanges? = null
|
||||
var position: Int = -1
|
||||
|
||||
override fun onLoad(intent: Intent) {
|
||||
intent.extras?.let {
|
||||
position = it.getInt(BundleConstant.ITEM)
|
||||
model = it.getParcelable(BundleConstant.EXTRA)
|
||||
}
|
||||
model?.let {
|
||||
manageDisposable(RxHelper.getObservable(Observable.fromIterable(it.linesModel))
|
||||
.doOnSubscribe({ sendToView { it.showProgress(0) } })
|
||||
.flatMap { Observable.just(it) }
|
||||
.subscribe
|
||||
({
|
||||
sendToView { v -> v.onNotifyAdapter(it) }
|
||||
}, {
|
||||
onError(it)
|
||||
}, {
|
||||
sendToView { it.hideProgress() }
|
||||
}))
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -39,10 +39,10 @@ class AddReviewDialogFragment : BaseDialogFragment<BaseMvp.FAView, BasePresenter
|
||||
|
||||
override fun onAttach(context: Context?) {
|
||||
super.onAttach(context)
|
||||
if (parentFragment is ReviewCommentListener) {
|
||||
commentCallback = parentFragment as ReviewCommentListener
|
||||
commentCallback = if (parentFragment is ReviewCommentListener) {
|
||||
parentFragment as ReviewCommentListener
|
||||
} else {
|
||||
commentCallback = context as ReviewCommentListener
|
||||
context as ReviewCommentListener
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -9,6 +9,7 @@ import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.annotation.StringRes;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
|
||||
import com.fastaccess.R;
|
||||
import com.fastaccess.helper.Bundler;
|
||||
@ -54,7 +55,11 @@ public class ProgressDialogFragment extends BaseDialogFragment {
|
||||
Dialog dialog = super.onCreateDialog(savedInstanceState);
|
||||
dialog.setCancelable(false);
|
||||
setCancelable(false);
|
||||
if (dialog.getWindow() != null) dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
Window window = dialog.getWindow();
|
||||
if (window != null) {
|
||||
window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
window.setDimAmount(0);
|
||||
}
|
||||
return dialog;
|
||||
}
|
||||
|
||||
|
||||
@ -33,7 +33,7 @@ class MarkDownLayout : LinearLayout {
|
||||
}
|
||||
|
||||
var markdownListener: MarkdownListener? = null
|
||||
|
||||
var selectionIndex = 0
|
||||
@BindView(R.id.editorIconsHolder) lateinit var editorIconsHolder: HorizontalScrollView
|
||||
@BindView(R.id.addEmoji) lateinit var addEmojiView: View
|
||||
|
||||
@ -54,19 +54,20 @@ class MarkDownLayout : LinearLayout {
|
||||
super.onDetachedFromWindow()
|
||||
}
|
||||
|
||||
@OnClick(R.id.view) internal fun onViewMarkDown() {
|
||||
@OnClick(R.id.view) fun onViewMarkDown() {
|
||||
markdownListener?.let {
|
||||
it.getEditText().let { editText ->
|
||||
TransitionManager.beginDelayedTransition(this)
|
||||
if (editText.isEnabled && !InputHelper.isEmpty(editText)) {
|
||||
editText.isEnabled = false
|
||||
selectionIndex = editText.selectionEnd
|
||||
MarkDownProvider.setMdText(editText, InputHelper.toString(editText))
|
||||
editorIconsHolder.visibility = View.INVISIBLE
|
||||
addEmojiView.visibility = View.INVISIBLE
|
||||
ViewHelper.hideKeyboard(editText)
|
||||
} else {
|
||||
editText.setText(it.getSavedText())
|
||||
editText.setSelection(editText.text.length)
|
||||
editText.setSelection(selectionIndex)
|
||||
editText.isEnabled = true
|
||||
editorIconsHolder.visibility = View.VISIBLE
|
||||
addEmojiView.visibility = View.VISIBLE
|
||||
@ -87,9 +88,9 @@ class MarkDownLayout : LinearLayout {
|
||||
Snackbar.make(this, R.string.error_highlighting_editor, Snackbar.LENGTH_SHORT).show()
|
||||
} else {
|
||||
when {
|
||||
v.id == R.id.link -> EditorLinkImageDialogFragment.newInstance(true)
|
||||
v.id == R.id.link -> EditorLinkImageDialogFragment.newInstance(true, getSelectedText())
|
||||
.show(it.fragmentManager(), "EditorLinkImageDialogFragment")
|
||||
v.id == R.id.image -> EditorLinkImageDialogFragment.newInstance(false)
|
||||
v.id == R.id.image -> EditorLinkImageDialogFragment.newInstance(false, getSelectedText())
|
||||
.show(it.fragmentManager(), "EditorLinkImageDialogFragment")
|
||||
v.id == R.id.addEmoji -> {
|
||||
ViewHelper.hideKeyboard(it.getEditText())
|
||||
@ -119,8 +120,6 @@ class MarkDownLayout : LinearLayout {
|
||||
R.id.header -> MarkDownProvider.addDivider(editText)
|
||||
R.id.code -> MarkDownProvider.addCode(editText)
|
||||
R.id.quote -> MarkDownProvider.addQuote(editText)
|
||||
R.id.link -> MarkDownProvider.addLink(editText)
|
||||
R.id.image -> MarkDownProvider.addPhoto(editText)
|
||||
R.id.checkbox -> MarkDownProvider.addList(editText, "- [x]")
|
||||
R.id.unCheckbox -> MarkDownProvider.addList(editText, "- [ ]")
|
||||
R.id.inlineCode -> MarkDownProvider.addInlinleCode(editText)
|
||||
@ -162,4 +161,15 @@ class MarkDownLayout : LinearLayout {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun getSelectedText(): String? {
|
||||
markdownListener?.getEditText()?.let {
|
||||
if (!it.text.toString().isBlank()) {
|
||||
val selectionStart = it.selectionStart
|
||||
val selectionEnd = it.selectionEnd
|
||||
return it.text.toString().substring(selectionStart, selectionEnd)
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,80 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.design.widget.CoordinatorLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<android.support.design.widget.AppBarLayout
|
||||
android:id="@+id/appbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="?android:toolbarStyle">
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?actionBarSize"
|
||||
android:theme="?android:toolbarStyle"
|
||||
app:layout_scrollFlags="scroll|enterAlways"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/bottom_border"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:padding="@dimen/spacing_normal">
|
||||
|
||||
<com.fastaccess.ui.widgets.FontTextView
|
||||
android:id="@+id/changes"
|
||||
style="@style/TextAppearance.AppCompat.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center|end"
|
||||
android:layout_marginEnd="@dimen/spacing_xs_large"
|
||||
android:background="?selectableItemBackgroundBorderless"
|
||||
android:drawablePadding="@dimen/spacing_micro"
|
||||
android:drawableTop="@drawable/ic_file_multi"
|
||||
android:gravity="center"
|
||||
tools:text="100"/>
|
||||
|
||||
<com.fastaccess.ui.widgets.FontTextView
|
||||
android:id="@+id/addition"
|
||||
style="@style/TextAppearance.AppCompat.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center|end"
|
||||
android:layout_marginEnd="@dimen/spacing_xs_large"
|
||||
android:background="?selectableItemBackgroundBorderless"
|
||||
android:drawablePadding="@dimen/spacing_micro"
|
||||
android:drawableTop="@drawable/ic_add"
|
||||
android:gravity="center"
|
||||
android:scaleType="centerCrop"
|
||||
tools:text="100"/>
|
||||
|
||||
<com.fastaccess.ui.widgets.FontTextView
|
||||
android:id="@+id/deletion"
|
||||
style="@style/TextAppearance.AppCompat.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center|end"
|
||||
android:background="?selectableItemBackgroundBorderless"
|
||||
android:drawablePadding="@dimen/spacing_micro"
|
||||
android:drawableTop="@drawable/ic_clear"
|
||||
android:gravity="center"
|
||||
tools:text="100"/>
|
||||
</LinearLayout>
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="@string/scroll_behavior">
|
||||
|
||||
<include layout="@layout/vertical_refresh_list"/>
|
||||
</LinearLayout>
|
||||
|
||||
</android.support.design.widget.CoordinatorLayout>
|
||||
@ -77,6 +77,7 @@
|
||||
android:gravity="center|start"
|
||||
android:paddingBottom="@dimen/spacing_xs_large"
|
||||
android:paddingTop="@dimen/spacing_xs_large"
|
||||
android:visibility="gone"
|
||||
tools:text="Cum classis nocere"/>
|
||||
|
||||
|
||||
@ -92,6 +93,7 @@
|
||||
android:gravity="center|start"
|
||||
android:paddingBottom="@dimen/spacing_xs_large"
|
||||
android:paddingTop="@dimen/spacing_xs_large"
|
||||
android:visibility="gone"
|
||||
tools:text="Cum classis nocere"/>
|
||||
|
||||
<com.fastaccess.ui.widgets.FontTextView
|
||||
@ -106,6 +108,7 @@
|
||||
android:gravity="center|start"
|
||||
android:paddingBottom="@dimen/spacing_xs_large"
|
||||
android:paddingTop="@dimen/spacing_xs_large"
|
||||
android:visibility="gone"
|
||||
tools:text="Cum classis nocere"/>
|
||||
|
||||
|
||||
@ -120,8 +123,25 @@
|
||||
android:gravity="center|start"
|
||||
android:paddingBottom="@dimen/spacing_xs_large"
|
||||
android:paddingTop="@dimen/spacing_xs_large"
|
||||
android:visibility="gone"
|
||||
tools:text="Cum classis nocere"/>
|
||||
|
||||
<com.fastaccess.ui.widgets.FontTextView
|
||||
android:id="@+id/projects"
|
||||
style="@style/Base.TextAppearance.AppCompat.Subhead"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/top_border"
|
||||
android:drawablePadding="@dimen/spacing_xs_large"
|
||||
android:drawableStart="@drawable/ic_project"
|
||||
android:gravity="center|start"
|
||||
android:paddingBottom="@dimen/spacing_xs_large"
|
||||
android:paddingTop="@dimen/spacing_xs_large"
|
||||
android:text="@string/projects"
|
||||
android:textColor="?colorAccent"
|
||||
android:visibility="gone"
|
||||
app:drawableColor="?colorAccent"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</android.support.v7.widget.CardView>
|
||||
|
||||
@ -154,7 +154,7 @@
|
||||
<string name="user">User</string>
|
||||
<string name="details">Details</string>
|
||||
<string name="archive_file_detected_error">Archive file detected, please download the file to view its content.</string>
|
||||
<string name="minimum_three_chars">Minimum characters (3)</string>
|
||||
<string name="minimum_three_chars">Minimum characters (2)</string>
|
||||
<string name="no_file_found">No file found</string>
|
||||
<string name="no_readme_found">No readme found</string>
|
||||
<string name="downloading">Downloading…</string>
|
||||
@ -611,4 +611,5 @@
|
||||
</p>
|
||||
]]></string>
|
||||
<string name="faq">FAQ</string>
|
||||
<string name="comments_added_successfully">Comments added successfully</string>
|
||||
</resources>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user