GitNex/app/src/main/java/org/mian/gitnex/adapters/FilesDiffAdapter.java

261 lines
6.6 KiB
Java
Raw Normal View History

2019-11-24 13:42:57 +01:00
package org.mian.gitnex.adapters;
Increasing usability and design of files diff. (#413) Applying sizes. Additional changes. First changes. Merge branch 'master' into diff-cleaner Fixing formatting. Merge branch 'master' into diff-cleaner Final changes for working with custom themes. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner First changes for working with custom themes. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Adding custom COLOR_FONT. Even smaller cleanups. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Small cleanups. Fixing bug and adding maximum line limit. Adding option to set cursor to end and small cleanup. First aid. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Few improvements. Performance improvements and cleanups. Minor improvements (code in order) and many bug fixes Bug fix. Combining cited code. Adding code commenting option. Renaming list_files_diffs_new to list_files_diffs Moving ProcessBar into center Increasing performance. Applying size to all icons globally. Removing another unused file. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Removing unused files. Changing size of 'close'-button. Major changes concerning design and bug fixes. Temporary save point. 2 1 Co-authored-by: opyale <example@example.com> Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/413 Reviewed-by: 6543 <6543@noreply.gitea.io> Reviewed-by: M M Arif <mmarif@swatian.com>
2020-04-28 14:39:41 +02:00
import android.annotation.SuppressLint;
2019-11-24 13:42:57 +01:00
import android.content.Context;
Increasing usability and design of files diff. (#413) Applying sizes. Additional changes. First changes. Merge branch 'master' into diff-cleaner Fixing formatting. Merge branch 'master' into diff-cleaner Final changes for working with custom themes. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner First changes for working with custom themes. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Adding custom COLOR_FONT. Even smaller cleanups. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Small cleanups. Fixing bug and adding maximum line limit. Adding option to set cursor to end and small cleanup. First aid. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Few improvements. Performance improvements and cleanups. Minor improvements (code in order) and many bug fixes Bug fix. Combining cited code. Adding code commenting option. Renaming list_files_diffs_new to list_files_diffs Moving ProcessBar into center Increasing performance. Applying size to all icons globally. Removing another unused file. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Removing unused files. Changing size of 'close'-button. Major changes concerning design and bug fixes. Temporary save point. 2 1 Co-authored-by: opyale <example@example.com> Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/413 Reviewed-by: 6543 <6543@noreply.gitea.io> Reviewed-by: M M Arif <mmarif@swatian.com>
2020-04-28 14:39:41 +02:00
import android.graphics.Typeface;
import android.os.Bundle;
Increasing usability and design of files diff. (#413) Applying sizes. Additional changes. First changes. Merge branch 'master' into diff-cleaner Fixing formatting. Merge branch 'master' into diff-cleaner Final changes for working with custom themes. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner First changes for working with custom themes. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Adding custom COLOR_FONT. Even smaller cleanups. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Small cleanups. Fixing bug and adding maximum line limit. Adding option to set cursor to end and small cleanup. First aid. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Few improvements. Performance improvements and cleanups. Minor improvements (code in order) and many bug fixes Bug fix. Combining cited code. Adding code commenting option. Renaming list_files_diffs_new to list_files_diffs Moving ProcessBar into center Increasing performance. Applying size to all icons globally. Removing another unused file. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Removing unused files. Changing size of 'close'-button. Major changes concerning design and bug fixes. Temporary save point. 2 1 Co-authored-by: opyale <example@example.com> Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/413 Reviewed-by: 6543 <6543@noreply.gitea.io> Reviewed-by: M M Arif <mmarif@swatian.com>
2020-04-28 14:39:41 +02:00
import android.util.TypedValue;
2019-11-24 13:42:57 +01:00
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Increasing usability and design of files diff. (#413) Applying sizes. Additional changes. First changes. Merge branch 'master' into diff-cleaner Fixing formatting. Merge branch 'master' into diff-cleaner Final changes for working with custom themes. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner First changes for working with custom themes. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Adding custom COLOR_FONT. Even smaller cleanups. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Small cleanups. Fixing bug and adding maximum line limit. Adding option to set cursor to end and small cleanup. First aid. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Few improvements. Performance improvements and cleanups. Minor improvements (code in order) and many bug fixes Bug fix. Combining cited code. Adding code commenting option. Renaming list_files_diffs_new to list_files_diffs Moving ProcessBar into center Increasing performance. Applying size to all icons globally. Removing another unused file. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Removing unused files. Changing size of 'close'-button. Major changes concerning design and bug fixes. Temporary save point. 2 1 Co-authored-by: opyale <example@example.com> Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/413 Reviewed-by: 6543 <6543@noreply.gitea.io> Reviewed-by: M M Arif <mmarif@swatian.com>
2020-04-28 14:39:41 +02:00
import android.widget.BaseAdapter;
2019-11-24 13:42:57 +01:00
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.fragment.app.FragmentManager;
import org.gitnex.tea4j.models.FileDiffView;
2019-11-24 13:42:57 +01:00
import org.mian.gitnex.R;
import org.mian.gitnex.fragments.BottomSheetReplyFragment;
Add Issue/Comment Reactions (#557) Minor performance improvements. Merge branch 'master' of https://codeberg.org/gitnex/GitNex into issue-reactions Improving color of selected elements. First, fully working implementation of reactions. Merge branch 'master' of https://codeberg.org/gitnex/GitNex into issue-reactions  Conflicts:  app/src/main/res/layout/bottom_sheet_issue_comments.xml  app/src/main/res/layout/list_issue_comments.xml (Hopefully) fixing merge issues. Merge branch 'master' of https://codeberg.org/gitnex/GitNex into issue-reactions  Conflicts:  app/src/main/java/org/mian/gitnex/interfaces/ApiInterface.java  app/src/main/res/layout/activity_issue_detail.xml  app/src/main/res/layout/bottom_sheet_issue_comments.xml  app/src/main/res/layout/bottom_sheet_single_issue.xml  app/src/main/res/values/colors.xml Moving reactions below time frame on comments. Merge branch 'master' into layout-reactions Add IssueReactions Merge remote-tracking branch 'origin/layout-reactions' into layout-reactions Merge branch 'master' of https://gitea.com/gitnex/GitNex into layout-reactions Merge branch 'master' into layout-reactions Applying to pulls and issues. Merge branch 'master' of https://gitea.com/gitnex/GitNex into layout-reactions Providing external layouts. Some improvements. Adding comment emote indications. Adding circle around emotes. Adding some padding. First tests. Co-authored-by: opyale <opyale@noreply.gitea.io> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: 6543 <6543@noreply.gitea.io> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/557 Reviewed-by: M M Arif <mmarif@noreply.codeberg.org>
2020-11-08 19:58:47 +01:00
import org.mian.gitnex.helpers.AppUtil;
import org.mian.gitnex.views.DiffTextView;
2019-11-24 13:42:57 +01:00
import java.util.List;
Increasing usability and design of files diff. (#413) Applying sizes. Additional changes. First changes. Merge branch 'master' into diff-cleaner Fixing formatting. Merge branch 'master' into diff-cleaner Final changes for working with custom themes. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner First changes for working with custom themes. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Adding custom COLOR_FONT. Even smaller cleanups. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Small cleanups. Fixing bug and adding maximum line limit. Adding option to set cursor to end and small cleanup. First aid. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Few improvements. Performance improvements and cleanups. Minor improvements (code in order) and many bug fixes Bug fix. Combining cited code. Adding code commenting option. Renaming list_files_diffs_new to list_files_diffs Moving ProcessBar into center Increasing performance. Applying size to all icons globally. Removing another unused file. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Removing unused files. Changing size of 'close'-button. Major changes concerning design and bug fixes. Temporary save point. 2 1 Co-authored-by: opyale <example@example.com> Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/413 Reviewed-by: 6543 <6543@noreply.gitea.io> Reviewed-by: M M Arif <mmarif@swatian.com>
2020-04-28 14:39:41 +02:00
import java.util.Map;
import java.util.concurrent.ConcurrentSkipListMap;
2019-11-24 13:42:57 +01:00
/**
Increasing usability and design of files diff. (#413) Applying sizes. Additional changes. First changes. Merge branch 'master' into diff-cleaner Fixing formatting. Merge branch 'master' into diff-cleaner Final changes for working with custom themes. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner First changes for working with custom themes. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Adding custom COLOR_FONT. Even smaller cleanups. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Small cleanups. Fixing bug and adding maximum line limit. Adding option to set cursor to end and small cleanup. First aid. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Few improvements. Performance improvements and cleanups. Minor improvements (code in order) and many bug fixes Bug fix. Combining cited code. Adding code commenting option. Renaming list_files_diffs_new to list_files_diffs Moving ProcessBar into center Increasing performance. Applying size to all icons globally. Removing another unused file. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Removing unused files. Changing size of 'close'-button. Major changes concerning design and bug fixes. Temporary save point. 2 1 Co-authored-by: opyale <example@example.com> Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/413 Reviewed-by: 6543 <6543@noreply.gitea.io> Reviewed-by: M M Arif <mmarif@swatian.com>
2020-04-28 14:39:41 +02:00
* Author opyale
2019-11-24 13:42:57 +01:00
*/
Increasing usability and design of files diff. (#413) Applying sizes. Additional changes. First changes. Merge branch 'master' into diff-cleaner Fixing formatting. Merge branch 'master' into diff-cleaner Final changes for working with custom themes. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner First changes for working with custom themes. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Adding custom COLOR_FONT. Even smaller cleanups. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Small cleanups. Fixing bug and adding maximum line limit. Adding option to set cursor to end and small cleanup. First aid. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Few improvements. Performance improvements and cleanups. Minor improvements (code in order) and many bug fixes Bug fix. Combining cited code. Adding code commenting option. Renaming list_files_diffs_new to list_files_diffs Moving ProcessBar into center Increasing performance. Applying size to all icons globally. Removing another unused file. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Removing unused files. Changing size of 'close'-button. Major changes concerning design and bug fixes. Temporary save point. 2 1 Co-authored-by: opyale <example@example.com> Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/413 Reviewed-by: 6543 <6543@noreply.gitea.io> Reviewed-by: M M Arif <mmarif@swatian.com>
2020-04-28 14:39:41 +02:00
public class FilesDiffAdapter extends BaseAdapter {
2019-11-24 13:42:57 +01:00
Increasing usability and design of files diff. (#413) Applying sizes. Additional changes. First changes. Merge branch 'master' into diff-cleaner Fixing formatting. Merge branch 'master' into diff-cleaner Final changes for working with custom themes. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner First changes for working with custom themes. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Adding custom COLOR_FONT. Even smaller cleanups. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Small cleanups. Fixing bug and adding maximum line limit. Adding option to set cursor to end and small cleanup. First aid. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Few improvements. Performance improvements and cleanups. Minor improvements (code in order) and many bug fixes Bug fix. Combining cited code. Adding code commenting option. Renaming list_files_diffs_new to list_files_diffs Moving ProcessBar into center Increasing performance. Applying size to all icons globally. Removing another unused file. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Removing unused files. Changing size of 'close'-button. Major changes concerning design and bug fixes. Temporary save point. 2 1 Co-authored-by: opyale <example@example.com> Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/413 Reviewed-by: 6543 <6543@noreply.gitea.io> Reviewed-by: M M Arif <mmarif@swatian.com>
2020-04-28 14:39:41 +02:00
private static Map<Long, View> selectedViews;
private static final int MAXIMUM_LINES = 5000;
2019-11-24 13:42:57 +01:00
Increasing usability and design of files diff. (#413) Applying sizes. Additional changes. First changes. Merge branch 'master' into diff-cleaner Fixing formatting. Merge branch 'master' into diff-cleaner Final changes for working with custom themes. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner First changes for working with custom themes. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Adding custom COLOR_FONT. Even smaller cleanups. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Small cleanups. Fixing bug and adding maximum line limit. Adding option to set cursor to end and small cleanup. First aid. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Few improvements. Performance improvements and cleanups. Minor improvements (code in order) and many bug fixes Bug fix. Combining cited code. Adding code commenting option. Renaming list_files_diffs_new to list_files_diffs Moving ProcessBar into center Increasing performance. Applying size to all icons globally. Removing another unused file. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Removing unused files. Changing size of 'close'-button. Major changes concerning design and bug fixes. Temporary save point. 2 1 Co-authored-by: opyale <example@example.com> Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/413 Reviewed-by: 6543 <6543@noreply.gitea.io> Reviewed-by: M M Arif <mmarif@swatian.com>
2020-04-28 14:39:41 +02:00
private static int COLOR_ADDED;
private static int COLOR_REMOVED;
private static int COLOR_NORMAL;
private static int COLOR_SELECTED;
private static int COLOR_FONT;
2019-11-24 13:42:57 +01:00
private final Context context;
private final FragmentManager fragmentManager;
private final List<FileDiffView> fileDiffViews;
2019-11-24 13:42:57 +01:00
public FilesDiffAdapter(Context context, FragmentManager fragmentManager, List<FileDiffView> fileDiffViews) {
2019-11-24 13:42:57 +01:00
Increasing usability and design of files diff. (#413) Applying sizes. Additional changes. First changes. Merge branch 'master' into diff-cleaner Fixing formatting. Merge branch 'master' into diff-cleaner Final changes for working with custom themes. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner First changes for working with custom themes. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Adding custom COLOR_FONT. Even smaller cleanups. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Small cleanups. Fixing bug and adding maximum line limit. Adding option to set cursor to end and small cleanup. First aid. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Few improvements. Performance improvements and cleanups. Minor improvements (code in order) and many bug fixes Bug fix. Combining cited code. Adding code commenting option. Renaming list_files_diffs_new to list_files_diffs Moving ProcessBar into center Increasing performance. Applying size to all icons globally. Removing another unused file. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Removing unused files. Changing size of 'close'-button. Major changes concerning design and bug fixes. Temporary save point. 2 1 Co-authored-by: opyale <example@example.com> Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/413 Reviewed-by: 6543 <6543@noreply.gitea.io> Reviewed-by: M M Arif <mmarif@swatian.com>
2020-04-28 14:39:41 +02:00
this.context = context;
this.fragmentManager = fragmentManager;
Increasing usability and design of files diff. (#413) Applying sizes. Additional changes. First changes. Merge branch 'master' into diff-cleaner Fixing formatting. Merge branch 'master' into diff-cleaner Final changes for working with custom themes. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner First changes for working with custom themes. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Adding custom COLOR_FONT. Even smaller cleanups. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Small cleanups. Fixing bug and adding maximum line limit. Adding option to set cursor to end and small cleanup. First aid. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Few improvements. Performance improvements and cleanups. Minor improvements (code in order) and many bug fixes Bug fix. Combining cited code. Adding code commenting option. Renaming list_files_diffs_new to list_files_diffs Moving ProcessBar into center Increasing performance. Applying size to all icons globally. Removing another unused file. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Removing unused files. Changing size of 'close'-button. Major changes concerning design and bug fixes. Temporary save point. 2 1 Co-authored-by: opyale <example@example.com> Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/413 Reviewed-by: 6543 <6543@noreply.gitea.io> Reviewed-by: M M Arif <mmarif@swatian.com>
2020-04-28 14:39:41 +02:00
this.fileDiffViews = fileDiffViews;
2019-11-24 13:42:57 +01:00
Increasing usability and design of files diff. (#413) Applying sizes. Additional changes. First changes. Merge branch 'master' into diff-cleaner Fixing formatting. Merge branch 'master' into diff-cleaner Final changes for working with custom themes. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner First changes for working with custom themes. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Adding custom COLOR_FONT. Even smaller cleanups. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Small cleanups. Fixing bug and adding maximum line limit. Adding option to set cursor to end and small cleanup. First aid. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Few improvements. Performance improvements and cleanups. Minor improvements (code in order) and many bug fixes Bug fix. Combining cited code. Adding code commenting option. Renaming list_files_diffs_new to list_files_diffs Moving ProcessBar into center Increasing performance. Applying size to all icons globally. Removing another unused file. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Removing unused files. Changing size of 'close'-button. Major changes concerning design and bug fixes. Temporary save point. 2 1 Co-authored-by: opyale <example@example.com> Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/413 Reviewed-by: 6543 <6543@noreply.gitea.io> Reviewed-by: M M Arif <mmarif@swatian.com>
2020-04-28 14:39:41 +02:00
selectedViews = new ConcurrentSkipListMap<>();
2019-11-24 13:42:57 +01:00
Add Issue/Comment Reactions (#557) Minor performance improvements. Merge branch 'master' of https://codeberg.org/gitnex/GitNex into issue-reactions Improving color of selected elements. First, fully working implementation of reactions. Merge branch 'master' of https://codeberg.org/gitnex/GitNex into issue-reactions  Conflicts:  app/src/main/res/layout/bottom_sheet_issue_comments.xml  app/src/main/res/layout/list_issue_comments.xml (Hopefully) fixing merge issues. Merge branch 'master' of https://codeberg.org/gitnex/GitNex into issue-reactions  Conflicts:  app/src/main/java/org/mian/gitnex/interfaces/ApiInterface.java  app/src/main/res/layout/activity_issue_detail.xml  app/src/main/res/layout/bottom_sheet_issue_comments.xml  app/src/main/res/layout/bottom_sheet_single_issue.xml  app/src/main/res/values/colors.xml Moving reactions below time frame on comments. Merge branch 'master' into layout-reactions Add IssueReactions Merge remote-tracking branch 'origin/layout-reactions' into layout-reactions Merge branch 'master' of https://gitea.com/gitnex/GitNex into layout-reactions Merge branch 'master' into layout-reactions Applying to pulls and issues. Merge branch 'master' of https://gitea.com/gitnex/GitNex into layout-reactions Providing external layouts. Some improvements. Adding comment emote indications. Adding circle around emotes. Adding some padding. First tests. Co-authored-by: opyale <opyale@noreply.gitea.io> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: 6543 <6543@noreply.gitea.io> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/557 Reviewed-by: M M Arif <mmarif@noreply.codeberg.org>
2020-11-08 19:58:47 +01:00
COLOR_ADDED = AppUtil.getColorFromAttribute(context, R.attr.diffAddedColor);
COLOR_REMOVED = AppUtil.getColorFromAttribute(context, R.attr.diffRemovedColor);
COLOR_NORMAL = AppUtil.getColorFromAttribute(context, R.attr.primaryBackgroundColor);
COLOR_SELECTED = AppUtil.getColorFromAttribute(context, R.attr.diffSelectedColor);
COLOR_FONT = AppUtil.getColorFromAttribute(context, R.attr.inputTextColor);
2019-11-24 13:42:57 +01:00
Increasing usability and design of files diff. (#413) Applying sizes. Additional changes. First changes. Merge branch 'master' into diff-cleaner Fixing formatting. Merge branch 'master' into diff-cleaner Final changes for working with custom themes. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner First changes for working with custom themes. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Adding custom COLOR_FONT. Even smaller cleanups. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Small cleanups. Fixing bug and adding maximum line limit. Adding option to set cursor to end and small cleanup. First aid. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Few improvements. Performance improvements and cleanups. Minor improvements (code in order) and many bug fixes Bug fix. Combining cited code. Adding code commenting option. Renaming list_files_diffs_new to list_files_diffs Moving ProcessBar into center Increasing performance. Applying size to all icons globally. Removing another unused file. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Removing unused files. Changing size of 'close'-button. Major changes concerning design and bug fixes. Temporary save point. 2 1 Co-authored-by: opyale <example@example.com> Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/413 Reviewed-by: 6543 <6543@noreply.gitea.io> Reviewed-by: M M Arif <mmarif@swatian.com>
2020-04-28 14:39:41 +02:00
}
2019-11-24 13:42:57 +01:00
Increasing usability and design of files diff. (#413) Applying sizes. Additional changes. First changes. Merge branch 'master' into diff-cleaner Fixing formatting. Merge branch 'master' into diff-cleaner Final changes for working with custom themes. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner First changes for working with custom themes. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Adding custom COLOR_FONT. Even smaller cleanups. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Small cleanups. Fixing bug and adding maximum line limit. Adding option to set cursor to end and small cleanup. First aid. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Few improvements. Performance improvements and cleanups. Minor improvements (code in order) and many bug fixes Bug fix. Combining cited code. Adding code commenting option. Renaming list_files_diffs_new to list_files_diffs Moving ProcessBar into center Increasing performance. Applying size to all icons globally. Removing another unused file. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Removing unused files. Changing size of 'close'-button. Major changes concerning design and bug fixes. Temporary save point. 2 1 Co-authored-by: opyale <example@example.com> Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/413 Reviewed-by: 6543 <6543@noreply.gitea.io> Reviewed-by: M M Arif <mmarif@swatian.com>
2020-04-28 14:39:41 +02:00
@Override
public int getCount() {
2019-11-24 13:42:57 +01:00
Increasing usability and design of files diff. (#413) Applying sizes. Additional changes. First changes. Merge branch 'master' into diff-cleaner Fixing formatting. Merge branch 'master' into diff-cleaner Final changes for working with custom themes. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner First changes for working with custom themes. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Adding custom COLOR_FONT. Even smaller cleanups. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Small cleanups. Fixing bug and adding maximum line limit. Adding option to set cursor to end and small cleanup. First aid. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Few improvements. Performance improvements and cleanups. Minor improvements (code in order) and many bug fixes Bug fix. Combining cited code. Adding code commenting option. Renaming list_files_diffs_new to list_files_diffs Moving ProcessBar into center Increasing performance. Applying size to all icons globally. Removing another unused file. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Removing unused files. Changing size of 'close'-button. Major changes concerning design and bug fixes. Temporary save point. 2 1 Co-authored-by: opyale <example@example.com> Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/413 Reviewed-by: 6543 <6543@noreply.gitea.io> Reviewed-by: M M Arif <mmarif@swatian.com>
2020-04-28 14:39:41 +02:00
return fileDiffViews.size();
}
2019-11-24 13:42:57 +01:00
Increasing usability and design of files diff. (#413) Applying sizes. Additional changes. First changes. Merge branch 'master' into diff-cleaner Fixing formatting. Merge branch 'master' into diff-cleaner Final changes for working with custom themes. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner First changes for working with custom themes. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Adding custom COLOR_FONT. Even smaller cleanups. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Small cleanups. Fixing bug and adding maximum line limit. Adding option to set cursor to end and small cleanup. First aid. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Few improvements. Performance improvements and cleanups. Minor improvements (code in order) and many bug fixes Bug fix. Combining cited code. Adding code commenting option. Renaming list_files_diffs_new to list_files_diffs Moving ProcessBar into center Increasing performance. Applying size to all icons globally. Removing another unused file. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Removing unused files. Changing size of 'close'-button. Major changes concerning design and bug fixes. Temporary save point. 2 1 Co-authored-by: opyale <example@example.com> Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/413 Reviewed-by: 6543 <6543@noreply.gitea.io> Reviewed-by: M M Arif <mmarif@swatian.com>
2020-04-28 14:39:41 +02:00
@Override
public Object getItem(int position) {
2019-11-24 13:42:57 +01:00
Increasing usability and design of files diff. (#413) Applying sizes. Additional changes. First changes. Merge branch 'master' into diff-cleaner Fixing formatting. Merge branch 'master' into diff-cleaner Final changes for working with custom themes. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner First changes for working with custom themes. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Adding custom COLOR_FONT. Even smaller cleanups. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Small cleanups. Fixing bug and adding maximum line limit. Adding option to set cursor to end and small cleanup. First aid. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Few improvements. Performance improvements and cleanups. Minor improvements (code in order) and many bug fixes Bug fix. Combining cited code. Adding code commenting option. Renaming list_files_diffs_new to list_files_diffs Moving ProcessBar into center Increasing performance. Applying size to all icons globally. Removing another unused file. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Removing unused files. Changing size of 'close'-button. Major changes concerning design and bug fixes. Temporary save point. 2 1 Co-authored-by: opyale <example@example.com> Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/413 Reviewed-by: 6543 <6543@noreply.gitea.io> Reviewed-by: M M Arif <mmarif@swatian.com>
2020-04-28 14:39:41 +02:00
return fileDiffViews.get(position);
}
2019-11-24 13:42:57 +01:00
Increasing usability and design of files diff. (#413) Applying sizes. Additional changes. First changes. Merge branch 'master' into diff-cleaner Fixing formatting. Merge branch 'master' into diff-cleaner Final changes for working with custom themes. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner First changes for working with custom themes. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Adding custom COLOR_FONT. Even smaller cleanups. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Small cleanups. Fixing bug and adding maximum line limit. Adding option to set cursor to end and small cleanup. First aid. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Few improvements. Performance improvements and cleanups. Minor improvements (code in order) and many bug fixes Bug fix. Combining cited code. Adding code commenting option. Renaming list_files_diffs_new to list_files_diffs Moving ProcessBar into center Increasing performance. Applying size to all icons globally. Removing another unused file. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Removing unused files. Changing size of 'close'-button. Major changes concerning design and bug fixes. Temporary save point. 2 1 Co-authored-by: opyale <example@example.com> Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/413 Reviewed-by: 6543 <6543@noreply.gitea.io> Reviewed-by: M M Arif <mmarif@swatian.com>
2020-04-28 14:39:41 +02:00
@Override
public long getItemId(int position) {
2019-11-24 13:42:57 +01:00
Increasing usability and design of files diff. (#413) Applying sizes. Additional changes. First changes. Merge branch 'master' into diff-cleaner Fixing formatting. Merge branch 'master' into diff-cleaner Final changes for working with custom themes. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner First changes for working with custom themes. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Adding custom COLOR_FONT. Even smaller cleanups. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Small cleanups. Fixing bug and adding maximum line limit. Adding option to set cursor to end and small cleanup. First aid. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Few improvements. Performance improvements and cleanups. Minor improvements (code in order) and many bug fixes Bug fix. Combining cited code. Adding code commenting option. Renaming list_files_diffs_new to list_files_diffs Moving ProcessBar into center Increasing performance. Applying size to all icons globally. Removing another unused file. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Removing unused files. Changing size of 'close'-button. Major changes concerning design and bug fixes. Temporary save point. 2 1 Co-authored-by: opyale <example@example.com> Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/413 Reviewed-by: 6543 <6543@noreply.gitea.io> Reviewed-by: M M Arif <mmarif@swatian.com>
2020-04-28 14:39:41 +02:00
return position;
}
2019-11-24 13:42:57 +01:00
Increasing usability and design of files diff. (#413) Applying sizes. Additional changes. First changes. Merge branch 'master' into diff-cleaner Fixing formatting. Merge branch 'master' into diff-cleaner Final changes for working with custom themes. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner First changes for working with custom themes. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Adding custom COLOR_FONT. Even smaller cleanups. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Small cleanups. Fixing bug and adding maximum line limit. Adding option to set cursor to end and small cleanup. First aid. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Few improvements. Performance improvements and cleanups. Minor improvements (code in order) and many bug fixes Bug fix. Combining cited code. Adding code commenting option. Renaming list_files_diffs_new to list_files_diffs Moving ProcessBar into center Increasing performance. Applying size to all icons globally. Removing another unused file. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Removing unused files. Changing size of 'close'-button. Major changes concerning design and bug fixes. Temporary save point. 2 1 Co-authored-by: opyale <example@example.com> Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/413 Reviewed-by: 6543 <6543@noreply.gitea.io> Reviewed-by: M M Arif <mmarif@swatian.com>
2020-04-28 14:39:41 +02:00
@SuppressLint({"ViewHolder", "InflateParams"})
@Override
public View getView(int position, View convertView, ViewGroup parent) {
2019-11-24 13:42:57 +01:00
Increasing usability and design of files diff. (#413) Applying sizes. Additional changes. First changes. Merge branch 'master' into diff-cleaner Fixing formatting. Merge branch 'master' into diff-cleaner Final changes for working with custom themes. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner First changes for working with custom themes. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Adding custom COLOR_FONT. Even smaller cleanups. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Small cleanups. Fixing bug and adding maximum line limit. Adding option to set cursor to end and small cleanup. First aid. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Few improvements. Performance improvements and cleanups. Minor improvements (code in order) and many bug fixes Bug fix. Combining cited code. Adding code commenting option. Renaming list_files_diffs_new to list_files_diffs Moving ProcessBar into center Increasing performance. Applying size to all icons globally. Removing another unused file. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Removing unused files. Changing size of 'close'-button. Major changes concerning design and bug fixes. Temporary save point. 2 1 Co-authored-by: opyale <example@example.com> Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/413 Reviewed-by: 6543 <6543@noreply.gitea.io> Reviewed-by: M M Arif <mmarif@swatian.com>
2020-04-28 14:39:41 +02:00
convertView = LayoutInflater.from(context).inflate(R.layout.list_files_diffs, null, false);
2019-11-24 13:42:57 +01:00
Increasing usability and design of files diff. (#413) Applying sizes. Additional changes. First changes. Merge branch 'master' into diff-cleaner Fixing formatting. Merge branch 'master' into diff-cleaner Final changes for working with custom themes. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner First changes for working with custom themes. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Adding custom COLOR_FONT. Even smaller cleanups. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Small cleanups. Fixing bug and adding maximum line limit. Adding option to set cursor to end and small cleanup. First aid. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Few improvements. Performance improvements and cleanups. Minor improvements (code in order) and many bug fixes Bug fix. Combining cited code. Adding code commenting option. Renaming list_files_diffs_new to list_files_diffs Moving ProcessBar into center Increasing performance. Applying size to all icons globally. Removing another unused file. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Removing unused files. Changing size of 'close'-button. Major changes concerning design and bug fixes. Temporary save point. 2 1 Co-authored-by: opyale <example@example.com> Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/413 Reviewed-by: 6543 <6543@noreply.gitea.io> Reviewed-by: M M Arif <mmarif@swatian.com>
2020-04-28 14:39:41 +02:00
TextView headerFileName = convertView.findViewById(R.id.headerFileName);
TextView headerFileInfo = convertView.findViewById(R.id.headerFileInfo);
ImageView footerImage = convertView.findViewById(R.id.footerImage);
LinearLayout diffStats = convertView.findViewById(R.id.diff_stats);
LinearLayout diffLines = convertView.findViewById(R.id.diffLines);
2019-11-24 13:42:57 +01:00
Increasing usability and design of files diff. (#413) Applying sizes. Additional changes. First changes. Merge branch 'master' into diff-cleaner Fixing formatting. Merge branch 'master' into diff-cleaner Final changes for working with custom themes. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner First changes for working with custom themes. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Adding custom COLOR_FONT. Even smaller cleanups. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Small cleanups. Fixing bug and adding maximum line limit. Adding option to set cursor to end and small cleanup. First aid. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Few improvements. Performance improvements and cleanups. Minor improvements (code in order) and many bug fixes Bug fix. Combining cited code. Adding code commenting option. Renaming list_files_diffs_new to list_files_diffs Moving ProcessBar into center Increasing performance. Applying size to all icons globally. Removing another unused file. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Removing unused files. Changing size of 'close'-button. Major changes concerning design and bug fixes. Temporary save point. 2 1 Co-authored-by: opyale <example@example.com> Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/413 Reviewed-by: 6543 <6543@noreply.gitea.io> Reviewed-by: M M Arif <mmarif@swatian.com>
2020-04-28 14:39:41 +02:00
FileDiffView data = (FileDiffView) getItem(position);
headerFileName.setText(data.getFileName());
2019-11-24 13:42:57 +01:00
if(data.isFileBinary()) {
2019-11-24 13:42:57 +01:00
Increasing usability and design of files diff. (#413) Applying sizes. Additional changes. First changes. Merge branch 'master' into diff-cleaner Fixing formatting. Merge branch 'master' into diff-cleaner Final changes for working with custom themes. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner First changes for working with custom themes. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Adding custom COLOR_FONT. Even smaller cleanups. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Small cleanups. Fixing bug and adding maximum line limit. Adding option to set cursor to end and small cleanup. First aid. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Few improvements. Performance improvements and cleanups. Minor improvements (code in order) and many bug fixes Bug fix. Combining cited code. Adding code commenting option. Renaming list_files_diffs_new to list_files_diffs Moving ProcessBar into center Increasing performance. Applying size to all icons globally. Removing another unused file. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Removing unused files. Changing size of 'close'-button. Major changes concerning design and bug fixes. Temporary save point. 2 1 Co-authored-by: opyale <example@example.com> Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/413 Reviewed-by: 6543 <6543@noreply.gitea.io> Reviewed-by: M M Arif <mmarif@swatian.com>
2020-04-28 14:39:41 +02:00
diffStats.setVisibility(View.GONE);
diffLines.addView(getMessageView(context.getResources().getString(R.string.binaryFileError)));
2019-11-24 13:42:57 +01:00
Increasing usability and design of files diff. (#413) Applying sizes. Additional changes. First changes. Merge branch 'master' into diff-cleaner Fixing formatting. Merge branch 'master' into diff-cleaner Final changes for working with custom themes. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner First changes for working with custom themes. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Adding custom COLOR_FONT. Even smaller cleanups. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Small cleanups. Fixing bug and adding maximum line limit. Adding option to set cursor to end and small cleanup. First aid. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Few improvements. Performance improvements and cleanups. Minor improvements (code in order) and many bug fixes Bug fix. Combining cited code. Adding code commenting option. Renaming list_files_diffs_new to list_files_diffs Moving ProcessBar into center Increasing performance. Applying size to all icons globally. Removing another unused file. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Removing unused files. Changing size of 'close'-button. Major changes concerning design and bug fixes. Temporary save point. 2 1 Co-authored-by: opyale <example@example.com> Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/413 Reviewed-by: 6543 <6543@noreply.gitea.io> Reviewed-by: M M Arif <mmarif@swatian.com>
2020-04-28 14:39:41 +02:00
}
else {
2019-11-24 13:42:57 +01:00
Increasing usability and design of files diff. (#413) Applying sizes. Additional changes. First changes. Merge branch 'master' into diff-cleaner Fixing formatting. Merge branch 'master' into diff-cleaner Final changes for working with custom themes. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner First changes for working with custom themes. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Adding custom COLOR_FONT. Even smaller cleanups. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Small cleanups. Fixing bug and adding maximum line limit. Adding option to set cursor to end and small cleanup. First aid. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Few improvements. Performance improvements and cleanups. Minor improvements (code in order) and many bug fixes Bug fix. Combining cited code. Adding code commenting option. Renaming list_files_diffs_new to list_files_diffs Moving ProcessBar into center Increasing performance. Applying size to all icons globally. Removing another unused file. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Removing unused files. Changing size of 'close'-button. Major changes concerning design and bug fixes. Temporary save point. 2 1 Co-authored-by: opyale <example@example.com> Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/413 Reviewed-by: 6543 <6543@noreply.gitea.io> Reviewed-by: M M Arif <mmarif@swatian.com>
2020-04-28 14:39:41 +02:00
diffStats.setVisibility(View.VISIBLE);
headerFileInfo.setText(data.getFileInfo());
2019-11-24 13:42:57 +01:00
String[] codeLines = getLines(data.toString());
2019-11-24 13:42:57 +01:00
Increasing usability and design of files diff. (#413) Applying sizes. Additional changes. First changes. Merge branch 'master' into diff-cleaner Fixing formatting. Merge branch 'master' into diff-cleaner Final changes for working with custom themes. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner First changes for working with custom themes. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Adding custom COLOR_FONT. Even smaller cleanups. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Small cleanups. Fixing bug and adding maximum line limit. Adding option to set cursor to end and small cleanup. First aid. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Few improvements. Performance improvements and cleanups. Minor improvements (code in order) and many bug fixes Bug fix. Combining cited code. Adding code commenting option. Renaming list_files_diffs_new to list_files_diffs Moving ProcessBar into center Increasing performance. Applying size to all icons globally. Removing another unused file. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Removing unused files. Changing size of 'close'-button. Major changes concerning design and bug fixes. Temporary save point. 2 1 Co-authored-by: opyale <example@example.com> Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/413 Reviewed-by: 6543 <6543@noreply.gitea.io> Reviewed-by: M M Arif <mmarif@swatian.com>
2020-04-28 14:39:41 +02:00
if(MAXIMUM_LINES > codeLines.length) {
2019-11-24 13:42:57 +01:00
Increasing usability and design of files diff. (#413) Applying sizes. Additional changes. First changes. Merge branch 'master' into diff-cleaner Fixing formatting. Merge branch 'master' into diff-cleaner Final changes for working with custom themes. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner First changes for working with custom themes. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Adding custom COLOR_FONT. Even smaller cleanups. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Small cleanups. Fixing bug and adding maximum line limit. Adding option to set cursor to end and small cleanup. First aid. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Few improvements. Performance improvements and cleanups. Minor improvements (code in order) and many bug fixes Bug fix. Combining cited code. Adding code commenting option. Renaming list_files_diffs_new to list_files_diffs Moving ProcessBar into center Increasing performance. Applying size to all icons globally. Removing another unused file. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Removing unused files. Changing size of 'close'-button. Major changes concerning design and bug fixes. Temporary save point. 2 1 Co-authored-by: opyale <example@example.com> Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/413 Reviewed-by: 6543 <6543@noreply.gitea.io> Reviewed-by: M M Arif <mmarif@swatian.com>
2020-04-28 14:39:41 +02:00
for(int l=0; l<codeLines.length; l++) {
2019-11-24 13:42:57 +01:00
Increasing usability and design of files diff. (#413) Applying sizes. Additional changes. First changes. Merge branch 'master' into diff-cleaner Fixing formatting. Merge branch 'master' into diff-cleaner Final changes for working with custom themes. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner First changes for working with custom themes. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Adding custom COLOR_FONT. Even smaller cleanups. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Small cleanups. Fixing bug and adding maximum line limit. Adding option to set cursor to end and small cleanup. First aid. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Few improvements. Performance improvements and cleanups. Minor improvements (code in order) and many bug fixes Bug fix. Combining cited code. Adding code commenting option. Renaming list_files_diffs_new to list_files_diffs Moving ProcessBar into center Increasing performance. Applying size to all icons globally. Removing another unused file. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Removing unused files. Changing size of 'close'-button. Major changes concerning design and bug fixes. Temporary save point. 2 1 Co-authored-by: opyale <example@example.com> Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/413 Reviewed-by: 6543 <6543@noreply.gitea.io> Reviewed-by: M M Arif <mmarif@swatian.com>
2020-04-28 14:39:41 +02:00
if(codeLines[l].length() > 0) {
2019-11-24 13:42:57 +01:00
Increasing usability and design of files diff. (#413) Applying sizes. Additional changes. First changes. Merge branch 'master' into diff-cleaner Fixing formatting. Merge branch 'master' into diff-cleaner Final changes for working with custom themes. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner First changes for working with custom themes. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Adding custom COLOR_FONT. Even smaller cleanups. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Small cleanups. Fixing bug and adding maximum line limit. Adding option to set cursor to end and small cleanup. First aid. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Few improvements. Performance improvements and cleanups. Minor improvements (code in order) and many bug fixes Bug fix. Combining cited code. Adding code commenting option. Renaming list_files_diffs_new to list_files_diffs Moving ProcessBar into center Increasing performance. Applying size to all icons globally. Removing another unused file. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Removing unused files. Changing size of 'close'-button. Major changes concerning design and bug fixes. Temporary save point. 2 1 Co-authored-by: opyale <example@example.com> Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/413 Reviewed-by: 6543 <6543@noreply.gitea.io> Reviewed-by: M M Arif <mmarif@swatian.com>
2020-04-28 14:39:41 +02:00
int uniquePosition = l + (position * MAXIMUM_LINES);
2019-11-24 13:42:57 +01:00
Increasing usability and design of files diff. (#413) Applying sizes. Additional changes. First changes. Merge branch 'master' into diff-cleaner Fixing formatting. Merge branch 'master' into diff-cleaner Final changes for working with custom themes. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner First changes for working with custom themes. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Adding custom COLOR_FONT. Even smaller cleanups. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Small cleanups. Fixing bug and adding maximum line limit. Adding option to set cursor to end and small cleanup. First aid. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Few improvements. Performance improvements and cleanups. Minor improvements (code in order) and many bug fixes Bug fix. Combining cited code. Adding code commenting option. Renaming list_files_diffs_new to list_files_diffs Moving ProcessBar into center Increasing performance. Applying size to all icons globally. Removing another unused file. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Removing unused files. Changing size of 'close'-button. Major changes concerning design and bug fixes. Temporary save point. 2 1 Co-authored-by: opyale <example@example.com> Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/413 Reviewed-by: 6543 <6543@noreply.gitea.io> Reviewed-by: M M Arif <mmarif@swatian.com>
2020-04-28 14:39:41 +02:00
DiffTextView diffTextView = new DiffTextView(context);
2019-11-24 13:42:57 +01:00
Increasing usability and design of files diff. (#413) Applying sizes. Additional changes. First changes. Merge branch 'master' into diff-cleaner Fixing formatting. Merge branch 'master' into diff-cleaner Final changes for working with custom themes. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner First changes for working with custom themes. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Adding custom COLOR_FONT. Even smaller cleanups. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Small cleanups. Fixing bug and adding maximum line limit. Adding option to set cursor to end and small cleanup. First aid. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Few improvements. Performance improvements and cleanups. Minor improvements (code in order) and many bug fixes Bug fix. Combining cited code. Adding code commenting option. Renaming list_files_diffs_new to list_files_diffs Moving ProcessBar into center Increasing performance. Applying size to all icons globally. Removing another unused file. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Removing unused files. Changing size of 'close'-button. Major changes concerning design and bug fixes. Temporary save point. 2 1 Co-authored-by: opyale <example@example.com> Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/413 Reviewed-by: 6543 <6543@noreply.gitea.io> Reviewed-by: M M Arif <mmarif@swatian.com>
2020-04-28 14:39:41 +02:00
diffTextView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 15);
diffTextView.setPadding(15, 2, 15, 2);
diffTextView.setTypeface(Typeface.createFromAsset(context.getAssets(), "fonts/sourcecodeproregular.ttf"));
diffTextView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
diffTextView.setPosition(uniquePosition);
2019-11-24 13:42:57 +01:00
Increasing usability and design of files diff. (#413) Applying sizes. Additional changes. First changes. Merge branch 'master' into diff-cleaner Fixing formatting. Merge branch 'master' into diff-cleaner Final changes for working with custom themes. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner First changes for working with custom themes. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Adding custom COLOR_FONT. Even smaller cleanups. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Small cleanups. Fixing bug and adding maximum line limit. Adding option to set cursor to end and small cleanup. First aid. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Few improvements. Performance improvements and cleanups. Minor improvements (code in order) and many bug fixes Bug fix. Combining cited code. Adding code commenting option. Renaming list_files_diffs_new to list_files_diffs Moving ProcessBar into center Increasing performance. Applying size to all icons globally. Removing another unused file. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Removing unused files. Changing size of 'close'-button. Major changes concerning design and bug fixes. Temporary save point. 2 1 Co-authored-by: opyale <example@example.com> Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/413 Reviewed-by: 6543 <6543@noreply.gitea.io> Reviewed-by: M M Arif <mmarif@swatian.com>
2020-04-28 14:39:41 +02:00
boolean isSelected = false;
2019-11-24 13:42:57 +01:00
Increasing usability and design of files diff. (#413) Applying sizes. Additional changes. First changes. Merge branch 'master' into diff-cleaner Fixing formatting. Merge branch 'master' into diff-cleaner Final changes for working with custom themes. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner First changes for working with custom themes. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Adding custom COLOR_FONT. Even smaller cleanups. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Small cleanups. Fixing bug and adding maximum line limit. Adding option to set cursor to end and small cleanup. First aid. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Few improvements. Performance improvements and cleanups. Minor improvements (code in order) and many bug fixes Bug fix. Combining cited code. Adding code commenting option. Renaming list_files_diffs_new to list_files_diffs Moving ProcessBar into center Increasing performance. Applying size to all icons globally. Removing another unused file. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Removing unused files. Changing size of 'close'-button. Major changes concerning design and bug fixes. Temporary save point. 2 1 Co-authored-by: opyale <example@example.com> Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/413 Reviewed-by: 6543 <6543@noreply.gitea.io> Reviewed-by: M M Arif <mmarif@swatian.com>
2020-04-28 14:39:41 +02:00
for(View view : selectedViews.values()) {
2019-11-24 13:42:57 +01:00
Increasing usability and design of files diff. (#413) Applying sizes. Additional changes. First changes. Merge branch 'master' into diff-cleaner Fixing formatting. Merge branch 'master' into diff-cleaner Final changes for working with custom themes. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner First changes for working with custom themes. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Adding custom COLOR_FONT. Even smaller cleanups. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Small cleanups. Fixing bug and adding maximum line limit. Adding option to set cursor to end and small cleanup. First aid. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Few improvements. Performance improvements and cleanups. Minor improvements (code in order) and many bug fixes Bug fix. Combining cited code. Adding code commenting option. Renaming list_files_diffs_new to list_files_diffs Moving ProcessBar into center Increasing performance. Applying size to all icons globally. Removing another unused file. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Removing unused files. Changing size of 'close'-button. Major changes concerning design and bug fixes. Temporary save point. 2 1 Co-authored-by: opyale <example@example.com> Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/413 Reviewed-by: 6543 <6543@noreply.gitea.io> Reviewed-by: M M Arif <mmarif@swatian.com>
2020-04-28 14:39:41 +02:00
if(((DiffTextView) view).getPosition() == uniquePosition) {
2019-11-24 13:42:57 +01:00
Increasing usability and design of files diff. (#413) Applying sizes. Additional changes. First changes. Merge branch 'master' into diff-cleaner Fixing formatting. Merge branch 'master' into diff-cleaner Final changes for working with custom themes. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner First changes for working with custom themes. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Adding custom COLOR_FONT. Even smaller cleanups. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Small cleanups. Fixing bug and adding maximum line limit. Adding option to set cursor to end and small cleanup. First aid. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Few improvements. Performance improvements and cleanups. Minor improvements (code in order) and many bug fixes Bug fix. Combining cited code. Adding code commenting option. Renaming list_files_diffs_new to list_files_diffs Moving ProcessBar into center Increasing performance. Applying size to all icons globally. Removing another unused file. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Removing unused files. Changing size of 'close'-button. Major changes concerning design and bug fixes. Temporary save point. 2 1 Co-authored-by: opyale <example@example.com> Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/413 Reviewed-by: 6543 <6543@noreply.gitea.io> Reviewed-by: M M Arif <mmarif@swatian.com>
2020-04-28 14:39:41 +02:00
diffTextView.setBackgroundColor(COLOR_SELECTED);
isSelected = true;
break;
2019-11-24 13:42:57 +01:00
Increasing usability and design of files diff. (#413) Applying sizes. Additional changes. First changes. Merge branch 'master' into diff-cleaner Fixing formatting. Merge branch 'master' into diff-cleaner Final changes for working with custom themes. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner First changes for working with custom themes. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Adding custom COLOR_FONT. Even smaller cleanups. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Small cleanups. Fixing bug and adding maximum line limit. Adding option to set cursor to end and small cleanup. First aid. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Few improvements. Performance improvements and cleanups. Minor improvements (code in order) and many bug fixes Bug fix. Combining cited code. Adding code commenting option. Renaming list_files_diffs_new to list_files_diffs Moving ProcessBar into center Increasing performance. Applying size to all icons globally. Removing another unused file. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Removing unused files. Changing size of 'close'-button. Major changes concerning design and bug fixes. Temporary save point. 2 1 Co-authored-by: opyale <example@example.com> Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/413 Reviewed-by: 6543 <6543@noreply.gitea.io> Reviewed-by: M M Arif <mmarif@swatian.com>
2020-04-28 14:39:41 +02:00
}
}
if(codeLines[l].startsWith("+")) {
diffTextView.setText(codeLines[l]);
diffTextView.setTextColor(COLOR_FONT);
if(!isSelected) {
diffTextView.setInitialBackgroundColor(COLOR_ADDED);
}
}
else if(codeLines[l].startsWith("-")) {
diffTextView.setText(codeLines[l]);
diffTextView.setTextColor(COLOR_FONT);
if(!isSelected) {
diffTextView.setInitialBackgroundColor(COLOR_REMOVED);
}
}
else {
diffTextView.setText(codeLines[l]);
diffTextView.setTextColor(COLOR_FONT);
if(!isSelected) {
diffTextView.setInitialBackgroundColor(COLOR_NORMAL);
}
}
diffTextView.setOnClickListener(v -> {
if(((DiffTextView) v).getCurrentBackgroundColor() != COLOR_SELECTED) {
selectedViews.put(((DiffTextView) v).getPosition(), v);
v.setBackgroundColor(COLOR_SELECTED);
}
else {
selectedViews.remove(((DiffTextView) v).getPosition());
v.setBackgroundColor(((DiffTextView) v).getInitialBackgroundColor());
}
});
diffTextView.setOnLongClickListener(v -> {
if(((DiffTextView) v).getCurrentBackgroundColor() == COLOR_SELECTED) {
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("```\n");
for(View view : selectedViews.values()) {
stringBuilder.append(((DiffTextView) view).getText());
stringBuilder.append("\n");
}
stringBuilder.append("```\n\n");
selectedViews.clear();
Bundle bundle = new Bundle();
bundle.putString("commentBody", stringBuilder.toString());
bundle.putBoolean("cursorToEnd", true);
Increasing usability and design of files diff. (#413) Applying sizes. Additional changes. First changes. Merge branch 'master' into diff-cleaner Fixing formatting. Merge branch 'master' into diff-cleaner Final changes for working with custom themes. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner First changes for working with custom themes. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Adding custom COLOR_FONT. Even smaller cleanups. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Small cleanups. Fixing bug and adding maximum line limit. Adding option to set cursor to end and small cleanup. First aid. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Few improvements. Performance improvements and cleanups. Minor improvements (code in order) and many bug fixes Bug fix. Combining cited code. Adding code commenting option. Renaming list_files_diffs_new to list_files_diffs Moving ProcessBar into center Increasing performance. Applying size to all icons globally. Removing another unused file. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Removing unused files. Changing size of 'close'-button. Major changes concerning design and bug fixes. Temporary save point. 2 1 Co-authored-by: opyale <example@example.com> Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/413 Reviewed-by: 6543 <6543@noreply.gitea.io> Reviewed-by: M M Arif <mmarif@swatian.com>
2020-04-28 14:39:41 +02:00
BottomSheetReplyFragment.newInstance(bundle).show(fragmentManager, "replyBottomSheet");
Increasing usability and design of files diff. (#413) Applying sizes. Additional changes. First changes. Merge branch 'master' into diff-cleaner Fixing formatting. Merge branch 'master' into diff-cleaner Final changes for working with custom themes. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner First changes for working with custom themes. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Adding custom COLOR_FONT. Even smaller cleanups. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Small cleanups. Fixing bug and adding maximum line limit. Adding option to set cursor to end and small cleanup. First aid. Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Merge branch 'master' into diff-cleaner Few improvements. Performance improvements and cleanups. Minor improvements (code in order) and many bug fixes Bug fix. Combining cited code. Adding code commenting option. Renaming list_files_diffs_new to list_files_diffs Moving ProcessBar into center Increasing performance. Applying size to all icons globally. Removing another unused file. Merge remote-tracking branch 'remotes/main/master' into diff-cleaner Removing unused files. Changing size of 'close'-button. Major changes concerning design and bug fixes. Temporary save point. 2 1 Co-authored-by: opyale <example@example.com> Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/413 Reviewed-by: 6543 <6543@noreply.gitea.io> Reviewed-by: M M Arif <mmarif@swatian.com>
2020-04-28 14:39:41 +02:00
}
return true;
});
diffLines.addView(diffTextView);
}
}
}
else {
diffLines.addView(getMessageView(context.getResources().getString(R.string.fileTooLarge)));
}
}
return convertView;
}
private TextView getMessageView(String message) {
TextView textView = new TextView(context);
textView.setTextColor(COLOR_FONT);
textView.setBackgroundColor(COLOR_NORMAL);
textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 14);
textView.setPadding(15, 15, 15, 15);
textView.setTypeface(Typeface.DEFAULT);
textView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
textView.setText(message);
return textView;
}
private String[] getLines(String content) {
return content.split("\\R");
}
}