Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
626746be8b | |||
f21f23c1f0 | |||
5005fcc5b5 | |||
008e446b93 | |||
50e0142f6c | |||
42640f2d1c | |||
4a8ee2ea96 | |||
acc55e3433 | |||
e267aa5100 | |||
5e41469452 | |||
55473701b8 | |||
546346ff48 | |||
4f0091f151 | |||
37367e142f |
@ -4,11 +4,16 @@ end_of_line = lf
|
|||||||
indent_size = 4
|
indent_size = 4
|
||||||
indent_style = space
|
indent_style = space
|
||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = true
|
||||||
max_line_length = 150
|
max_line_length = 150
|
||||||
|
|
||||||
[*.java]
|
[*.java]
|
||||||
indent_style = tab
|
indent_style = tab
|
||||||
max_line_length = 220
|
max_line_length = 220
|
||||||
|
line_comment = //
|
||||||
|
block_comment_start = /*
|
||||||
|
block_comment = *
|
||||||
|
block_comment_end = */
|
||||||
|
|
||||||
[*.json]
|
[*.json]
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
[Check out the release notes](https://gitea.com/gitnex/GitNex/releases)
|
[Check out the release notes](https://codeberg.org/gitnex/GitNex/releases)
|
||||||
|
@ -10,7 +10,7 @@ Please ask if you are not sure about the scope of work to be submitted to avoid
|
|||||||
**Code Standards**
|
**Code Standards**
|
||||||
Please follow the code standards, this will help other developers to understand your code too.
|
Please follow the code standards, this will help other developers to understand your code too.
|
||||||
It also helps maintaining the code afterwards.
|
It also helps maintaining the code afterwards.
|
||||||
It is documented in the Wiki: [Code-Standards](https://gitea.com/gitnex/GitNex/wiki/Code-Standards)
|
It is documented in the Wiki: [Code-Standards](https://codeberg.org/gitnex/GitNex/wiki/Code-Standards)
|
||||||
|
|
||||||
**How to submit a PR**
|
**How to submit a PR**
|
||||||
Fork this repository. Pull the forked repository from your namespace to your local machine. Create new branch and work on the bug/feature/enhancement you would like to submit. Push it to your forked version. From there create Pull Request(PR) against **master** branch.
|
Fork this repository. Pull the forked repository from your namespace to your local machine. Create new branch and work on the bug/feature/enhancement you would like to submit. Push it to your forked version. From there create Pull Request(PR) against **master** branch.
|
||||||
|
21
README.md
21
README.md
@ -1,4 +1,4 @@
|
|||||||
[](https://www.gnu.org/licenses/gpl-3.0) [](https://gitea.com/gitnex/GitNex/releases) [](https://drone.gitea.com/gitnex/GitNex) [](https://crowdin.com/project/gitnex) [](https://discord.gg/FbSS4rf)
|
[](https://www.gnu.org/licenses/gpl-3.0) [](https://codeberg.org/gitnex/GitNex/releases) [](https://crowdin.com/project/gitnex) [](https://discord.gg/FbSS4rf)
|
||||||
|
|
||||||
[<img alt="Become a Patroen" src="https://c5.patreon.com/external/logo/become_a_patron_button@2x.png" height="40"/>](https://www.patreon.com/mmarif) [<img alt="Donate using Liberapay" src="https://liberapay.com/assets/widgets/donate.svg" height="40"/>](https://liberapay.com/mmarif/donate)
|
[<img alt="Become a Patroen" src="https://c5.patreon.com/external/logo/become_a_patron_button@2x.png" height="40"/>](https://www.patreon.com/mmarif) [<img alt="Donate using Liberapay" src="https://liberapay.com/assets/widgets/donate.svg" height="40"/>](https://liberapay.com/mmarif/donate)
|
||||||
|
|
||||||
@ -18,7 +18,7 @@ Download latest build from master: [https://cloud.swatian.com/s/Cq592xGEfnsGAAW]
|
|||||||
## Note about Gitea version
|
## Note about Gitea version
|
||||||
Please make sure that you are on latest stable release or later for better app experience.
|
Please make sure that you are on latest stable release or later for better app experience.
|
||||||
|
|
||||||
Check the versions [compatibility page](https://gitea.com/gitnex/GitNex/wiki/Compatibility) which lists all the supported versions with compatibility ratio.
|
Check the versions [compatibility page](https://codeberg.org/gitnex/GitNex/wiki/Compatibility) which lists all the supported versions with compatibility ratio.
|
||||||
|
|
||||||
## Build from source
|
## Build from source
|
||||||
Option 1 - Download the source code, open it in Android Studio and build it there.
|
Option 1 - Download the source code, open it in Android Studio and build it there.
|
||||||
@ -32,36 +32,36 @@ Option 2 - Open terminal(Linux) and cd to the project dir. Run `./gradlew build`
|
|||||||
- Issues list
|
- Issues list
|
||||||
- Pull requests
|
- Pull requests
|
||||||
- Merge pull request
|
- Merge pull request
|
||||||
- [MANY MORE](https://gitea.com/gitnex/GitNex/wiki/Features)
|
- [MANY MORE](https://codeberg.org/gitnex/GitNex/wiki/Features)
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
[CONTRIBUTING](https://gitea.com/gitnex/GitNex/src/branch/master/CONTRIBUTING.md)
|
[CONTRIBUTING](https://codeberg.org/gitnex/GitNex/src/branch/master/CONTRIBUTING.md)
|
||||||
|
|
||||||
## Translation
|
## Translation
|
||||||
Help us translate GitNex to your native language.
|
Help us translate GitNex to your native language.
|
||||||
|
|
||||||
We use [Crowdin](https://crowdin.com/project/gitnex) for translation. If your language is not listed, please request [here](https://gitea.com/gitnex/GitNex/issues) to add it to the project.
|
We use [Crowdin](https://crowdin.com/project/gitnex) for translation. If your language is not listed, please request [here](https://codeberg.org/gitnex/GitNex/issues) to add it to the project.
|
||||||
|
|
||||||
**Link: https://crowdin.com/project/GitNex**
|
**Link: https://crowdin.com/project/GitNex**
|
||||||
|
|
||||||
## Screenshots:
|
## Screenshots:
|
||||||
|
|
||||||
<img src="https://gitea.com/gitnex/GitNex/raw/branch/master/fastlane/metadata/android/en-US/images/phoneScreenshots/001.png" alt="001.png" width="200"/> | <img src="https://gitea.com/gitnex/GitNex/raw/branch/master/fastlane/metadata/android/en-US/images/phoneScreenshots/002.png" alt="002.png" width="200"/> | <img src="https://gitea.com/gitnex/GitNex/raw/branch/master/fastlane/metadata/android/en-US/images/phoneScreenshots/003.png" alt="003.png" width="200"/> | <img src="https://gitea.com/gitnex/GitNex/raw/branch/master/fastlane/metadata/android/en-US/images/phoneScreenshots/004.png" alt="004.png" width="200"/>
|
<img src="https://codeberg.org/gitnex/GitNex/raw/branch/master/fastlane/metadata/android/en-US/images/phoneScreenshots/001.png" alt="001.png" width="200"/> | <img src="https://codeberg.org/gitnex/GitNex/raw/branch/master/fastlane/metadata/android/en-US/images/phoneScreenshots/002.png" alt="002.png" width="200"/> | <img src="https://codeberg.org/gitnex/GitNex/raw/branch/master/fastlane/metadata/android/en-US/images/phoneScreenshots/003.png" alt="003.png" width="200"/> | <img src="https://codeberg.org/gitnex/GitNex/raw/branch/master/fastlane/metadata/android/en-US/images/phoneScreenshots/004.png" alt="004.png" width="200"/>
|
||||||
---|---|---|---
|
---|---|---|---
|
||||||
<img src="https://gitea.com/gitnex/GitNex/raw/branch/master/fastlane/metadata/android/en-US/images/phoneScreenshots/005.png" alt="005.png" width="200"/> | <img src="https://gitea.com/gitnex/GitNex/raw/branch/master/fastlane/metadata/android/en-US/images/phoneScreenshots/006.png" alt="006.png" width="200"/> | <img src="https://gitea.com/gitnex/GitNex/raw/branch/master/fastlane/metadata/android/en-US/images/phoneScreenshots/007.png" alt="007.png" width="200"/> | <img src="https://gitea.com/gitnex/GitNex/raw/branch/master/fastlane/metadata/android/en-US/images/phoneScreenshots/008.png" alt="008.png" width="200"/>
|
<img src="https://codeberg.org/gitnex/GitNex/raw/branch/master/fastlane/metadata/android/en-US/images/phoneScreenshots/005.png" alt="005.png" width="200"/> | <img src="https://codeberg.org/gitnex/GitNex/raw/branch/master/fastlane/metadata/android/en-US/images/phoneScreenshots/006.png" alt="006.png" width="200"/> | <img src="https://codeberg.org/gitnex/GitNex/raw/branch/master/fastlane/metadata/android/en-US/images/phoneScreenshots/007.png" alt="007.png" width="200"/> | <img src="https://codeberg.org/gitnex/GitNex/raw/branch/master/fastlane/metadata/android/en-US/images/phoneScreenshots/008.png" alt="008.png" width="200"/>
|
||||||
|
|
||||||
|
|
||||||
## FAQ
|
## FAQ
|
||||||
[Faq](https://gitea.com/gitnex/GitNex/wiki/FAQ)
|
[Faq](https://codeberg.org/gitnex/GitNex/wiki/FAQ)
|
||||||
|
|
||||||
## Links
|
## Links
|
||||||
[Website](https://gitnex.com)
|
[Website](https://gitnex.com)
|
||||||
|
|
||||||
[Wiki](https://gitea.com/gitnex/GitNex/wiki/Home)
|
[Wiki](https://codeberg.org/gitnex/GitNex/wiki/Home)
|
||||||
|
|
||||||
[Website Repository](https://gitlab.com/mmarif4u/gitnex-website)
|
[Website Repository](https://gitlab.com/mmarif4u/gitnex-website)
|
||||||
|
|
||||||
[Troubleshoot Guide](https://gitea.com/gitnex/GitNex/wiki/Troubleshoot-Guide)
|
[Troubleshoot Guide](https://codeberg.org/gitnex/GitNex/wiki/Troubleshoot-Guide)
|
||||||
|
|
||||||
## Thanks
|
## Thanks
|
||||||
Thanks to all the open source libraries, contributors and donators.
|
Thanks to all the open source libraries, contributors and donators.
|
||||||
@ -87,5 +87,6 @@ Open source libraries
|
|||||||
- Droidsonroids.gif/android-gif-drawable
|
- Droidsonroids.gif/android-gif-drawable
|
||||||
- Barteksc/AndroidPdfViewer
|
- Barteksc/AndroidPdfViewer
|
||||||
- Ge0rg/MemorizingTrustManager
|
- Ge0rg/MemorizingTrustManager
|
||||||
|
- Dimezis/BlurView
|
||||||
|
|
||||||
[Follow me on Fediverse - mastodon.social/@mmarif](https://mastodon.social/@mmarif)
|
[Follow me on Fediverse - mastodon.social/@mmarif](https://mastodon.social/@mmarif)
|
||||||
|
@ -6,8 +6,8 @@ android {
|
|||||||
applicationId "org.mian.gitnex"
|
applicationId "org.mian.gitnex"
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 29
|
targetSdkVersion 29
|
||||||
versionCode 295
|
versionCode 296
|
||||||
versionName "3.0.0-rc1"
|
versionName "3.0.0-rc2"
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
viewBinding {
|
viewBinding {
|
||||||
@ -41,8 +41,8 @@ dependencies {
|
|||||||
def acra = "5.5.0"
|
def acra = "5.5.0"
|
||||||
|
|
||||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||||
implementation "androidx.appcompat:appcompat:1.2.0-rc01"
|
implementation "androidx.appcompat:appcompat:1.3.0-alpha01"
|
||||||
implementation "com.google.android.material:material:1.2.0-beta01"
|
implementation "com.google.android.material:material:1.3.0-alpha01"
|
||||||
implementation "androidx.constraintlayout:constraintlayout:1.1.3"
|
implementation "androidx.constraintlayout:constraintlayout:1.1.3"
|
||||||
implementation "androidx.legacy:legacy-support-v4:1.0.0"
|
implementation "androidx.legacy:legacy-support-v4:1.0.0"
|
||||||
testImplementation "junit:junit:4.13"
|
testImplementation "junit:junit:4.13"
|
||||||
@ -86,5 +86,6 @@ dependencies {
|
|||||||
implementation "ch.acra:acra-mail:$acra"
|
implementation "ch.acra:acra-mail:$acra"
|
||||||
implementation "ch.acra:acra-limiter:$acra"
|
implementation "ch.acra:acra-limiter:$acra"
|
||||||
implementation "ch.acra:acra-notification:$acra"
|
implementation "ch.acra:acra-notification:$acra"
|
||||||
|
implementation 'com.eightbitlab:blurview:1.6.3'
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -203,7 +203,7 @@ public class IssueActions {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
Toasty.info(ctx, ctx.getString(R.string.subscribtionError));
|
Toasty.info(ctx, ctx.getString(R.string.subscriptionError));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -263,7 +263,7 @@ public class IssueActions {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
Toasty.info(ctx, ctx.getString(R.string.unsubscribtionError));
|
Toasty.info(ctx, ctx.getString(R.string.unsubscriptionError));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -272,7 +272,7 @@ public class IssueActions {
|
|||||||
@Override
|
@Override
|
||||||
public void onFailure(@NonNull Call<Void> call, @NonNull Throwable t) {
|
public void onFailure(@NonNull Call<Void> call, @NonNull Throwable t) {
|
||||||
|
|
||||||
Toasty.info(ctx, ctx.getString(R.string.unsubscribtionError));
|
Toasty.info(ctx, ctx.getString(R.string.unsubscriptionError));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,6 @@ import org.mian.gitnex.adapters.CommitsAdapter;
|
|||||||
import org.mian.gitnex.clients.AppApiService;
|
import org.mian.gitnex.clients.AppApiService;
|
||||||
import org.mian.gitnex.helpers.Authorization;
|
import org.mian.gitnex.helpers.Authorization;
|
||||||
import org.mian.gitnex.helpers.StaticGlobalVariables;
|
import org.mian.gitnex.helpers.StaticGlobalVariables;
|
||||||
import org.mian.gitnex.helpers.Toasty;
|
|
||||||
import org.mian.gitnex.helpers.Version;
|
import org.mian.gitnex.helpers.Version;
|
||||||
import org.mian.gitnex.interfaces.ApiInterface;
|
import org.mian.gitnex.interfaces.ApiInterface;
|
||||||
import org.mian.gitnex.models.Commits;
|
import org.mian.gitnex.models.Commits;
|
||||||
@ -102,7 +101,7 @@ public class CommitsActivity extends BaseActivity {
|
|||||||
swipeRefresh.setOnRefreshListener(() -> new Handler().postDelayed(() -> {
|
swipeRefresh.setOnRefreshListener(() -> new Handler().postDelayed(() -> {
|
||||||
|
|
||||||
swipeRefresh.setRefreshing(false);
|
swipeRefresh.setRefreshing(false);
|
||||||
loadInitial(Authorization.returnAuthentication(ctx, loginUid, instanceToken), repoOwner, repoName, branchName);
|
loadInitial(Authorization.returnAuthentication(ctx, loginUid, instanceToken), repoOwner, repoName, branchName, resultLimit);
|
||||||
adapter.notifyDataChanged();
|
adapter.notifyDataChanged();
|
||||||
|
|
||||||
}, 200));
|
}, 200));
|
||||||
@ -113,7 +112,7 @@ public class CommitsActivity extends BaseActivity {
|
|||||||
if(commitsList.size() == resultLimit || pageSize == resultLimit) {
|
if(commitsList.size() == resultLimit || pageSize == resultLimit) {
|
||||||
|
|
||||||
int page = (commitsList.size() + resultLimit) / resultLimit;
|
int page = (commitsList.size() + resultLimit) / resultLimit;
|
||||||
loadMore(Authorization.returnAuthentication(ctx, loginUid, instanceToken), repoOwner, repoName, page, branchName);
|
loadMore(Authorization.returnAuthentication(ctx, loginUid, instanceToken), repoOwner, repoName, page, branchName, resultLimit);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -124,13 +123,13 @@ public class CommitsActivity extends BaseActivity {
|
|||||||
recyclerView.setAdapter(adapter);
|
recyclerView.setAdapter(adapter);
|
||||||
|
|
||||||
api = AppApiService.createService(ApiInterface.class, instanceUrl, ctx);
|
api = AppApiService.createService(ApiInterface.class, instanceUrl, ctx);
|
||||||
loadInitial(Authorization.returnAuthentication(ctx, loginUid, instanceToken), repoOwner, repoName, branchName);
|
loadInitial(Authorization.returnAuthentication(ctx, loginUid, instanceToken), repoOwner, repoName, branchName, resultLimit);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadInitial(String token, String repoOwner, String repoName, String branchName) {
|
private void loadInitial(String token, String repoOwner, String repoName, String branchName, int resultLimit) {
|
||||||
|
|
||||||
Call<List<Commits>> call = api.getRepositoryCommits(token, repoOwner, repoName, 1, branchName);
|
Call<List<Commits>> call = api.getRepositoryCommits(token, repoOwner, repoName, 1, branchName, resultLimit);
|
||||||
|
|
||||||
call.enqueue(new Callback<List<Commits>>() {
|
call.enqueue(new Callback<List<Commits>>() {
|
||||||
|
|
||||||
@ -175,13 +174,13 @@ public class CommitsActivity extends BaseActivity {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadMore(String token, String repoOwner, String repoName, final int page, String branchName) {
|
private void loadMore(String token, String repoOwner, String repoName, final int page, String branchName, int resultLimit) {
|
||||||
|
|
||||||
//add loading progress view
|
//add loading progress view
|
||||||
commitsList.add(new Commits("load"));
|
commitsList.add(new Commits("load"));
|
||||||
adapter.notifyItemInserted((commitsList.size() - 1));
|
adapter.notifyItemInserted((commitsList.size() - 1));
|
||||||
|
|
||||||
Call<List<Commits>> call = api.getRepositoryCommits(token, repoOwner, repoName, page, branchName);
|
Call<List<Commits>> call = api.getRepositoryCommits(token, repoOwner, repoName, page, branchName, resultLimit);
|
||||||
|
|
||||||
call.enqueue(new Callback<List<Commits>>() {
|
call.enqueue(new Callback<List<Commits>>() {
|
||||||
|
|
||||||
@ -204,7 +203,6 @@ public class CommitsActivity extends BaseActivity {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
Toasty.info(ctx, getString(R.string.noMoreData));
|
|
||||||
adapter.setMoreDataAvailable(false);
|
adapter.setMoreDataAvailable(false);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -10,17 +10,17 @@ import android.widget.ProgressBar;
|
|||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.appcompat.widget.Toolbar;
|
import androidx.appcompat.widget.Toolbar;
|
||||||
import org.apache.commons.io.FileUtils;
|
|
||||||
import org.mian.gitnex.R;
|
import org.mian.gitnex.R;
|
||||||
import org.mian.gitnex.adapters.FilesDiffAdapter;
|
import org.mian.gitnex.adapters.FilesDiffAdapter;
|
||||||
import org.mian.gitnex.clients.RetrofitClient;
|
import org.mian.gitnex.clients.RetrofitClient;
|
||||||
import org.mian.gitnex.helpers.AlertDialogs;
|
import org.mian.gitnex.helpers.AlertDialogs;
|
||||||
|
import org.mian.gitnex.helpers.ParseDiff;
|
||||||
import org.mian.gitnex.helpers.Toasty;
|
import org.mian.gitnex.helpers.Toasty;
|
||||||
|
import org.mian.gitnex.helpers.Version;
|
||||||
import org.mian.gitnex.models.FileDiffView;
|
import org.mian.gitnex.models.FileDiffView;
|
||||||
import org.mian.gitnex.util.AppUtil;
|
import org.mian.gitnex.util.AppUtil;
|
||||||
import org.mian.gitnex.util.TinyDB;
|
import org.mian.gitnex.util.TinyDB;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import okhttp3.ResponseBody;
|
import okhttp3.ResponseBody;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
@ -32,191 +32,150 @@ import retrofit2.Callback;
|
|||||||
|
|
||||||
public class FileDiffActivity extends BaseActivity {
|
public class FileDiffActivity extends BaseActivity {
|
||||||
|
|
||||||
private View.OnClickListener onClickListener;
|
private View.OnClickListener onClickListener;
|
||||||
private TextView toolbar_title;
|
private TextView toolbarTitle;
|
||||||
private ListView mListView;
|
private ListView mListView;
|
||||||
private ProgressBar mProgressBar;
|
private ProgressBar mProgressBar;
|
||||||
final Context ctx = this;
|
final Context ctx = this;
|
||||||
private Context appCtx;
|
private Context appCtx;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getLayoutResourceId(){
|
protected int getLayoutResourceId() {
|
||||||
return R.layout.activity_file_diff;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
return R.layout.activity_file_diff;
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
}
|
||||||
|
|
||||||
super.onCreate(savedInstanceState);
|
@Override
|
||||||
appCtx = getApplicationContext();
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
|
|
||||||
Toolbar toolbar = findViewById(R.id.toolbar);
|
super.onCreate(savedInstanceState);
|
||||||
setSupportActionBar(toolbar);
|
appCtx = getApplicationContext();
|
||||||
|
|
||||||
final TinyDB tinyDb = new TinyDB(appCtx);
|
Toolbar toolbar = findViewById(R.id.toolbar);
|
||||||
String repoFullName = tinyDb.getString("repoFullName");
|
setSupportActionBar(toolbar);
|
||||||
String[] parts = repoFullName.split("/");
|
|
||||||
final String repoOwner = parts[0];
|
|
||||||
final String repoName = parts[1];
|
|
||||||
final String instanceUrl = tinyDb.getString("instanceUrl");
|
|
||||||
final String loginUid = tinyDb.getString("loginUid");
|
|
||||||
final String instanceToken = "token " + tinyDb.getString(loginUid + "-token");
|
|
||||||
|
|
||||||
ImageView closeActivity = findViewById(R.id.close);
|
final TinyDB tinyDb = new TinyDB(appCtx);
|
||||||
toolbar_title = findViewById(R.id.toolbar_title);
|
String repoFullName = tinyDb.getString("repoFullName");
|
||||||
mListView = findViewById(R.id.listView);
|
String[] parts = repoFullName.split("/");
|
||||||
mProgressBar = findViewById(R.id.progress_bar);
|
final String repoOwner = parts[0];
|
||||||
|
final String repoName = parts[1];
|
||||||
|
final String loginUid = tinyDb.getString("loginUid");
|
||||||
|
final String instanceToken = "token " + tinyDb.getString(loginUid + "-token");
|
||||||
|
|
||||||
mListView.setDivider(null);
|
ImageView closeActivity = findViewById(R.id.close);
|
||||||
|
toolbarTitle = findViewById(R.id.toolbar_title);
|
||||||
|
mListView = findViewById(R.id.listView);
|
||||||
|
mProgressBar = findViewById(R.id.progress_bar);
|
||||||
|
|
||||||
toolbar_title.setText(R.string.processingText);
|
mListView.setDivider(null);
|
||||||
initCloseListener();
|
|
||||||
closeActivity.setOnClickListener(onClickListener);
|
|
||||||
|
|
||||||
mProgressBar.setVisibility(View.VISIBLE);
|
toolbarTitle.setText(R.string.processingText);
|
||||||
|
initCloseListener();
|
||||||
|
closeActivity.setOnClickListener(onClickListener);
|
||||||
|
|
||||||
String pullIndex = tinyDb.getString("issueNumber");
|
mProgressBar.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
getPullDiffContent(tinyDb.getString("instanceUrlWithProtocol"), repoOwner, repoName, pullIndex);
|
String pullIndex = tinyDb.getString("issueNumber");
|
||||||
|
|
||||||
}
|
boolean apiCall = true;
|
||||||
|
String instanceUrl = tinyDb.getString("instanceUrl");
|
||||||
|
|
||||||
private void getPullDiffContent(String instanceUrl, String owner, String repo, String filename) {
|
// fallback for old gitea instances
|
||||||
|
if(new Version(tinyDb.getString("giteaVersion")).less("1.13.0")) {
|
||||||
|
apiCall = false;
|
||||||
|
instanceUrl = tinyDb.getString("instanceUrlWithProtocol");
|
||||||
|
}
|
||||||
|
|
||||||
Call<ResponseBody> call = RetrofitClient
|
getPullDiffContent(instanceUrl, repoOwner, repoName, pullIndex, instanceToken, apiCall);
|
||||||
.getInstance(instanceUrl, ctx)
|
|
||||||
.getWebInterface()
|
|
||||||
.getPullDiffContent(owner, repo, filename);
|
|
||||||
|
|
||||||
call.enqueue(new Callback<ResponseBody>() {
|
}
|
||||||
|
|
||||||
@Override
|
private void getPullDiffContent(String instanceUrl, String owner, String repo, String pullIndex, String token, boolean apiCall) {
|
||||||
public void onResponse(@NonNull Call<ResponseBody> call, @NonNull retrofit2.Response<ResponseBody> response) {
|
|
||||||
|
|
||||||
if (response.code() == 200) {
|
Call<ResponseBody> call;
|
||||||
|
if(apiCall) {
|
||||||
|
call = RetrofitClient.getInstance(instanceUrl, ctx).getApiInterface().getPullDiffContent(token, owner, repo, pullIndex);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
call = RetrofitClient.getInstance(instanceUrl, ctx).getWebInterface().getPullDiffContent(owner, repo, pullIndex);
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
call.enqueue(new Callback<ResponseBody>() {
|
||||||
assert response.body() != null;
|
|
||||||
|
|
||||||
AppUtil appUtil = new AppUtil();
|
@Override
|
||||||
List<FileDiffView> fileContentsArray = new ArrayList<>();
|
public void onResponse(@NonNull Call<ResponseBody> call, @NonNull retrofit2.Response<ResponseBody> response) {
|
||||||
|
|
||||||
String[] lines = response.body().string().split("diff");
|
if(response.code() == 200) {
|
||||||
|
|
||||||
if(lines.length > 0) {
|
try {
|
||||||
|
assert response.body() != null;
|
||||||
|
|
||||||
for (int i = 1; i < lines.length; i++) {
|
AppUtil appUtil = new AppUtil();
|
||||||
|
List<FileDiffView> fileContentsArray = ParseDiff.getFileDiffViewArray(response.body().string());
|
||||||
|
|
||||||
if(lines[i].contains("@@ -")) {
|
int filesCount = fileContentsArray.size();
|
||||||
|
if(filesCount > 1) {
|
||||||
|
toolbarTitle.setText(getResources().getString(R.string.fileDiffViewHeader, Integer.toString(filesCount)));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
toolbarTitle.setText(getResources().getString(R.string.fileDiffViewHeaderSingle, Integer.toString(filesCount)));
|
||||||
|
}
|
||||||
|
|
||||||
String[] level2nd = lines[i].split("@@ -"); // main content part of single diff view
|
FilesDiffAdapter adapter = new FilesDiffAdapter(ctx, fileContentsArray);
|
||||||
|
mListView.setAdapter(adapter);
|
||||||
|
|
||||||
String[] fileName_ = level2nd[0].split("\\+\\+\\+ b/"); // filename part
|
mProgressBar.setVisibility(View.GONE);
|
||||||
String fileNameFinal = fileName_[1];
|
|
||||||
|
|
||||||
String[] fileContents_ = level2nd[1].split("@@"); // file info / content part
|
}
|
||||||
String fileInfoFinal = fileContents_[0];
|
catch(IOException e) {
|
||||||
StringBuilder fileContentsFinal = new StringBuilder(fileContents_[1]);
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
if(level2nd.length > 2) {
|
}
|
||||||
for (int j = 2; j < level2nd.length; j++) {
|
else if(response.code() == 401) {
|
||||||
fileContentsFinal.append(level2nd[j]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
String fileExtension = FileUtils.getExtension(fileNameFinal);
|
AlertDialogs.authorizationTokenRevokedDialog(ctx, getResources().getString(R.string.alertDialogTokenRevokedTitle), getResources().getString(R.string.alertDialogTokenRevokedMessage), getResources().getString(R.string.alertDialogTokenRevokedCopyNegativeButton), getResources().getString(R.string.alertDialogTokenRevokedCopyPositiveButton));
|
||||||
|
|
||||||
String fileContentsFinalWithBlankLines = fileContentsFinal.toString().replaceAll( ".*@@.*", "" );
|
}
|
||||||
String fileContentsFinalWithoutBlankLines = fileContentsFinal.toString().replaceAll( ".*@@.*(\r?\n|\r)?", "" );
|
else if(response.code() == 403) {
|
||||||
fileContentsFinalWithoutBlankLines = fileContentsFinalWithoutBlankLines.replaceAll( ".*\\ No newline at end of file.*(\r?\n|\r)?", "" );
|
|
||||||
|
|
||||||
fileContentsArray.add(new FileDiffView(fileNameFinal, appUtil.imageExtension(fileExtension), fileInfoFinal, fileContentsFinalWithoutBlankLines));
|
Toasty.info(ctx, ctx.getString(R.string.authorizeError));
|
||||||
}
|
|
||||||
else {
|
|
||||||
|
|
||||||
String[] getFileName = lines[i].split("--git a/");
|
}
|
||||||
|
else if(response.code() == 404) {
|
||||||
|
|
||||||
String[] getFileName_ = getFileName[1].split("b/");
|
Toasty.info(ctx, ctx.getString(R.string.apiNotFound));
|
||||||
String getFileNameFinal = getFileName_[0].trim();
|
|
||||||
|
|
||||||
String[] binaryFile = getFileName_[1].split("GIT binary patch");
|
}
|
||||||
String binaryFileRaw = binaryFile[1].substring(binaryFile[1].indexOf('\n')+1);
|
else {
|
||||||
String binaryFileFinal = binaryFile[1].substring(binaryFileRaw.indexOf('\n')+1);
|
|
||||||
|
|
||||||
String fileExtension = FileUtils.getExtension(getFileNameFinal);
|
Toasty.info(ctx, getString(R.string.labelGeneralError));
|
||||||
|
|
||||||
if(appUtil.imageExtension(FileUtils.getExtension(getFileNameFinal))) {
|
}
|
||||||
|
|
||||||
fileContentsArray.add(new FileDiffView(getFileNameFinal, appUtil.imageExtension(fileExtension), "", binaryFileFinal));
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
@Override
|
||||||
|
public void onFailure(@NonNull Call<ResponseBody> call, @NonNull Throwable t) {
|
||||||
|
|
||||||
}
|
Log.e("onFailure", t.toString());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int filesCount = fileContentsArray.size();
|
private void initCloseListener() {
|
||||||
if(filesCount > 1) {
|
|
||||||
toolbar_title.setText(getResources().getString(R.string.fileDiffViewHeader, Integer.toString(filesCount)));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
toolbar_title.setText(getResources().getString(R.string.fileDiffViewHeaderSingle, Integer.toString(filesCount)));
|
|
||||||
}
|
|
||||||
|
|
||||||
FilesDiffAdapter adapter = new FilesDiffAdapter(ctx, fileContentsArray);
|
onClickListener = new View.OnClickListener() {
|
||||||
mListView.setAdapter(adapter);
|
|
||||||
|
|
||||||
mProgressBar.setVisibility(View.GONE);
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
|
||||||
} catch (IOException e) {
|
getIntent().removeExtra("singleFileName");
|
||||||
e.printStackTrace();
|
finish();
|
||||||
}
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
else if(response.code() == 401) {
|
|
||||||
|
|
||||||
AlertDialogs.authorizationTokenRevokedDialog(ctx, getResources().getString(R.string.alertDialogTokenRevokedTitle),
|
|
||||||
getResources().getString(R.string.alertDialogTokenRevokedMessage),
|
|
||||||
getResources().getString(R.string.alertDialogTokenRevokedCopyNegativeButton),
|
|
||||||
getResources().getString(R.string.alertDialogTokenRevokedCopyPositiveButton));
|
|
||||||
|
|
||||||
}
|
|
||||||
else if(response.code() == 403) {
|
|
||||||
|
|
||||||
Toasty.info(ctx, ctx.getString(R.string.authorizeError));
|
|
||||||
|
|
||||||
}
|
|
||||||
else if(response.code() == 404) {
|
|
||||||
|
|
||||||
Toasty.info(ctx, ctx.getString(R.string.apiNotFound));
|
|
||||||
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
|
|
||||||
Toasty.info(ctx, getString(R.string.labelGeneralError));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailure(@NonNull Call<ResponseBody> call, @NonNull Throwable t) {
|
|
||||||
Log.e("onFailure", t.toString());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void initCloseListener() {
|
|
||||||
onClickListener = new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View view) {
|
|
||||||
getIntent().removeExtra("singleFileName");
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -439,10 +439,9 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
|
|||||||
gitea_version = new Version(version.getVersion());
|
gitea_version = new Version(version.getVersion());
|
||||||
}
|
}
|
||||||
catch(Error e) {
|
catch(Error e) {
|
||||||
SnackBar.error(ctx, layoutView, getResources().getString(R.string.versionUnknow));
|
SnackBar.error(ctx, layoutView, getResources().getString(R.string.versionUnknown));
|
||||||
enableProcessButton();
|
enableProcessButton();
|
||||||
}
|
}
|
||||||
//(getString(R.string.versionLow), getString(), version.getVersion());
|
|
||||||
|
|
||||||
// UNSUPPORTED_OLD
|
// UNSUPPORTED_OLD
|
||||||
if(gitea_version.less(getString(R.string.versionLow))) {
|
if(gitea_version.less(getString(R.string.versionLow))) {
|
||||||
|
@ -12,6 +12,7 @@ import android.os.Bundle;
|
|||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
@ -22,7 +23,6 @@ import androidx.drawerlayout.widget.DrawerLayout;
|
|||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.fragment.app.FragmentManager;
|
import androidx.fragment.app.FragmentManager;
|
||||||
import com.google.android.material.navigation.NavigationView;
|
import com.google.android.material.navigation.NavigationView;
|
||||||
import com.squareup.picasso.NetworkPolicy;
|
|
||||||
import org.mian.gitnex.R;
|
import org.mian.gitnex.R;
|
||||||
import org.mian.gitnex.clients.PicassoService;
|
import org.mian.gitnex.clients.PicassoService;
|
||||||
import org.mian.gitnex.clients.RetrofitClient;
|
import org.mian.gitnex.clients.RetrofitClient;
|
||||||
@ -38,6 +38,7 @@ import org.mian.gitnex.fragments.StarredRepositoriesFragment;
|
|||||||
import org.mian.gitnex.helpers.AlertDialogs;
|
import org.mian.gitnex.helpers.AlertDialogs;
|
||||||
import org.mian.gitnex.helpers.Authorization;
|
import org.mian.gitnex.helpers.Authorization;
|
||||||
import org.mian.gitnex.helpers.ChangeLog;
|
import org.mian.gitnex.helpers.ChangeLog;
|
||||||
|
import org.mian.gitnex.helpers.ColorInverter;
|
||||||
import org.mian.gitnex.helpers.RoundedTransformation;
|
import org.mian.gitnex.helpers.RoundedTransformation;
|
||||||
import org.mian.gitnex.helpers.Toasty;
|
import org.mian.gitnex.helpers.Toasty;
|
||||||
import org.mian.gitnex.models.GiteaVersion;
|
import org.mian.gitnex.models.GiteaVersion;
|
||||||
@ -45,6 +46,8 @@ import org.mian.gitnex.models.UserInfo;
|
|||||||
import org.mian.gitnex.util.AppUtil;
|
import org.mian.gitnex.util.AppUtil;
|
||||||
import org.mian.gitnex.util.TinyDB;
|
import org.mian.gitnex.util.TinyDB;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
import eightbitlab.com.blurview.BlurView;
|
||||||
|
import eightbitlab.com.blurview.RenderScriptBlur;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.Callback;
|
import retrofit2.Callback;
|
||||||
|
|
||||||
@ -55,9 +58,12 @@ import retrofit2.Callback;
|
|||||||
public class MainActivity extends BaseActivity implements NavigationView.OnNavigationItemSelectedListener {
|
public class MainActivity extends BaseActivity implements NavigationView.OnNavigationItemSelectedListener {
|
||||||
|
|
||||||
private DrawerLayout drawer;
|
private DrawerLayout drawer;
|
||||||
|
private BlurView blurView;
|
||||||
private TextView userFullName;
|
private TextView userFullName;
|
||||||
private TextView userEmail;
|
private TextView userEmail;
|
||||||
private ImageView userAvatar;
|
private ImageView userAvatar;
|
||||||
|
private ImageView userAvatarBackground;
|
||||||
|
private ViewGroup navHeaderFrame;
|
||||||
private TextView toolbarTitle;
|
private TextView toolbarTitle;
|
||||||
final Context ctx = this;
|
final Context ctx = this;
|
||||||
private Context appCtx;
|
private Context appCtx;
|
||||||
@ -131,6 +137,7 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
|
|||||||
|
|
||||||
FragmentManager fm = getSupportFragmentManager();
|
FragmentManager fm = getSupportFragmentManager();
|
||||||
Fragment fragmentById = fm.findFragmentById(R.id.fragment_container);
|
Fragment fragmentById = fm.findFragmentById(R.id.fragment_container);
|
||||||
|
|
||||||
if(fragmentById instanceof SettingsFragment) {
|
if(fragmentById instanceof SettingsFragment) {
|
||||||
toolbarTitle.setText(getResources().getString(R.string.pageTitleSettings));
|
toolbarTitle.setText(getResources().getString(R.string.pageTitleSettings));
|
||||||
}
|
}
|
||||||
@ -163,15 +170,10 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
|
|||||||
|
|
||||||
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
|
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
|
||||||
toggle.getDrawerArrowDrawable().setColor(getResources().getColor(R.color.darkGreen));
|
toggle.getDrawerArrowDrawable().setColor(getResources().getColor(R.color.darkGreen));
|
||||||
|
|
||||||
drawer.addDrawerListener(toggle);
|
drawer.addDrawerListener(toggle);
|
||||||
|
|
||||||
drawer.addDrawerListener(new DrawerLayout.DrawerListener() {
|
drawer.addDrawerListener(new DrawerLayout.DrawerListener() {
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDrawerSlide(@NonNull View drawerView, float slideOffset) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDrawerOpened(@NonNull View drawerView) {
|
public void onDrawerOpened(@NonNull View drawerView) {
|
||||||
|
|
||||||
@ -184,78 +186,118 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
|
|||||||
String userFullNameNav = tinyDb.getString("userFullname");
|
String userFullNameNav = tinyDb.getString("userFullname");
|
||||||
String userAvatarNav = tinyDb.getString("userAvatar");
|
String userAvatarNav = tinyDb.getString("userAvatar");
|
||||||
|
|
||||||
|
blurView = hView.findViewById(R.id.blurView);
|
||||||
userEmail = hView.findViewById(R.id.userEmail);
|
userEmail = hView.findViewById(R.id.userEmail);
|
||||||
|
userFullName = hView.findViewById(R.id.userFullname);
|
||||||
|
userAvatar = hView.findViewById(R.id.userAvatar);
|
||||||
|
userAvatarBackground = hView.findViewById(R.id.userAvatarBackground);
|
||||||
|
navHeaderFrame = hView.findViewById(R.id.navHeaderFrame);
|
||||||
|
|
||||||
|
userEmail.setTypeface(myTypeface);
|
||||||
|
userFullName.setTypeface(myTypeface);
|
||||||
|
|
||||||
|
navigationView.getMenu().findItem(R.id.nav_administration).setVisible(tinyDb.getBoolean("userIsAdmin"));
|
||||||
|
|
||||||
if(!userEmailNav.equals("")) {
|
if(!userEmailNav.equals("")) {
|
||||||
userEmail.setText(userEmailNav);
|
userEmail.setText(userEmailNav);
|
||||||
userEmail.setTypeface(myTypeface);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
userFullName = hView.findViewById(R.id.userFullname);
|
|
||||||
if(!userFullNameNav.equals("")) {
|
if(!userFullNameNav.equals("")) {
|
||||||
userFullName.setText(userFullNameNav);
|
userFullName.setText(userFullNameNav);
|
||||||
userFullName.setTypeface(myTypeface);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
userAvatar = hView.findViewById(R.id.userAvatar);
|
|
||||||
if(!userAvatarNav.equals("")) {
|
if(!userAvatarNav.equals("")) {
|
||||||
PicassoService.getInstance(ctx).get().load(userAvatarNav).networkPolicy(NetworkPolicy.OFFLINE).placeholder(R.drawable.loader_animated).transform(new RoundedTransformation(8, 0)).resize(160, 160).centerCrop().into(userAvatar);
|
|
||||||
|
PicassoService.getInstance(ctx).get()
|
||||||
|
.load(userAvatarNav)
|
||||||
|
.placeholder(R.drawable.loader_animated)
|
||||||
|
.transform(new RoundedTransformation(8, 0))
|
||||||
|
.resize(160, 160)
|
||||||
|
.centerCrop().into(userAvatar);
|
||||||
|
|
||||||
|
PicassoService.getInstance(ctx).get()
|
||||||
|
.load(userAvatarNav)
|
||||||
|
.into(userAvatarBackground, new com.squareup.picasso.Callback() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
|
||||||
|
int textColor = new ColorInverter().getImageViewContrastColor(userAvatarBackground);
|
||||||
|
|
||||||
|
userFullName.setTextColor(textColor);
|
||||||
|
userEmail.setTextColor(textColor);
|
||||||
|
|
||||||
|
blurView.setupWith(navHeaderFrame)
|
||||||
|
.setBlurAlgorithm(new RenderScriptBlur(ctx))
|
||||||
|
.setBlurRadius(5)
|
||||||
|
.setHasFixedTransformationMatrix(false);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Exception e) {}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
userAvatar.setOnClickListener(new View.OnClickListener() {
|
userAvatar.setOnClickListener(v -> {
|
||||||
|
|
||||||
public void onClick(View v) {
|
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new ProfileFragment()).commit();
|
||||||
|
drawer.closeDrawers();
|
||||||
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new ProfileFragment()).commit();
|
|
||||||
drawer.closeDrawers();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDrawerClosed(@NonNull View drawerView) {
|
public void onDrawerSlide(@NonNull View drawerView, float slideOffset) {}
|
||||||
// Called when a drawer has settled in a completely closed state.
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDrawerStateChanged(int newState) {
|
public void onDrawerClosed(@NonNull View drawerView) {}
|
||||||
// Called when the drawer motion state changes. The new state will be one of STATE_IDLE, STATE_DRAGGING or STATE_SETTLING.
|
|
||||||
}
|
@Override
|
||||||
|
public void onDrawerStateChanged(int newState) {}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
toggle.syncState();
|
toggle.syncState();
|
||||||
|
|
||||||
if(savedInstanceState == null) {
|
if(savedInstanceState == null) {
|
||||||
if(tinyDb.getInt("homeScreenId") == 0) {
|
|
||||||
toolbarTitle.setText(getResources().getString(R.string.pageTitleMyRepos));
|
switch(tinyDb.getInt("homeScreenId")) {
|
||||||
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new MyRepositoriesFragment()).commit();
|
|
||||||
navigationView.setCheckedItem(R.id.nav_home);
|
case 1:
|
||||||
}
|
toolbarTitle.setText(getResources().getString(R.string.pageTitleStarredRepos));
|
||||||
else if(tinyDb.getInt("homeScreenId") == 1) {
|
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new StarredRepositoriesFragment()).commit();
|
||||||
toolbarTitle.setText(getResources().getString(R.string.pageTitleStarredRepos));
|
navigationView.setCheckedItem(R.id.nav_starred_repos);
|
||||||
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new StarredRepositoriesFragment()).commit();
|
break;
|
||||||
navigationView.setCheckedItem(R.id.nav_starred_repos);
|
|
||||||
}
|
case 2:
|
||||||
else if(tinyDb.getInt("homeScreenId") == 2) {
|
toolbarTitle.setText(getResources().getString(R.string.pageTitleOrganizations));
|
||||||
toolbarTitle.setText(getResources().getString(R.string.pageTitleOrganizations));
|
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new OrganizationsFragment()).commit();
|
||||||
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new OrganizationsFragment()).commit();
|
navigationView.setCheckedItem(R.id.nav_organizations);
|
||||||
navigationView.setCheckedItem(R.id.nav_organizations);
|
break;
|
||||||
}
|
|
||||||
else if(tinyDb.getInt("homeScreenId") == 3) {
|
case 3:
|
||||||
toolbarTitle.setText(getResources().getString(R.string.pageTitleRepositories));
|
toolbarTitle.setText(getResources().getString(R.string.pageTitleRepositories));
|
||||||
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new RepositoriesFragment()).commit();
|
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new RepositoriesFragment()).commit();
|
||||||
navigationView.setCheckedItem(R.id.nav_repositories);
|
navigationView.setCheckedItem(R.id.nav_repositories);
|
||||||
}
|
break;
|
||||||
else if(tinyDb.getInt("homeScreenId") == 4) {
|
|
||||||
toolbarTitle.setText(getResources().getString(R.string.pageTitleProfile));
|
case 4:
|
||||||
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new ProfileFragment()).commit();
|
toolbarTitle.setText(getResources().getString(R.string.pageTitleProfile));
|
||||||
navigationView.setCheckedItem(R.id.nav_profile);
|
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new ProfileFragment()).commit();
|
||||||
}
|
navigationView.setCheckedItem(R.id.nav_profile);
|
||||||
else {
|
break;
|
||||||
toolbarTitle.setText(getResources().getString(R.string.pageTitleMyRepos));
|
|
||||||
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new MyRepositoriesFragment()).commit();
|
default:
|
||||||
navigationView.setCheckedItem(R.id.nav_home);
|
toolbarTitle.setText(getResources().getString(R.string.pageTitleMyRepos));
|
||||||
|
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new MyRepositoriesFragment()).commit();
|
||||||
|
navigationView.setCheckedItem(R.id.nav_home);
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!connToInternet) {
|
if(!connToInternet) {
|
||||||
@ -269,7 +311,7 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
displayUserInfo(instanceUrl, instanceToken, loginUid);
|
loadUserInfo(instanceUrl, instanceToken, loginUid);
|
||||||
giteaVersion(instanceUrl);
|
giteaVersion(instanceUrl);
|
||||||
tinyDb.putBoolean("noConnection", false);
|
tinyDb.putBoolean("noConnection", false);
|
||||||
|
|
||||||
@ -314,46 +356,56 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
|
|||||||
public boolean onNavigationItemSelected(@NonNull MenuItem menuItem) {
|
public boolean onNavigationItemSelected(@NonNull MenuItem menuItem) {
|
||||||
|
|
||||||
switch(menuItem.getItemId()) {
|
switch(menuItem.getItemId()) {
|
||||||
|
|
||||||
case R.id.nav_home:
|
case R.id.nav_home:
|
||||||
toolbarTitle.setText(getResources().getString(R.string.pageTitleMyRepos));
|
toolbarTitle.setText(getResources().getString(R.string.pageTitleMyRepos));
|
||||||
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new MyRepositoriesFragment()).commit();
|
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new MyRepositoriesFragment()).commit();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case R.id.nav_organizations:
|
case R.id.nav_organizations:
|
||||||
toolbarTitle.setText(getResources().getString(R.string.pageTitleOrganizations));
|
toolbarTitle.setText(getResources().getString(R.string.pageTitleOrganizations));
|
||||||
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new OrganizationsFragment()).commit();
|
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new OrganizationsFragment()).commit();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case R.id.nav_profile:
|
case R.id.nav_profile:
|
||||||
toolbarTitle.setText(getResources().getString(R.string.pageTitleProfile));
|
toolbarTitle.setText(getResources().getString(R.string.pageTitleProfile));
|
||||||
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new ProfileFragment()).commit();
|
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new ProfileFragment()).commit();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case R.id.nav_repositories:
|
case R.id.nav_repositories:
|
||||||
toolbarTitle.setText(getResources().getString(R.string.pageTitleRepositories));
|
toolbarTitle.setText(getResources().getString(R.string.pageTitleRepositories));
|
||||||
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new RepositoriesFragment()).commit();
|
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new RepositoriesFragment()).commit();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case R.id.nav_settings:
|
case R.id.nav_settings:
|
||||||
toolbarTitle.setText(getResources().getString(R.string.pageTitleSettings));
|
toolbarTitle.setText(getResources().getString(R.string.pageTitleSettings));
|
||||||
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new SettingsFragment()).commit();
|
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new SettingsFragment()).commit();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case R.id.nav_logout:
|
case R.id.nav_logout:
|
||||||
logout(this, ctx);
|
logout(this, ctx);
|
||||||
overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
|
overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case R.id.nav_about:
|
case R.id.nav_about:
|
||||||
toolbarTitle.setText(getResources().getString(R.string.pageTitleAbout));
|
toolbarTitle.setText(getResources().getString(R.string.pageTitleAbout));
|
||||||
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new AboutFragment()).commit();
|
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new AboutFragment()).commit();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case R.id.nav_rate_app:
|
case R.id.nav_rate_app:
|
||||||
rateThisApp();
|
rateThisApp();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case R.id.nav_starred_repos:
|
case R.id.nav_starred_repos:
|
||||||
toolbarTitle.setText(getResources().getString(R.string.pageTitleStarredRepos));
|
toolbarTitle.setText(getResources().getString(R.string.pageTitleStarredRepos));
|
||||||
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new StarredRepositoriesFragment()).commit();
|
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new StarredRepositoriesFragment()).commit();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case R.id.nav_explore:
|
case R.id.nav_explore:
|
||||||
toolbarTitle.setText(getResources().getString(R.string.pageTitleExplore));
|
toolbarTitle.setText(getResources().getString(R.string.pageTitleExplore));
|
||||||
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new ExploreRepositoriesFragment()).commit();
|
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new ExploreRepositoriesFragment()).commit();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case R.id.nav_administration:
|
case R.id.nav_administration:
|
||||||
toolbarTitle.setText(getResources().getString(R.string.pageTitleAdministration));
|
toolbarTitle.setText(getResources().getString(R.string.pageTitleAdministration));
|
||||||
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new AdministrationFragment()).commit();
|
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new AdministrationFragment()).commit();
|
||||||
@ -422,15 +474,12 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void displayUserInfo(String instanceUrl, String token, String loginUid) {
|
private void loadUserInfo(String instanceUrl, String token, String loginUid) {
|
||||||
|
|
||||||
final TinyDB tinyDb = new TinyDB(appCtx);
|
final TinyDB tinyDb = new TinyDB(appCtx);
|
||||||
|
|
||||||
Call<UserInfo> call = RetrofitClient.getInstance(instanceUrl, ctx).getApiInterface().getUserInfo(Authorization.returnAuthentication(ctx, loginUid, token));
|
Call<UserInfo> call = RetrofitClient.getInstance(instanceUrl, ctx).getApiInterface().getUserInfo(Authorization.returnAuthentication(ctx, loginUid, token));
|
||||||
|
|
||||||
NavigationView navigationView = findViewById(R.id.nav_view);
|
|
||||||
final View hView = navigationView.getHeaderView(0);
|
|
||||||
|
|
||||||
call.enqueue(new Callback<UserInfo>() {
|
call.enqueue(new Callback<UserInfo>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -443,12 +492,14 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
|
|||||||
if(response.code() == 200) {
|
if(response.code() == 200) {
|
||||||
|
|
||||||
assert userDetails != null;
|
assert userDetails != null;
|
||||||
|
|
||||||
if(userDetails.getIs_admin() != null) {
|
if(userDetails.getIs_admin() != null) {
|
||||||
tinyDb.putBoolean("userIsAdmin", userDetails.getIs_admin());
|
tinyDb.putBoolean("userIsAdmin", userDetails.getIs_admin());
|
||||||
navigationView.getMenu().findItem(R.id.nav_administration).setVisible(userDetails.getIs_admin());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tinyDb.putString("userLogin", userDetails.getLogin());
|
tinyDb.putString("userLogin", userDetails.getLogin());
|
||||||
tinyDb.putInt("userId", userDetails.getId());
|
tinyDb.putInt("userId", userDetails.getId());
|
||||||
|
|
||||||
if(!userDetails.getFullname().equals("")) {
|
if(!userDetails.getFullname().equals("")) {
|
||||||
tinyDb.putString("userFullname", userDetails.getFullname());
|
tinyDb.putString("userFullname", userDetails.getFullname());
|
||||||
}
|
}
|
||||||
@ -458,51 +509,14 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
|
|||||||
|
|
||||||
tinyDb.putString("userEmail", userDetails.getEmail());
|
tinyDb.putString("userEmail", userDetails.getEmail());
|
||||||
tinyDb.putString("userAvatar", userDetails.getAvatar());
|
tinyDb.putString("userAvatar", userDetails.getAvatar());
|
||||||
|
|
||||||
if(userDetails.getLang() != null) {
|
if(userDetails.getLang() != null) {
|
||||||
tinyDb.putString("userLang", userDetails.getLang());
|
tinyDb.putString("userLang", userDetails.getLang());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
tinyDb.putString("userLang", "...");
|
tinyDb.putString("userLang", "...");
|
||||||
}
|
}
|
||||||
|
|
||||||
userAvatar = hView.findViewById(R.id.userAvatar);
|
|
||||||
if(!Objects.requireNonNull(userDetails).getAvatar().equals("")) {
|
|
||||||
PicassoService.getInstance(ctx).get().load(userDetails.getAvatar()).placeholder(R.drawable.loader_animated).transform(new RoundedTransformation(8, 0)).resize(160, 160).centerCrop().into(userAvatar);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
userAvatar.setImageResource(R.mipmap.app_logo_round);
|
|
||||||
}
|
|
||||||
|
|
||||||
userFullName = hView.findViewById(R.id.userFullname);
|
|
||||||
if(!userDetails.getFullname().equals("")) {
|
|
||||||
userFullName.setText(userDetails.getFullname());
|
|
||||||
}
|
|
||||||
else if(!userDetails.getLogin().equals("")) {
|
|
||||||
userFullName.setText(userDetails.getLogin());
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
userFullName.setText("...");
|
|
||||||
}
|
|
||||||
|
|
||||||
userEmail = hView.findViewById(R.id.userEmail);
|
|
||||||
if(!userDetails.getEmail().equals("")) {
|
|
||||||
userEmail.setText(userDetails.getEmail());
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
userEmail.setText("...");
|
|
||||||
}
|
|
||||||
|
|
||||||
userAvatar.setOnClickListener(new View.OnClickListener() {
|
|
||||||
|
|
||||||
public void onClick(View v) {
|
|
||||||
|
|
||||||
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new ProfileFragment()).commit();
|
|
||||||
drawer.closeDrawers();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else if(response.code() == 401) {
|
else if(response.code() == 401) {
|
||||||
|
|
||||||
|
@ -201,7 +201,7 @@ public class SettingsAppearanceActivity extends BaseActivity {
|
|||||||
|
|
||||||
AlertDialog.Builder hsBuilder = new AlertDialog.Builder(SettingsAppearanceActivity.this);
|
AlertDialog.Builder hsBuilder = new AlertDialog.Builder(SettingsAppearanceActivity.this);
|
||||||
|
|
||||||
hsBuilder.setTitle(R.string.settingshomeScreenSelectorDialogTitle);
|
hsBuilder.setTitle(R.string.settingsHomeScreenSelectorDialogTitle);
|
||||||
if(homeScreenSelectedChoice != -1) {
|
if(homeScreenSelectedChoice != -1) {
|
||||||
hsBuilder.setCancelable(true);
|
hsBuilder.setCancelable(true);
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,7 @@ import android.view.View;
|
|||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.CheckBox;
|
import android.widget.CheckBox;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
@ -58,6 +59,7 @@ public class ExploreRepositoriesAdapter extends RecyclerView.Adapter<ExploreRepo
|
|||||||
private TextView repoStars;
|
private TextView repoStars;
|
||||||
private TextView repoForks;
|
private TextView repoForks;
|
||||||
private TextView repoOpenIssuesCount;
|
private TextView repoOpenIssuesCount;
|
||||||
|
private LinearLayout archiveRepo;
|
||||||
|
|
||||||
private ReposSearchViewHolder(View itemView) {
|
private ReposSearchViewHolder(View itemView) {
|
||||||
|
|
||||||
@ -73,6 +75,7 @@ public class ExploreRepositoriesAdapter extends RecyclerView.Adapter<ExploreRepo
|
|||||||
repoForks = itemView.findViewById(R.id.repoForks);
|
repoForks = itemView.findViewById(R.id.repoForks);
|
||||||
repoOpenIssuesCount = itemView.findViewById(R.id.repoOpenIssuesCount);
|
repoOpenIssuesCount = itemView.findViewById(R.id.repoOpenIssuesCount);
|
||||||
ImageView reposDropdownMenu = itemView.findViewById(R.id.reposDropdownMenu);
|
ImageView reposDropdownMenu = itemView.findViewById(R.id.reposDropdownMenu);
|
||||||
|
archiveRepo = itemView.findViewById(R.id.archiveRepoFrame);
|
||||||
|
|
||||||
itemView.setOnClickListener(v -> {
|
itemView.setOnClickListener(v -> {
|
||||||
|
|
||||||
@ -242,6 +245,13 @@ public class ExploreRepositoriesAdapter extends RecyclerView.Adapter<ExploreRepo
|
|||||||
}
|
}
|
||||||
holder.isRepoAdmin.setChecked(currentItem.getPermissions().isAdmin());
|
holder.isRepoAdmin.setChecked(currentItem.getPermissions().isAdmin());
|
||||||
|
|
||||||
|
if(currentItem.isArchived()) {
|
||||||
|
holder.archiveRepo.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
holder.archiveRepo.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -165,6 +165,7 @@ public class FilesAdapter extends RecyclerView.Adapter<FilesAdapter.FilesViewHol
|
|||||||
holder.fileInfo.setText(AppUtil.formatFileSizeInDetail(currentItem.getSize()));
|
holder.fileInfo.setText(AppUtil.formatFileSizeInDetail(currentItem.getSize()));
|
||||||
}
|
}
|
||||||
else if(currentItem.getType().equals("dir")) {
|
else if(currentItem.getType().equals("dir")) {
|
||||||
|
holder.fileInfo.setVisibility(View.GONE);
|
||||||
holder.fileTypeImage.setImageDrawable(mCtx.getResources().getDrawable(R.drawable.ic_folder_24));
|
holder.fileTypeImage.setImageDrawable(mCtx.getResources().getDrawable(R.drawable.ic_folder_24));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -86,7 +86,7 @@ public class FilesDiffAdapter extends BaseAdapter {
|
|||||||
FileDiffView data = (FileDiffView) getItem(position);
|
FileDiffView data = (FileDiffView) getItem(position);
|
||||||
headerFileName.setText(data.getFileName());
|
headerFileName.setText(data.getFileName());
|
||||||
|
|
||||||
if(data.isFileType()) {
|
if(data.isFileBinary()) {
|
||||||
|
|
||||||
diffStats.setVisibility(View.GONE);
|
diffStats.setVisibility(View.GONE);
|
||||||
diffLines.addView(getMessageView(context.getResources().getString(R.string.binaryFileError)));
|
diffLines.addView(getMessageView(context.getResources().getString(R.string.binaryFileError)));
|
||||||
@ -97,7 +97,7 @@ public class FilesDiffAdapter extends BaseAdapter {
|
|||||||
diffStats.setVisibility(View.VISIBLE);
|
diffStats.setVisibility(View.VISIBLE);
|
||||||
headerFileInfo.setText(data.getFileInfo());
|
headerFileInfo.setText(data.getFileInfo());
|
||||||
|
|
||||||
String[] codeLines = getLines(data.getFileContents());
|
String[] codeLines = getLines(data.toString());
|
||||||
|
|
||||||
if(MAXIMUM_LINES > codeLines.length) {
|
if(MAXIMUM_LINES > codeLines.length) {
|
||||||
|
|
||||||
|
@ -2,7 +2,6 @@ package org.mian.gitnex.adapters;
|
|||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.graphics.Color;
|
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.text.Spanned;
|
import android.text.Spanned;
|
||||||
@ -15,7 +14,6 @@ import android.widget.ProgressBar;
|
|||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
import com.amulyakhare.textdrawable.TextDrawable;
|
|
||||||
import com.google.android.material.bottomsheet.BottomSheetDialog;
|
import com.google.android.material.bottomsheet.BottomSheetDialog;
|
||||||
import com.vdurmont.emoji.EmojiParser;
|
import com.vdurmont.emoji.EmojiParser;
|
||||||
import org.mian.gitnex.R;
|
import org.mian.gitnex.R;
|
||||||
@ -56,369 +54,346 @@ import io.noties.markwon.linkify.LinkifyPlugin;
|
|||||||
|
|
||||||
public class MilestonesAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
public class MilestonesAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
||||||
|
|
||||||
private Context context;
|
private Context context;
|
||||||
private final int TYPE_LOAD = 0;
|
private final int TYPE_LOAD = 0;
|
||||||
private List<Milestones> dataList;
|
private List<Milestones> dataList;
|
||||||
private OnLoadMoreListener loadMoreListener;
|
private OnLoadMoreListener loadMoreListener;
|
||||||
private boolean isLoading = false;
|
private boolean isLoading = false;
|
||||||
private boolean isMoreDataAvailable = true;
|
private boolean isMoreDataAvailable = true;
|
||||||
private String TAG = StaticGlobalVariables.tagMilestonesAdapter;
|
private String TAG = StaticGlobalVariables.tagMilestonesAdapter;
|
||||||
|
|
||||||
public MilestonesAdapter(Context context, List<Milestones> dataListMain) {
|
public MilestonesAdapter(Context context, List<Milestones> dataListMain) {
|
||||||
|
|
||||||
this.context = context;
|
this.context = context;
|
||||||
this.dataList = dataListMain;
|
this.dataList = dataListMain;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
|
|
||||||
LayoutInflater inflater = LayoutInflater.from(context);
|
LayoutInflater inflater = LayoutInflater.from(context);
|
||||||
|
|
||||||
if(viewType == TYPE_LOAD) {
|
if(viewType == TYPE_LOAD) {
|
||||||
return new MilestonesAdapter.DataHolder(inflater.inflate(R.layout.list_milestones, parent, false));
|
return new MilestonesAdapter.DataHolder(inflater.inflate(R.layout.list_milestones, parent, false));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return new MilestonesAdapter.LoadHolder(inflater.inflate(R.layout.row_load, parent, false));
|
return new MilestonesAdapter.LoadHolder(inflater.inflate(R.layout.row_load, parent, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||||
|
|
||||||
if(position >= getItemCount() - 1 && isMoreDataAvailable && !isLoading && loadMoreListener != null) {
|
if(position >= getItemCount() - 1 && isMoreDataAvailable && !isLoading && loadMoreListener != null) {
|
||||||
|
|
||||||
isLoading = true;
|
isLoading = true;
|
||||||
loadMoreListener.onLoadMore();
|
loadMoreListener.onLoadMore();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(getItemViewType(position) == TYPE_LOAD) {
|
if(getItemViewType(position) == TYPE_LOAD) {
|
||||||
|
|
||||||
((MilestonesAdapter.DataHolder) holder).bindData(dataList.get(position));
|
((MilestonesAdapter.DataHolder) holder).bindData(dataList.get(position));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class DataHolder extends RecyclerView.ViewHolder {
|
class DataHolder extends RecyclerView.ViewHolder {
|
||||||
|
|
||||||
private TextView milestoneId;
|
private TextView milestoneId;
|
||||||
private TextView msTitle;
|
private TextView msTitle;
|
||||||
private TextView msDescription;
|
private TextView msDescription;
|
||||||
private TextView msOpenIssues;
|
private TextView msOpenIssues;
|
||||||
private TextView msClosedIssues;
|
private TextView msClosedIssues;
|
||||||
private TextView msDueDate;
|
private TextView msDueDate;
|
||||||
private ImageView msStatus;
|
private ProgressBar msProgress;
|
||||||
private ProgressBar msProgress;
|
private TextView milestoneStatus;
|
||||||
private TextView milestoneStatus;
|
|
||||||
|
|
||||||
DataHolder(View itemView) {
|
DataHolder(View itemView) {
|
||||||
|
|
||||||
super(itemView);
|
super(itemView);
|
||||||
|
|
||||||
milestoneId = itemView.findViewById(R.id.milestoneId);
|
milestoneId = itemView.findViewById(R.id.milestoneId);
|
||||||
msTitle = itemView.findViewById(R.id.milestoneTitle);
|
msTitle = itemView.findViewById(R.id.milestoneTitle);
|
||||||
msStatus = itemView.findViewById(R.id.milestoneState);
|
msDescription = itemView.findViewById(R.id.milestoneDescription);
|
||||||
msDescription = itemView.findViewById(R.id.milestoneDescription);
|
msOpenIssues = itemView.findViewById(R.id.milestoneIssuesOpen);
|
||||||
msOpenIssues = itemView.findViewById(R.id.milestoneIssuesOpen);
|
msClosedIssues = itemView.findViewById(R.id.milestoneIssuesClosed);
|
||||||
msClosedIssues = itemView.findViewById(R.id.milestoneIssuesClosed);
|
msDueDate = itemView.findViewById(R.id.milestoneDueDate);
|
||||||
msDueDate = itemView.findViewById(R.id.milestoneDueDate);
|
msProgress = itemView.findViewById(R.id.milestoneProgress);
|
||||||
msProgress = itemView.findViewById(R.id.milestoneProgress);
|
ImageView milestonesMenu = itemView.findViewById(R.id.milestonesMenu);
|
||||||
ImageView milestonesMenu = itemView.findViewById(R.id.milestonesMenu);
|
milestoneStatus = itemView.findViewById(R.id.milestoneStatus);
|
||||||
milestoneStatus = itemView.findViewById(R.id.milestoneStatus);
|
|
||||||
|
|
||||||
milestonesMenu.setOnClickListener(v -> {
|
milestonesMenu.setOnClickListener(v -> {
|
||||||
|
|
||||||
Context ctx = v.getContext();
|
Context ctx = v.getContext();
|
||||||
int milestoneId_ = Integer.parseInt(milestoneId.getText().toString());
|
int milestoneId_ = Integer.parseInt(milestoneId.getText().toString());
|
||||||
|
|
||||||
@SuppressLint("InflateParams") View view = LayoutInflater.from(ctx).inflate(R.layout.bottom_sheet_milestones_in_list, null);
|
@SuppressLint("InflateParams") View view = LayoutInflater.from(ctx).inflate(R.layout.bottom_sheet_milestones_in_list, null);
|
||||||
|
|
||||||
TextView closeMilestone = view.findViewById(R.id.closeMilestone);
|
TextView closeMilestone = view.findViewById(R.id.closeMilestone);
|
||||||
TextView openMilestone = view.findViewById(R.id.openMilestone);
|
TextView openMilestone = view.findViewById(R.id.openMilestone);
|
||||||
|
|
||||||
BottomSheetDialog dialog = new BottomSheetDialog(ctx);
|
BottomSheetDialog dialog = new BottomSheetDialog(ctx);
|
||||||
dialog.setContentView(view);
|
dialog.setContentView(view);
|
||||||
dialog.show();
|
dialog.show();
|
||||||
|
|
||||||
if(milestoneStatus.getText().toString().equals("open")) {
|
if(milestoneStatus.getText().toString().equals("open")) {
|
||||||
|
|
||||||
closeMilestone.setVisibility(View.VISIBLE);
|
closeMilestone.setVisibility(View.VISIBLE);
|
||||||
openMilestone.setVisibility(View.GONE);
|
openMilestone.setVisibility(View.GONE);
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
closeMilestone.setVisibility(View.GONE);
|
closeMilestone.setVisibility(View.GONE);
|
||||||
openMilestone.setVisibility(View.VISIBLE);
|
openMilestone.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
closeMilestone.setOnClickListener(v12 -> {
|
closeMilestone.setOnClickListener(v12 -> {
|
||||||
|
|
||||||
MilestoneActions.closeMilestone(ctx, milestoneId_);
|
MilestoneActions.closeMilestone(ctx, milestoneId_);
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
updateAdapter(getAdapterPosition());
|
updateAdapter(getAdapterPosition());
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
openMilestone.setOnClickListener(v12 -> {
|
openMilestone.setOnClickListener(v12 -> {
|
||||||
|
|
||||||
MilestoneActions.openMilestone(ctx, milestoneId_);
|
MilestoneActions.openMilestone(ctx, milestoneId_);
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
updateAdapter(getAdapterPosition());
|
updateAdapter(getAdapterPosition());
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("SetTextI18n")
|
|
||||||
void bindData(Milestones dataModel) {
|
|
||||||
|
|
||||||
final TinyDB tinyDb = new TinyDB(context);
|
|
||||||
final String locale = tinyDb.getString("locale");
|
|
||||||
final String timeFormat = tinyDb.getString("dateFormat");
|
|
||||||
|
|
||||||
milestoneId.setText(String.valueOf(dataModel.getId()));
|
@SuppressLint("SetTextI18n")
|
||||||
milestoneStatus.setText(dataModel.getState());
|
void bindData(Milestones dataModel) {
|
||||||
|
|
||||||
final Markwon markwon = Markwon.builder(Objects.requireNonNull(context))
|
final TinyDB tinyDb = new TinyDB(context);
|
||||||
.usePlugin(CorePlugin.create())
|
final String locale = tinyDb.getString("locale");
|
||||||
.usePlugin(ImagesPlugin.create(plugin -> {
|
final String timeFormat = tinyDb.getString("dateFormat");
|
||||||
plugin.addSchemeHandler(new SchemeHandler() {
|
|
||||||
@NonNull
|
|
||||||
@Override
|
|
||||||
public ImageItem handle(@NonNull String raw, @NonNull Uri uri) {
|
|
||||||
|
|
||||||
final int resourceId = context.getResources().getIdentifier(
|
|
||||||
raw.substring("drawable://".length()),
|
|
||||||
"drawable",
|
|
||||||
context.getPackageName());
|
|
||||||
|
|
||||||
final Drawable drawable = context.getDrawable(resourceId);
|
|
||||||
|
|
||||||
assert drawable != null;
|
|
||||||
return ImageItem.withResult(drawable);
|
|
||||||
}
|
|
||||||
|
|
||||||
@NonNull
|
|
||||||
@Override
|
|
||||||
public Collection<String> supportedSchemes() {
|
|
||||||
return Collections.singleton("drawable");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
plugin.placeholderProvider(drawable -> null);
|
|
||||||
plugin.addMediaDecoder(GifMediaDecoder.create(false));
|
|
||||||
plugin.addMediaDecoder(SvgMediaDecoder.create(context.getResources()));
|
|
||||||
plugin.addMediaDecoder(SvgMediaDecoder.create());
|
|
||||||
plugin.defaultMediaDecoder(DefaultMediaDecoder.create(context.getResources()));
|
|
||||||
plugin.defaultMediaDecoder(DefaultMediaDecoder.create());
|
|
||||||
}))
|
|
||||||
.usePlugin(new AbstractMarkwonPlugin() {
|
|
||||||
@Override
|
|
||||||
public void configureTheme(@NonNull MarkwonTheme.Builder builder) {
|
|
||||||
builder
|
|
||||||
.codeTextColor(tinyDb.getInt("codeBlockColor"))
|
|
||||||
.codeBackgroundColor(tinyDb.getInt("codeBlockBackground"))
|
|
||||||
.linkColor(context.getResources().getColor(R.color.lightBlue));
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.usePlugin(TablePlugin.create(context))
|
|
||||||
.usePlugin(TaskListPlugin.create(context))
|
|
||||||
.usePlugin(HtmlPlugin.create())
|
|
||||||
.usePlugin(StrikethroughPlugin.create())
|
|
||||||
.usePlugin(LinkifyPlugin.create())
|
|
||||||
.build();
|
|
||||||
|
|
||||||
Spanned msTitle_ = markwon.toMarkdown(dataModel.getTitle());
|
|
||||||
markwon.setParsedMarkdown(msTitle, msTitle_);
|
|
||||||
|
|
||||||
if(dataModel.getState().equals("open")) {
|
|
||||||
|
|
||||||
@SuppressLint("ResourceType") int color = Color.parseColor(context.getResources().getString(R.color.releaseStable));
|
|
||||||
TextDrawable drawable = TextDrawable.builder()
|
|
||||||
.beginConfig()
|
|
||||||
//.useFont(Typeface.DEFAULT)
|
|
||||||
.textColor(context.getResources().getColor(R.color.white))
|
|
||||||
.fontSize(30)
|
|
||||||
.toUpperCase()
|
|
||||||
.width(120)
|
|
||||||
.height(60)
|
|
||||||
.endConfig()
|
|
||||||
.buildRoundRect("open", color, 8);
|
|
||||||
|
|
||||||
msStatus.setImageDrawable(drawable);
|
|
||||||
|
|
||||||
}
|
|
||||||
else if(dataModel.getState().equals("closed")) {
|
|
||||||
|
|
||||||
@SuppressLint("ResourceType") int color = Color.parseColor(context.getResources().getString(R.color.colorRed));
|
|
||||||
TextDrawable drawable = TextDrawable.builder()
|
|
||||||
.beginConfig()
|
|
||||||
//.useFont(Typeface.DEFAULT)
|
|
||||||
.textColor(context.getResources().getColor(R.color.white))
|
|
||||||
.fontSize(30)
|
|
||||||
.toUpperCase()
|
|
||||||
.width(140)
|
|
||||||
.height(60)
|
|
||||||
.endConfig()
|
|
||||||
.buildRoundRect("closed", color, 8);
|
|
||||||
|
|
||||||
msStatus.setImageDrawable(drawable);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!dataModel.getDescription().equals("")) {
|
|
||||||
final CharSequence bodyWithMD = markwon.toMarkdown(EmojiParser.parseToUnicode(dataModel.getDescription()));
|
|
||||||
msDescription.setText(bodyWithMD);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
msDescription.setText("");
|
|
||||||
}
|
|
||||||
|
|
||||||
msOpenIssues.setText(String.valueOf(dataModel.getOpen_issues()));
|
|
||||||
msOpenIssues.setOnClickListener(new ClickListener(context.getResources().getString(R.string.milestoneOpenIssues, dataModel.getOpen_issues()), context));
|
|
||||||
|
|
||||||
msClosedIssues.setText(String.valueOf(dataModel.getClosed_issues()));
|
|
||||||
msClosedIssues.setOnClickListener(new ClickListener(context.getResources().getString(R.string.milestoneClosedIssues, dataModel.getClosed_issues()), context));
|
|
||||||
|
|
||||||
if ((dataModel.getOpen_issues() + dataModel.getClosed_issues()) > 0) {
|
|
||||||
|
|
||||||
if (dataModel.getOpen_issues() == 0) {
|
|
||||||
msProgress.setProgress(100);
|
|
||||||
msProgress.setOnClickListener(new ClickListener(context.getResources().getString(R.string.milestoneCompletion, 100), context));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
int msCompletion = 100 * dataModel.getClosed_issues() / (dataModel.getOpen_issues() + dataModel.getClosed_issues());
|
|
||||||
msProgress.setOnClickListener(new ClickListener(context.getResources().getString(R.string.milestoneCompletion, msCompletion), context));
|
|
||||||
msProgress.setProgress(msCompletion);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
msProgress.setProgress(0);
|
|
||||||
msProgress.setOnClickListener(new ClickListener(context.getResources().getString(R.string.milestoneCompletion, 0), context));
|
|
||||||
}
|
|
||||||
|
|
||||||
if(dataModel.getDue_on() != null) {
|
|
||||||
|
|
||||||
if (timeFormat.equals("normal") || timeFormat.equals("pretty")) {
|
|
||||||
|
|
||||||
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd", new Locale(locale));
|
|
||||||
Date date = null;
|
|
||||||
try {
|
|
||||||
date = formatter.parse(dataModel.getDue_on());
|
|
||||||
}
|
|
||||||
catch (ParseException e) {
|
|
||||||
Log.e(TAG, e.toString());
|
|
||||||
}
|
|
||||||
assert date != null;
|
|
||||||
String dueDate = formatter.format(date);
|
|
||||||
|
|
||||||
if(date.before(new Date())) {
|
milestoneId.setText(String.valueOf(dataModel.getId()));
|
||||||
msDueDate.setTextColor(context.getResources().getColor(R.color.darkRed));
|
milestoneStatus.setText(dataModel.getState());
|
||||||
}
|
|
||||||
|
|
||||||
msDueDate.setText(dueDate);
|
Markwon markwon = Markwon.builder(Objects.requireNonNull(context)).usePlugin(CorePlugin.create()).usePlugin(ImagesPlugin.create(plugin -> {
|
||||||
msDueDate.setOnClickListener(new ClickListener(TimeHelper.customDateFormatForToast(dataModel.getDue_on()), context));
|
plugin.addSchemeHandler(new SchemeHandler() {
|
||||||
|
|
||||||
}
|
@NonNull
|
||||||
else if (timeFormat.equals("normal1")) {
|
@Override
|
||||||
|
public ImageItem handle(@NonNull String raw, @NonNull Uri uri) {
|
||||||
|
|
||||||
SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-yyyy", new Locale(locale));
|
final int resourceId = context.getResources().getIdentifier(
|
||||||
Date date1 = null;
|
raw.substring("drawable://".length()),
|
||||||
try {
|
"drawable",
|
||||||
date1 = formatter.parse(dataModel.getDue_on());
|
context.getPackageName());
|
||||||
}
|
|
||||||
catch (ParseException e) {
|
|
||||||
Log.e(TAG, e.toString());
|
|
||||||
}
|
|
||||||
assert date1 != null;
|
|
||||||
String dueDate = formatter.format(date1);
|
|
||||||
msDueDate.setText(dueDate);
|
|
||||||
|
|
||||||
}
|
final Drawable drawable = context.getDrawable(resourceId);
|
||||||
|
|
||||||
}
|
assert drawable != null;
|
||||||
else {
|
return ImageItem.withResult(drawable);
|
||||||
msDueDate.setText("");
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public Collection<String> supportedSchemes() {
|
||||||
|
return Collections.singleton("drawable");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
}
|
plugin.placeholderProvider(drawable -> null);
|
||||||
|
plugin.addMediaDecoder(GifMediaDecoder.create(false));
|
||||||
|
plugin.addMediaDecoder(SvgMediaDecoder.create(context.getResources()));
|
||||||
|
plugin.addMediaDecoder(SvgMediaDecoder.create());
|
||||||
|
plugin.defaultMediaDecoder(DefaultMediaDecoder.create(context.getResources()));
|
||||||
|
plugin.defaultMediaDecoder(DefaultMediaDecoder.create());
|
||||||
|
|
||||||
private void updateAdapter(int position) {
|
}))
|
||||||
|
|
||||||
dataList.remove(position);
|
.usePlugin(new AbstractMarkwonPlugin() {
|
||||||
notifyItemRemoved(position);
|
@Override
|
||||||
notifyItemRangeChanged(position, dataList.size());
|
public void configureTheme(@NonNull MarkwonTheme.Builder builder) {
|
||||||
|
builder
|
||||||
|
.codeTextColor(tinyDb.getInt("codeBlockColor"))
|
||||||
|
.codeBackgroundColor(tinyDb.getInt("codeBlockBackground"))
|
||||||
|
.linkColor(context.getResources().getColor(R.color.lightBlue));
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.usePlugin(TablePlugin.create(context))
|
||||||
|
.usePlugin(TaskListPlugin.create(context))
|
||||||
|
.usePlugin(HtmlPlugin.create())
|
||||||
|
.usePlugin(StrikethroughPlugin.create())
|
||||||
|
.usePlugin(LinkifyPlugin.create())
|
||||||
|
.build();
|
||||||
|
|
||||||
}
|
Spanned msTitle_ = markwon.toMarkdown(dataModel.getTitle());
|
||||||
|
markwon.setParsedMarkdown(msTitle, msTitle_);
|
||||||
|
|
||||||
@Override
|
if(!dataModel.getDescription().equals("")) {
|
||||||
public int getItemViewType(int position) {
|
|
||||||
|
|
||||||
if(dataList.get(position).getTitle() != null) {
|
CharSequence bodyWithMD = markwon.toMarkdown(EmojiParser.parseToUnicode(dataModel.getDescription()));
|
||||||
return TYPE_LOAD;
|
msDescription.setText(bodyWithMD);
|
||||||
}
|
|
||||||
else {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
|
||||||
@Override
|
msDescription.setText(context.getString(R.string.milestoneNoDescription));
|
||||||
public int getItemCount() {
|
}
|
||||||
|
|
||||||
return dataList.size();
|
msOpenIssues.setText(context.getString(R.string.milestoneIssueStatusOpen, dataModel.getOpen_issues()));
|
||||||
|
msClosedIssues.setText(context.getString(R.string.milestoneIssueStatusClosed, dataModel.getClosed_issues()));
|
||||||
|
|
||||||
}
|
if((dataModel.getOpen_issues() + dataModel.getClosed_issues()) > 0) {
|
||||||
|
|
||||||
static class LoadHolder extends RecyclerView.ViewHolder {
|
if(dataModel.getOpen_issues() == 0) {
|
||||||
|
|
||||||
LoadHolder(View itemView) {
|
msProgress.setProgress(100);
|
||||||
|
msProgress.setOnClickListener(new ClickListener(context.getResources().getString(R.string.milestoneCompletion, 100), context));
|
||||||
|
|
||||||
super(itemView);
|
}
|
||||||
}
|
else {
|
||||||
|
|
||||||
}
|
int msCompletion = 100 * dataModel.getClosed_issues() / (dataModel.getOpen_issues() + dataModel.getClosed_issues());
|
||||||
|
msProgress.setOnClickListener(new ClickListener(context.getResources().getString(R.string.milestoneCompletion, msCompletion), context));
|
||||||
|
msProgress.setProgress(msCompletion);
|
||||||
|
|
||||||
public void setMoreDataAvailable(boolean moreDataAvailable) {
|
}
|
||||||
|
|
||||||
isMoreDataAvailable = moreDataAvailable;
|
}
|
||||||
|
else {
|
||||||
|
|
||||||
}
|
msProgress.setProgress(0);
|
||||||
|
msProgress.setOnClickListener(new ClickListener(context.getResources().getString(R.string.milestoneCompletion, 0), context));
|
||||||
|
|
||||||
public void notifyDataChanged() {
|
}
|
||||||
|
|
||||||
notifyDataSetChanged();
|
if(dataModel.getDue_on() != null) {
|
||||||
isLoading = false;
|
|
||||||
|
|
||||||
}
|
if(timeFormat.equals("normal") || timeFormat.equals("pretty")) {
|
||||||
|
|
||||||
public interface OnLoadMoreListener {
|
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd", new Locale(locale));
|
||||||
|
Date date = null;
|
||||||
|
|
||||||
void onLoadMore();
|
try {
|
||||||
|
date = formatter.parse(dataModel.getDue_on());
|
||||||
|
}
|
||||||
|
catch(ParseException e) {
|
||||||
|
Log.e(TAG, e.toString());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
assert date != null;
|
||||||
|
String dueDate = formatter.format(date);
|
||||||
|
|
||||||
public void setLoadMoreListener(OnLoadMoreListener loadMoreListener) {
|
if(date.before(new Date())) {
|
||||||
|
msDueDate.setTextColor(context.getResources().getColor(R.color.darkRed));
|
||||||
|
}
|
||||||
|
|
||||||
this.loadMoreListener = loadMoreListener;
|
msDueDate.setText(dueDate);
|
||||||
|
msDueDate.setOnClickListener(new ClickListener(TimeHelper.customDateFormatForToast(dataModel.getDue_on()), context));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
else if(timeFormat.equals("normal1")) {
|
||||||
|
|
||||||
public void updateList(List<Milestones> list) {
|
SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-yyyy", new Locale(locale));
|
||||||
|
|
||||||
dataList = list;
|
Date date1 = null;
|
||||||
notifyDataSetChanged();
|
|
||||||
}
|
try {
|
||||||
|
date1 = formatter.parse(dataModel.getDue_on());
|
||||||
|
}
|
||||||
|
catch(ParseException e) {
|
||||||
|
Log.e(TAG, e.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
assert date1 != null;
|
||||||
|
String dueDate = formatter.format(date1);
|
||||||
|
msDueDate.setText(dueDate);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
|
||||||
|
msDueDate.setText(context.getString(R.string.milestoneNoDueDate));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateAdapter(int position) {
|
||||||
|
|
||||||
|
dataList.remove(position);
|
||||||
|
notifyItemRemoved(position);
|
||||||
|
notifyItemRangeChanged(position, dataList.size());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemViewType(int position) {
|
||||||
|
|
||||||
|
if(dataList.get(position).getTitle() != null) {
|
||||||
|
return TYPE_LOAD;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
|
||||||
|
return dataList.size();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static class LoadHolder extends RecyclerView.ViewHolder {
|
||||||
|
|
||||||
|
LoadHolder(View itemView) {
|
||||||
|
|
||||||
|
super(itemView);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMoreDataAvailable(boolean moreDataAvailable) {
|
||||||
|
|
||||||
|
isMoreDataAvailable = moreDataAvailable;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void notifyDataChanged() {
|
||||||
|
|
||||||
|
notifyDataSetChanged();
|
||||||
|
isLoading = false;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface OnLoadMoreListener {
|
||||||
|
|
||||||
|
void onLoadMore();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLoadMoreListener(OnLoadMoreListener loadMoreListener) {
|
||||||
|
|
||||||
|
this.loadMoreListener = loadMoreListener;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void updateList(List<Milestones> list) {
|
||||||
|
|
||||||
|
dataList = list;
|
||||||
|
notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,7 @@ import android.widget.CheckBox;
|
|||||||
import android.widget.Filter;
|
import android.widget.Filter;
|
||||||
import android.widget.Filterable;
|
import android.widget.Filterable;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import com.amulyakhare.textdrawable.TextDrawable;
|
import com.amulyakhare.textdrawable.TextDrawable;
|
||||||
import com.amulyakhare.textdrawable.util.ColorGenerator;
|
import com.amulyakhare.textdrawable.util.ColorGenerator;
|
||||||
@ -56,6 +57,7 @@ public class MyReposListAdapter extends RecyclerView.Adapter<MyReposListAdapter.
|
|||||||
private TextView repoOpenIssuesCount;
|
private TextView repoOpenIssuesCount;
|
||||||
private TextView repoType;
|
private TextView repoType;
|
||||||
private CheckBox isRepoAdmin;
|
private CheckBox isRepoAdmin;
|
||||||
|
private LinearLayout archiveRepo;
|
||||||
|
|
||||||
private MyReposViewHolder(View itemView) {
|
private MyReposViewHolder(View itemView) {
|
||||||
super(itemView);
|
super(itemView);
|
||||||
@ -70,6 +72,7 @@ public class MyReposListAdapter extends RecyclerView.Adapter<MyReposListAdapter.
|
|||||||
ImageView reposDropdownMenu = itemView.findViewById(R.id.reposDropdownMenu);
|
ImageView reposDropdownMenu = itemView.findViewById(R.id.reposDropdownMenu);
|
||||||
repoType = itemView.findViewById(R.id.repoType);
|
repoType = itemView.findViewById(R.id.repoType);
|
||||||
isRepoAdmin = itemView.findViewById(R.id.repoIsAdmin);
|
isRepoAdmin = itemView.findViewById(R.id.repoIsAdmin);
|
||||||
|
archiveRepo = itemView.findViewById(R.id.archiveRepoFrame);
|
||||||
|
|
||||||
itemView.setOnClickListener(v -> {
|
itemView.setOnClickListener(v -> {
|
||||||
|
|
||||||
@ -252,6 +255,13 @@ public class MyReposListAdapter extends RecyclerView.Adapter<MyReposListAdapter.
|
|||||||
}
|
}
|
||||||
holder.isRepoAdmin.setChecked(currentItem.getPermissions().isAdmin());
|
holder.isRepoAdmin.setChecked(currentItem.getPermissions().isAdmin());
|
||||||
|
|
||||||
|
if(currentItem.isArchived()) {
|
||||||
|
holder.archiveRepo.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
holder.archiveRepo.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -188,9 +188,11 @@ public class PullRequestsAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
|
|||||||
|
|
||||||
prNumber.setText(String.valueOf(prModel.getNumber()));
|
prNumber.setText(String.valueOf(prModel.getNumber()));
|
||||||
prMergeable.setText(String.valueOf(prModel.isMergeable()));
|
prMergeable.setText(String.valueOf(prModel.isMergeable()));
|
||||||
prHeadBranch.setText(prModel.getHead().getRef());
|
if(prModel.getHead() != null) {
|
||||||
prIsFork.setText(String.valueOf(prModel.getHead().getRepo().isFork()));
|
prHeadBranch.setText(prModel.getHead().getRef());
|
||||||
prForkFullName.setText(prModel.getHead().getRepo().getFull_name());
|
prIsFork.setText(String.valueOf(prModel.getHead().getRepo().isFork()));
|
||||||
|
prForkFullName.setText(prModel.getHead().getRepo().getFull_name());
|
||||||
|
}
|
||||||
prCommentsCount.setText(String.valueOf(prModel.getComments()));
|
prCommentsCount.setText(String.valueOf(prModel.getComments()));
|
||||||
|
|
||||||
prCreatedTime.setText(TimeHelper.formatTime(prModel.getCreated_at(), new Locale(locale), timeFormat, context));
|
prCreatedTime.setText(TimeHelper.formatTime(prModel.getCreated_at(), new Locale(locale), timeFormat, context));
|
||||||
|
@ -10,19 +10,25 @@ import android.view.LayoutInflater;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.RelativeLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import com.amulyakhare.textdrawable.TextDrawable;
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
import com.vdurmont.emoji.EmojiParser;
|
import com.vdurmont.emoji.EmojiParser;
|
||||||
import org.mian.gitnex.R;
|
import org.mian.gitnex.R;
|
||||||
|
import org.mian.gitnex.clients.PicassoService;
|
||||||
|
import org.mian.gitnex.helpers.ClickListener;
|
||||||
|
import org.mian.gitnex.helpers.RoundedTransformation;
|
||||||
|
import org.mian.gitnex.helpers.TimeHelper;
|
||||||
import org.mian.gitnex.models.Releases;
|
import org.mian.gitnex.models.Releases;
|
||||||
import org.mian.gitnex.util.TinyDB;
|
import org.mian.gitnex.util.TinyDB;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import androidx.annotation.Nullable;
|
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
|
||||||
import io.noties.markwon.AbstractMarkwonPlugin;
|
import io.noties.markwon.AbstractMarkwonPlugin;
|
||||||
import io.noties.markwon.Markwon;
|
import io.noties.markwon.Markwon;
|
||||||
import io.noties.markwon.core.CorePlugin;
|
import io.noties.markwon.core.CorePlugin;
|
||||||
@ -31,7 +37,6 @@ import io.noties.markwon.ext.strikethrough.StrikethroughPlugin;
|
|||||||
import io.noties.markwon.ext.tables.TablePlugin;
|
import io.noties.markwon.ext.tables.TablePlugin;
|
||||||
import io.noties.markwon.ext.tasklist.TaskListPlugin;
|
import io.noties.markwon.ext.tasklist.TaskListPlugin;
|
||||||
import io.noties.markwon.html.HtmlPlugin;
|
import io.noties.markwon.html.HtmlPlugin;
|
||||||
import io.noties.markwon.image.AsyncDrawable;
|
|
||||||
import io.noties.markwon.image.DefaultMediaDecoder;
|
import io.noties.markwon.image.DefaultMediaDecoder;
|
||||||
import io.noties.markwon.image.ImageItem;
|
import io.noties.markwon.image.ImageItem;
|
||||||
import io.noties.markwon.image.ImagesPlugin;
|
import io.noties.markwon.image.ImagesPlugin;
|
||||||
@ -49,25 +54,44 @@ public class ReleasesAdapter extends RecyclerView.Adapter<ReleasesAdapter.Releas
|
|||||||
private List<Releases> releasesList;
|
private List<Releases> releasesList;
|
||||||
private Context mCtx;
|
private Context mCtx;
|
||||||
|
|
||||||
static class ReleasesViewHolder extends RecyclerView.ViewHolder {
|
static class ReleasesViewHolder extends RecyclerView.ViewHolder {
|
||||||
|
|
||||||
private ImageView releaseType;
|
private TextView releaseType;
|
||||||
private TextView releaseTitle;
|
private TextView releaseName;
|
||||||
private TextView releaseDescription;
|
private ImageView authorAvatar;
|
||||||
private TextView releaseDownload;
|
private TextView authorName;
|
||||||
private TextView releaseZipDownload;
|
|
||||||
private TextView releaseTarDownload;
|
|
||||||
private TextView releaseTag;
|
private TextView releaseTag;
|
||||||
|
private TextView releaseCommitSha;
|
||||||
|
private TextView releaseDate;
|
||||||
|
private TextView releaseBodyContent;
|
||||||
|
private LinearLayout downloadFrame;
|
||||||
|
private RelativeLayout downloads;
|
||||||
|
private TextView releaseZipDownload;
|
||||||
|
private TextView releaseTarDownload;
|
||||||
|
private ImageView downloadDropdownIcon;
|
||||||
|
private RecyclerView downloadList;
|
||||||
|
|
||||||
private ReleasesViewHolder(View itemView) {
|
private ReleasesViewHolder(View itemView) {
|
||||||
|
|
||||||
super(itemView);
|
super(itemView);
|
||||||
|
|
||||||
releaseType = itemView.findViewById(R.id.releaseType);
|
releaseType = itemView.findViewById(R.id.releaseType);
|
||||||
releaseTitle = itemView.findViewById(R.id.releaseTitle);
|
releaseName = itemView.findViewById(R.id.releaseName);
|
||||||
releaseDescription = itemView.findViewById(R.id.releaseDescription);
|
authorAvatar = itemView.findViewById(R.id.authorAvatar);
|
||||||
releaseZipDownload = itemView.findViewById(R.id.releaseZipDownload);
|
authorName = itemView.findViewById(R.id.authorName);
|
||||||
releaseTarDownload = itemView.findViewById(R.id.releaseTarDownload);
|
releaseTag = itemView.findViewById(R.id.releaseTag);
|
||||||
releaseTag = itemView.findViewById(R.id.releaseTag);
|
releaseCommitSha = itemView.findViewById(R.id.releaseCommitSha);
|
||||||
|
releaseDate = itemView.findViewById(R.id.releaseDate);
|
||||||
|
releaseBodyContent = itemView.findViewById(R.id.releaseBodyContent);
|
||||||
|
downloadFrame = itemView.findViewById(R.id.downloadFrame);
|
||||||
|
downloads = itemView.findViewById(R.id.downloads);
|
||||||
|
releaseZipDownload = itemView.findViewById(R.id.releaseZipDownload);
|
||||||
|
releaseTarDownload = itemView.findViewById(R.id.releaseTarDownload);
|
||||||
|
downloadDropdownIcon = itemView.findViewById(R.id.downloadDropdownIcon);
|
||||||
|
downloadList = itemView.findViewById(R.id.downloadList);
|
||||||
|
|
||||||
|
downloadList.setHasFixedSize(true);
|
||||||
|
downloadList.setLayoutManager(new LinearLayoutManager(itemView.getContext()));
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -88,83 +112,74 @@ public class ReleasesAdapter extends RecyclerView.Adapter<ReleasesAdapter.Releas
|
|||||||
public void onBindViewHolder(@NonNull ReleasesAdapter.ReleasesViewHolder holder, int position) {
|
public void onBindViewHolder(@NonNull ReleasesAdapter.ReleasesViewHolder holder, int position) {
|
||||||
|
|
||||||
final TinyDB tinyDb = new TinyDB(mCtx);
|
final TinyDB tinyDb = new TinyDB(mCtx);
|
||||||
|
final String locale = tinyDb.getString("locale");
|
||||||
|
final String timeFormat = tinyDb.getString("dateFormat");
|
||||||
|
|
||||||
Releases currentItem = releasesList.get(position);
|
Releases currentItem = releasesList.get(position);
|
||||||
|
|
||||||
holder.releaseTitle.setText(currentItem.getName());
|
holder.releaseName.setText(currentItem.getName());
|
||||||
|
|
||||||
if(!currentItem.getTag_name().equals("")) {
|
if(currentItem.isPrerelease()) {
|
||||||
holder.releaseTag.setText(mCtx.getResources().getString(R.string.releaseTag, currentItem.getTag_name()));
|
holder.releaseType.setBackgroundResource(R.drawable.shape_pre_release);
|
||||||
}
|
holder.releaseType.setText(R.string.releaseTypePre);
|
||||||
else {
|
}
|
||||||
holder.releaseTag.setVisibility(View.GONE);
|
else if(currentItem.isDraft()) {
|
||||||
}
|
holder.releaseType.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
holder.releaseType.setBackgroundResource(R.drawable.shape_stable_release);
|
||||||
|
holder.releaseType.setText(R.string.releaseTypeStable);
|
||||||
|
}
|
||||||
|
|
||||||
if(currentItem.isPrerelease()) {
|
if(currentItem.getAuthor().getAvatar_url() != null) {
|
||||||
TextDrawable drawable = TextDrawable.builder()
|
PicassoService.getInstance(mCtx).get().load(currentItem.getAuthor().getAvatar_url()).placeholder(R.drawable.loader_animated).transform(new RoundedTransformation(8, 0)).resize(120, 120).centerCrop().into(holder.authorAvatar);
|
||||||
.beginConfig()
|
}
|
||||||
//.useFont(Typeface.DEFAULT)
|
|
||||||
.textColor(mCtx.getResources().getColor(R.color.white))
|
holder.authorName.setText(mCtx.getResources().getString(R.string.releasePublishedBy, currentItem.getAuthor().getUsername()));
|
||||||
.fontSize(34)
|
|
||||||
.width(260)
|
if(currentItem.getTag_name() != null) {
|
||||||
.height(60)
|
holder.releaseTag.setText(currentItem.getTag_name());
|
||||||
.endConfig()
|
}
|
||||||
.buildRoundRect(mCtx.getResources().getString(R.string.releaseTypePre), mCtx.getResources().getColor(R.color.releasePre), 8);
|
|
||||||
holder.releaseType.setImageDrawable(drawable);
|
if(currentItem.getPublished_at() != null) {
|
||||||
}
|
holder.releaseDate.setText(TimeHelper.formatTime(currentItem.getPublished_at(), new Locale(locale), timeFormat, mCtx));
|
||||||
else {
|
}
|
||||||
TextDrawable drawable = TextDrawable.builder()
|
|
||||||
.beginConfig()
|
if(timeFormat.equals("pretty")) {
|
||||||
//.useFont(Typeface.DEFAULT)
|
holder.releaseDate.setOnClickListener(new ClickListener(TimeHelper.customDateFormatForToastDateFormat(currentItem.getPublished_at()), mCtx));
|
||||||
.textColor(mCtx.getResources().getColor(R.color.white))
|
}
|
||||||
.fontSize(34)
|
|
||||||
.width(260)
|
|
||||||
.height(60)
|
|
||||||
.endConfig()
|
|
||||||
.buildRoundRect(mCtx.getResources().getString(R.string.releaseTypeStable), mCtx.getResources().getColor(R.color.releaseStable), 8);
|
|
||||||
holder.releaseType.setImageDrawable(drawable);
|
|
||||||
}
|
|
||||||
|
|
||||||
final Markwon markwon = Markwon.builder(Objects.requireNonNull(mCtx))
|
final Markwon markwon = Markwon.builder(Objects.requireNonNull(mCtx))
|
||||||
.usePlugin(CorePlugin.create())
|
.usePlugin(CorePlugin.create())
|
||||||
.usePlugin(ImagesPlugin.create(new ImagesPlugin.ImagesConfigure() {
|
.usePlugin(ImagesPlugin.create(plugin -> {
|
||||||
@Override
|
plugin.addSchemeHandler(new SchemeHandler() {
|
||||||
public void configureImages(@NonNull ImagesPlugin plugin) {
|
@NonNull
|
||||||
plugin.addSchemeHandler(new SchemeHandler() {
|
@Override
|
||||||
@NonNull
|
public ImageItem handle(@NonNull String raw, @NonNull Uri uri) {
|
||||||
@Override
|
|
||||||
public ImageItem handle(@NonNull String raw, @NonNull Uri uri) {
|
|
||||||
|
|
||||||
final int resourceId = mCtx.getResources().getIdentifier(
|
final int resourceId = mCtx.getResources().getIdentifier(
|
||||||
raw.substring("drawable://".length()),
|
raw.substring("drawable://".length()),
|
||||||
"drawable",
|
"drawable",
|
||||||
mCtx.getPackageName());
|
mCtx.getPackageName());
|
||||||
|
|
||||||
final Drawable drawable = mCtx.getDrawable(resourceId);
|
final Drawable drawable = mCtx.getDrawable(resourceId);
|
||||||
|
|
||||||
assert drawable != null;
|
assert drawable != null;
|
||||||
return ImageItem.withResult(drawable);
|
return ImageItem.withResult(drawable);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public Collection<String> supportedSchemes() {
|
public Collection<String> supportedSchemes() {
|
||||||
return Collections.singleton("drawable");
|
return Collections.singleton("drawable");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
plugin.placeholderProvider(new ImagesPlugin.PlaceholderProvider() {
|
plugin.placeholderProvider(drawable -> null);
|
||||||
@Nullable
|
plugin.addMediaDecoder(GifMediaDecoder.create(false));
|
||||||
@Override
|
plugin.addMediaDecoder(SvgMediaDecoder.create(mCtx.getResources()));
|
||||||
public Drawable providePlaceholder(@NonNull AsyncDrawable drawable) {
|
plugin.addMediaDecoder(SvgMediaDecoder.create());
|
||||||
return null;
|
plugin.defaultMediaDecoder(DefaultMediaDecoder.create(mCtx.getResources()));
|
||||||
}
|
plugin.defaultMediaDecoder(DefaultMediaDecoder.create());
|
||||||
});
|
|
||||||
plugin.addMediaDecoder(GifMediaDecoder.create(false));
|
|
||||||
plugin.addMediaDecoder(SvgMediaDecoder.create(mCtx.getResources()));
|
|
||||||
plugin.addMediaDecoder(SvgMediaDecoder.create());
|
|
||||||
plugin.defaultMediaDecoder(DefaultMediaDecoder.create(mCtx.getResources()));
|
|
||||||
plugin.defaultMediaDecoder(DefaultMediaDecoder.create());
|
|
||||||
}
|
|
||||||
}))
|
}))
|
||||||
.usePlugin(new AbstractMarkwonPlugin() {
|
.usePlugin(new AbstractMarkwonPlugin() {
|
||||||
@Override
|
@Override
|
||||||
@ -185,12 +200,29 @@ public class ReleasesAdapter extends RecyclerView.Adapter<ReleasesAdapter.Releas
|
|||||||
Spanned bodyWithMD = markwon.toMarkdown(EmojiParser.parseToUnicode(currentItem.getBody()));
|
Spanned bodyWithMD = markwon.toMarkdown(EmojiParser.parseToUnicode(currentItem.getBody()));
|
||||||
|
|
||||||
if(!currentItem.getBody().equals("")) {
|
if(!currentItem.getBody().equals("")) {
|
||||||
markwon.setParsedMarkdown(holder.releaseDescription, bodyWithMD);
|
markwon.setParsedMarkdown(holder.releaseBodyContent, bodyWithMD);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
holder.releaseDescription.setVisibility(View.GONE);
|
holder.releaseBodyContent.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
holder.downloadFrame.setOnClickListener(v -> {
|
||||||
|
|
||||||
|
if(holder.downloads.getVisibility() == View.GONE) {
|
||||||
|
|
||||||
|
holder.downloadDropdownIcon.setImageResource(R.drawable.ic_arrow_down);
|
||||||
|
holder.downloads.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
|
||||||
|
holder.downloadDropdownIcon.setImageResource(R.drawable.ic_arrow_right);
|
||||||
|
holder.downloads.setVisibility(View.GONE);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
holder.releaseZipDownload.setText(
|
holder.releaseZipDownload.setText(
|
||||||
Html.fromHtml("<a href='" + currentItem.getZipball_url() + "'>" + mCtx.getResources().getString(R.string.zipArchiveDownloadReleasesTab) + "</a> "));
|
Html.fromHtml("<a href='" + currentItem.getZipball_url() + "'>" + mCtx.getResources().getString(R.string.zipArchiveDownloadReleasesTab) + "</a> "));
|
||||||
holder.releaseZipDownload.setMovementMethod(LinkMovementMethod.getInstance());
|
holder.releaseZipDownload.setMovementMethod(LinkMovementMethod.getInstance());
|
||||||
@ -199,6 +231,9 @@ public class ReleasesAdapter extends RecyclerView.Adapter<ReleasesAdapter.Releas
|
|||||||
Html.fromHtml("<a href='" + currentItem.getTarball_url() + "'>" + mCtx.getResources().getString(R.string.tarArchiveDownloadReleasesTab) + "</a> "));
|
Html.fromHtml("<a href='" + currentItem.getTarball_url() + "'>" + mCtx.getResources().getString(R.string.tarArchiveDownloadReleasesTab) + "</a> "));
|
||||||
holder.releaseTarDownload.setMovementMethod(LinkMovementMethod.getInstance());
|
holder.releaseTarDownload.setMovementMethod(LinkMovementMethod.getInstance());
|
||||||
|
|
||||||
|
ReleasesDownloadsAdapter adapter = new ReleasesDownloadsAdapter(currentItem.getAssets());
|
||||||
|
holder.downloadList.setAdapter(adapter);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -0,0 +1,68 @@
|
|||||||
|
package org.mian.gitnex.adapters;
|
||||||
|
|
||||||
|
import android.text.Html;
|
||||||
|
import android.text.method.LinkMovementMethod;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
import org.mian.gitnex.R;
|
||||||
|
import org.mian.gitnex.models.Releases;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Author M M Arif
|
||||||
|
**/
|
||||||
|
|
||||||
|
public class ReleasesDownloadsAdapter extends RecyclerView.Adapter<ReleasesDownloadsAdapter.ReleasesDownloadsViewHolder> {
|
||||||
|
|
||||||
|
private List<Releases.assetsObject> releasesDownloadsList;
|
||||||
|
|
||||||
|
static class ReleasesDownloadsViewHolder extends RecyclerView.ViewHolder {
|
||||||
|
|
||||||
|
private TextView downloadName;
|
||||||
|
|
||||||
|
private ReleasesDownloadsViewHolder(View itemView) {
|
||||||
|
|
||||||
|
super(itemView);
|
||||||
|
|
||||||
|
downloadName = itemView.findViewById(R.id.downloadName);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ReleasesDownloadsAdapter(List<Releases.assetsObject> releasesDownloadsMain) {
|
||||||
|
|
||||||
|
this.releasesDownloadsList = releasesDownloadsMain;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public ReleasesDownloadsAdapter.ReleasesDownloadsViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
|
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_releases_downloads, parent, false);
|
||||||
|
return new ReleasesDownloadsAdapter.ReleasesDownloadsViewHolder(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(@NonNull ReleasesDownloadsAdapter.ReleasesDownloadsViewHolder holder, int position) {
|
||||||
|
|
||||||
|
Releases.assetsObject currentItem = releasesDownloadsList.get(position);
|
||||||
|
|
||||||
|
if(currentItem.getName() != null) {
|
||||||
|
|
||||||
|
holder.downloadName.setText(
|
||||||
|
Html.fromHtml("<a href='" + currentItem.getBrowser_download_url() + "'>" + currentItem.getName() + "</a> "));
|
||||||
|
holder.downloadName.setMovementMethod(LinkMovementMethod.getInstance());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return releasesDownloadsList.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -109,13 +109,6 @@ public class RepoStargazersAdapter extends BaseAdapter {
|
|||||||
viewHolder.memberName.setTypeface(myTypeface);
|
viewHolder.memberName.setTypeface(myTypeface);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(tinyDb.getInt("themeId") == 1) { //light
|
|
||||||
viewHolder.memberName.setTextColor(mCtx.getResources().getColor(R.color.lightThemeTextColor));
|
|
||||||
}
|
|
||||||
else { // dark
|
|
||||||
viewHolder.memberName.setTextColor(mCtx.getResources().getColor(R.color.white));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -109,13 +109,6 @@ public class RepoWatchersAdapter extends BaseAdapter {
|
|||||||
viewHolder.memberName.setTypeface(myTypeface);
|
viewHolder.memberName.setTypeface(myTypeface);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(tinyDb.getInt("themeId") == 1) { //light
|
|
||||||
viewHolder.memberName.setTextColor(mCtx.getResources().getColor(R.color.lightThemeTextColor));
|
|
||||||
}
|
|
||||||
else { // dark
|
|
||||||
viewHolder.memberName.setTextColor(mCtx.getResources().getColor(R.color.white));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,7 @@ import android.widget.CheckBox;
|
|||||||
import android.widget.Filter;
|
import android.widget.Filter;
|
||||||
import android.widget.Filterable;
|
import android.widget.Filterable;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
@ -56,6 +57,7 @@ public class ReposListAdapter extends RecyclerView.Adapter<ReposListAdapter.Repo
|
|||||||
private TextView repoForks;
|
private TextView repoForks;
|
||||||
private TextView repoOpenIssuesCount;
|
private TextView repoOpenIssuesCount;
|
||||||
private TextView repoType;
|
private TextView repoType;
|
||||||
|
private LinearLayout archiveRepo;
|
||||||
|
|
||||||
private ReposViewHolder(View itemView) {
|
private ReposViewHolder(View itemView) {
|
||||||
|
|
||||||
@ -71,6 +73,7 @@ public class ReposListAdapter extends RecyclerView.Adapter<ReposListAdapter.Repo
|
|||||||
repoOpenIssuesCount = itemView.findViewById(R.id.repoOpenIssuesCount);
|
repoOpenIssuesCount = itemView.findViewById(R.id.repoOpenIssuesCount);
|
||||||
ImageView reposDropdownMenu = itemView.findViewById(R.id.reposDropdownMenu);
|
ImageView reposDropdownMenu = itemView.findViewById(R.id.reposDropdownMenu);
|
||||||
repoType = itemView.findViewById(R.id.repoType);
|
repoType = itemView.findViewById(R.id.repoType);
|
||||||
|
archiveRepo = itemView.findViewById(R.id.archiveRepoFrame);
|
||||||
|
|
||||||
itemView.setOnClickListener(v -> {
|
itemView.setOnClickListener(v -> {
|
||||||
|
|
||||||
@ -249,6 +252,13 @@ public class ReposListAdapter extends RecyclerView.Adapter<ReposListAdapter.Repo
|
|||||||
}
|
}
|
||||||
holder.isRepoAdmin.setChecked(currentItem.getPermissions().isAdmin());
|
holder.isRepoAdmin.setChecked(currentItem.getPermissions().isAdmin());
|
||||||
|
|
||||||
|
if(currentItem.isArchived()) {
|
||||||
|
holder.archiveRepo.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
holder.archiveRepo.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -11,6 +11,7 @@ import android.widget.CheckBox;
|
|||||||
import android.widget.Filter;
|
import android.widget.Filter;
|
||||||
import android.widget.Filterable;
|
import android.widget.Filterable;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import com.amulyakhare.textdrawable.TextDrawable;
|
import com.amulyakhare.textdrawable.TextDrawable;
|
||||||
import com.amulyakhare.textdrawable.util.ColorGenerator;
|
import com.amulyakhare.textdrawable.util.ColorGenerator;
|
||||||
@ -56,6 +57,7 @@ public class RepositoriesByOrgAdapter extends RecyclerView.Adapter<RepositoriesB
|
|||||||
private TextView repoForks;
|
private TextView repoForks;
|
||||||
private TextView repoOpenIssuesCount;
|
private TextView repoOpenIssuesCount;
|
||||||
private TextView repoType;
|
private TextView repoType;
|
||||||
|
private LinearLayout archiveRepo;
|
||||||
|
|
||||||
private OrgReposViewHolder(View itemView) {
|
private OrgReposViewHolder(View itemView) {
|
||||||
super(itemView);
|
super(itemView);
|
||||||
@ -70,6 +72,7 @@ public class RepositoriesByOrgAdapter extends RecyclerView.Adapter<RepositoriesB
|
|||||||
repoOpenIssuesCount = itemView.findViewById(R.id.repoOpenIssuesCount);
|
repoOpenIssuesCount = itemView.findViewById(R.id.repoOpenIssuesCount);
|
||||||
ImageView reposDropdownMenu = itemView.findViewById(R.id.reposDropdownMenu);
|
ImageView reposDropdownMenu = itemView.findViewById(R.id.reposDropdownMenu);
|
||||||
repoType = itemView.findViewById(R.id.repoType);
|
repoType = itemView.findViewById(R.id.repoType);
|
||||||
|
archiveRepo = itemView.findViewById(R.id.archiveRepoFrame);
|
||||||
|
|
||||||
itemView.setOnClickListener(v -> {
|
itemView.setOnClickListener(v -> {
|
||||||
|
|
||||||
@ -252,6 +255,13 @@ public class RepositoriesByOrgAdapter extends RecyclerView.Adapter<RepositoriesB
|
|||||||
}
|
}
|
||||||
holder.isRepoAdmin.setChecked(currentItem.getPermissions().isAdmin());
|
holder.isRepoAdmin.setChecked(currentItem.getPermissions().isAdmin());
|
||||||
|
|
||||||
|
if(currentItem.isArchived()) {
|
||||||
|
holder.archiveRepo.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
holder.archiveRepo.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -11,6 +11,7 @@ import android.widget.CheckBox;
|
|||||||
import android.widget.Filter;
|
import android.widget.Filter;
|
||||||
import android.widget.Filterable;
|
import android.widget.Filterable;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import com.amulyakhare.textdrawable.TextDrawable;
|
import com.amulyakhare.textdrawable.TextDrawable;
|
||||||
import com.amulyakhare.textdrawable.util.ColorGenerator;
|
import com.amulyakhare.textdrawable.util.ColorGenerator;
|
||||||
@ -56,6 +57,7 @@ public class StarredReposListAdapter extends RecyclerView.Adapter<StarredReposLi
|
|||||||
private TextView repoForks;
|
private TextView repoForks;
|
||||||
private TextView repoOpenIssuesCount;
|
private TextView repoOpenIssuesCount;
|
||||||
private TextView repoType;
|
private TextView repoType;
|
||||||
|
private LinearLayout archiveRepo;
|
||||||
|
|
||||||
private StarredReposViewHolder(View itemView) {
|
private StarredReposViewHolder(View itemView) {
|
||||||
super(itemView);
|
super(itemView);
|
||||||
@ -70,6 +72,7 @@ public class StarredReposListAdapter extends RecyclerView.Adapter<StarredReposLi
|
|||||||
repoOpenIssuesCount = itemView.findViewById(R.id.repoOpenIssuesCount);
|
repoOpenIssuesCount = itemView.findViewById(R.id.repoOpenIssuesCount);
|
||||||
ImageView reposDropdownMenu = itemView.findViewById(R.id.reposDropdownMenu);
|
ImageView reposDropdownMenu = itemView.findViewById(R.id.reposDropdownMenu);
|
||||||
repoType = itemView.findViewById(R.id.repoType);
|
repoType = itemView.findViewById(R.id.repoType);
|
||||||
|
archiveRepo = itemView.findViewById(R.id.archiveRepoFrame);
|
||||||
|
|
||||||
itemView.setOnClickListener(v -> {
|
itemView.setOnClickListener(v -> {
|
||||||
|
|
||||||
@ -252,6 +255,13 @@ public class StarredReposListAdapter extends RecyclerView.Adapter<StarredReposLi
|
|||||||
}
|
}
|
||||||
holder.isRepoAdmin.setChecked(currentItem.getPermissions().isAdmin());
|
holder.isRepoAdmin.setChecked(currentItem.getPermissions().isAdmin());
|
||||||
|
|
||||||
|
if(currentItem.isArchived()) {
|
||||||
|
holder.archiveRepo.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
holder.archiveRepo.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -111,12 +111,5 @@ public class TeamMembersByOrgAdapter extends BaseAdapter {
|
|||||||
viewHolder.memberName.setTypeface(myTypeface);
|
viewHolder.memberName.setTypeface(myTypeface);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(tinyDb.getInt("themeId") == 1) { //light
|
|
||||||
viewHolder.memberName.setTextColor(mCtx.getResources().getColor(R.color.lightThemeTextColor));
|
|
||||||
}
|
|
||||||
else { // dark
|
|
||||||
viewHolder.memberName.setTextColor(mCtx.getResources().getColor(R.color.white));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,16 +14,18 @@ import javax.net.ssl.X509TrustManager;
|
|||||||
import okhttp3.OkHttpClient;
|
import okhttp3.OkHttpClient;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Author anonTree1417
|
* Author opyale
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class PicassoService {
|
public class PicassoService {
|
||||||
|
|
||||||
private static PicassoService picassoService;
|
private static PicassoService picassoService;
|
||||||
|
private static File cachePath;
|
||||||
private Picasso picasso;
|
private Picasso picasso;
|
||||||
|
|
||||||
private PicassoService(Context context) {
|
private PicassoService(Context context) {
|
||||||
|
|
||||||
|
cachePath = new File(context.getCacheDir() + "/picasso_cache/");
|
||||||
Picasso.Builder builder = new Picasso.Builder(context);
|
Picasso.Builder builder = new Picasso.Builder(context);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -45,10 +47,6 @@ public class PicassoService {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
File cachePath = new File(context.getCacheDir() + "/picasso_cache/");
|
|
||||||
//noinspection ResultOfMethodCallIgnored
|
|
||||||
cachePath.mkdirs();
|
|
||||||
|
|
||||||
picasso = builder.memoryCache(new PicassoCache(cachePath, context)).build();
|
picasso = builder.memoryCache(new PicassoCache(cachePath, context)).build();
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -61,7 +59,9 @@ public class PicassoService {
|
|||||||
|
|
||||||
public Picasso get() {
|
public Picasso get() {
|
||||||
|
|
||||||
|
cachePath.mkdirs();
|
||||||
return picasso;
|
return picasso;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static synchronized PicassoService getInstance(Context context) {
|
public static synchronized PicassoService getInstance(Context context) {
|
||||||
|
@ -64,7 +64,10 @@ public class BottomSheetSingleIssueFragment extends BottomSheetDialogFragment {
|
|||||||
mergePullRequest.setVisibility(View.VISIBLE);
|
mergePullRequest.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(tinyDB.getString("repoType").equals("public")) {
|
if(new Version(tinyDB.getString("giteaVersion")).higherOrEqual("1.13.0")) {
|
||||||
|
openFilesDiff.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
else if(tinyDB.getString("repoType").equals("public")) {
|
||||||
openFilesDiff.setVisibility(View.VISIBLE);
|
openFilesDiff.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -77,16 +77,20 @@ public class MilestonesFragment extends Fragment {
|
|||||||
dataList = new ArrayList<>();
|
dataList = new ArrayList<>();
|
||||||
adapter = new MilestonesAdapter(ctx, dataList);
|
adapter = new MilestonesAdapter(ctx, dataList);
|
||||||
|
|
||||||
adapter.setLoadMoreListener(() -> viewBinding.recyclerView.post(() -> {
|
if(new Version(tinyDb.getString("giteaVersion")).higherOrEqual("1.12.0")) {
|
||||||
|
|
||||||
if(dataList.size() == resultLimit || pageSize == resultLimit) {
|
adapter.setLoadMoreListener(() -> viewBinding.recyclerView.post(() -> {
|
||||||
|
|
||||||
int page = (dataList.size() + resultLimit) / resultLimit;
|
if(dataList.size() == resultLimit || pageSize == resultLimit) {
|
||||||
loadMore(Authorization.returnAuthentication(getContext(), loginUid, instanceToken), repoOwner, repoName, page, resultLimit, tinyDb.getString("milestoneState"));
|
|
||||||
|
|
||||||
}
|
int page = (dataList.size() + resultLimit) / resultLimit;
|
||||||
|
loadMore(Authorization.returnAuthentication(getContext(), loginUid, instanceToken), repoOwner, repoName, page, resultLimit, tinyDb.getString("milestoneState"));
|
||||||
|
|
||||||
}));
|
}
|
||||||
|
|
||||||
|
}));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
viewBinding.recyclerView.setHasFixedSize(true);
|
viewBinding.recyclerView.setHasFixedSize(true);
|
||||||
viewBinding.recyclerView.setLayoutManager(new LinearLayoutManager(ctx));
|
viewBinding.recyclerView.setLayoutManager(new LinearLayoutManager(ctx));
|
||||||
@ -113,16 +117,21 @@ public class MilestonesFragment extends Fragment {
|
|||||||
dataList.clear();
|
dataList.clear();
|
||||||
|
|
||||||
adapter = new MilestonesAdapter(ctx, dataList);
|
adapter = new MilestonesAdapter(ctx, dataList);
|
||||||
adapter.setLoadMoreListener(() -> viewBinding.recyclerView.post(() -> {
|
|
||||||
|
|
||||||
if(dataList.size() == resultLimit || pageSize == resultLimit) {
|
if(new Version(tinyDb.getString("giteaVersion")).higherOrEqual("1.12.0")) {
|
||||||
|
|
||||||
int page = (dataList.size() + resultLimit) / resultLimit;
|
adapter.setLoadMoreListener(() -> viewBinding.recyclerView.post(() -> {
|
||||||
loadMore(Authorization.returnAuthentication(getContext(), loginUid, instanceToken), repoOwner, repoName, page, resultLimit, milestoneState);
|
|
||||||
|
|
||||||
}
|
if(dataList.size() == resultLimit || pageSize == resultLimit) {
|
||||||
|
|
||||||
}));
|
int page = (dataList.size() + resultLimit) / resultLimit;
|
||||||
|
loadMore(Authorization.returnAuthentication(getContext(), loginUid, instanceToken), repoOwner, repoName, page, resultLimit, milestoneState);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
tinyDb.putString("milestoneState", milestoneState);
|
tinyDb.putString("milestoneState", milestoneState);
|
||||||
|
|
||||||
@ -171,7 +180,7 @@ public class MilestonesFragment extends Fragment {
|
|||||||
@Override
|
@Override
|
||||||
public void onResponse(@NonNull Call<List<Milestones>> call, @NonNull Response<List<Milestones>> response) {
|
public void onResponse(@NonNull Call<List<Milestones>> call, @NonNull Response<List<Milestones>> response) {
|
||||||
|
|
||||||
if(response.isSuccessful()) {
|
if(response.code() == 200) {
|
||||||
|
|
||||||
assert response.body() != null;
|
assert response.body() != null;
|
||||||
if(response.body().size() > 0) {
|
if(response.body().size() > 0) {
|
||||||
@ -222,7 +231,7 @@ public class MilestonesFragment extends Fragment {
|
|||||||
@Override
|
@Override
|
||||||
public void onResponse(@NonNull Call<List<Milestones>> call, @NonNull Response<List<Milestones>> response) {
|
public void onResponse(@NonNull Call<List<Milestones>> call, @NonNull Response<List<Milestones>> response) {
|
||||||
|
|
||||||
if(response.isSuccessful()) {
|
if(response.code() == 200) {
|
||||||
|
|
||||||
//remove loading view
|
//remove loading view
|
||||||
dataList.remove(dataList.size() - 1);
|
dataList.remove(dataList.size() - 1);
|
||||||
@ -238,7 +247,6 @@ public class MilestonesFragment extends Fragment {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
Toasty.info(ctx, getString(R.string.noMoreData));
|
|
||||||
adapter.setMoreDataAvailable(false);
|
adapter.setMoreDataAvailable(false);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,17 +3,16 @@ package org.mian.gitnex.fragments;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import androidx.fragment.app.Fragment;
|
|
||||||
import retrofit2.Call;
|
|
||||||
import retrofit2.Callback;
|
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.fragment.app.Fragment;
|
||||||
import org.mian.gitnex.R;
|
import org.mian.gitnex.R;
|
||||||
import org.mian.gitnex.clients.PicassoService;
|
import org.mian.gitnex.clients.PicassoService;
|
||||||
import org.mian.gitnex.clients.RetrofitClient;
|
import org.mian.gitnex.clients.RetrofitClient;
|
||||||
@ -21,6 +20,8 @@ import org.mian.gitnex.helpers.Authorization;
|
|||||||
import org.mian.gitnex.helpers.RoundedTransformation;
|
import org.mian.gitnex.helpers.RoundedTransformation;
|
||||||
import org.mian.gitnex.models.Organization;
|
import org.mian.gitnex.models.Organization;
|
||||||
import org.mian.gitnex.util.TinyDB;
|
import org.mian.gitnex.util.TinyDB;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.Callback;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Author M M Arif
|
* Author M M Arif
|
||||||
@ -37,6 +38,7 @@ public class OrganizationInfoFragment extends Fragment {
|
|||||||
private TextView orgDescInfo;
|
private TextView orgDescInfo;
|
||||||
private TextView orgWebsiteInfo;
|
private TextView orgWebsiteInfo;
|
||||||
private TextView orgLocationInfo;
|
private TextView orgLocationInfo;
|
||||||
|
private LinearLayout orgInfoLayout;
|
||||||
|
|
||||||
private RepoInfoFragment.OnFragmentInteractionListener mListener;
|
private RepoInfoFragment.OnFragmentInteractionListener mListener;
|
||||||
|
|
||||||
@ -76,6 +78,7 @@ public class OrganizationInfoFragment extends Fragment {
|
|||||||
orgDescInfo = v.findViewById(R.id.orgDescInfo);
|
orgDescInfo = v.findViewById(R.id.orgDescInfo);
|
||||||
orgWebsiteInfo = v.findViewById(R.id.orgWebsiteInfo);
|
orgWebsiteInfo = v.findViewById(R.id.orgWebsiteInfo);
|
||||||
orgLocationInfo = v.findViewById(R.id.orgLocationInfo);
|
orgLocationInfo = v.findViewById(R.id.orgLocationInfo);
|
||||||
|
orgInfoLayout = v.findViewById(R.id.orgInfoLayout);
|
||||||
|
|
||||||
orgNameInfo.setText(orgName);
|
orgNameInfo.setText(orgName);
|
||||||
|
|
||||||
@ -99,19 +102,46 @@ public class OrganizationInfoFragment extends Fragment {
|
|||||||
|
|
||||||
Organization orgInfo = response.body();
|
Organization orgInfo = response.body();
|
||||||
|
|
||||||
if (response.isSuccessful()) {
|
if (response.code() == 200) {
|
||||||
|
|
||||||
if (response.code() == 200) {
|
orgInfoLayout.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
assert orgInfo != null;
|
assert orgInfo != null;
|
||||||
PicassoService.getInstance(ctx).get().load(orgInfo.getAvatar_url()).placeholder(R.drawable.loader_animated).transform(new RoundedTransformation(8, 0)).resize(180, 180).centerCrop().into(orgAvatar);
|
|
||||||
orgDescInfo.setText(orgInfo.getDescription());
|
|
||||||
orgWebsiteInfo.setText(orgInfo.getWebsite());
|
|
||||||
orgLocationInfo.setText(orgInfo.getLocation());
|
|
||||||
|
|
||||||
mProgressBar.setVisibility(View.GONE);
|
PicassoService.getInstance(ctx).get()
|
||||||
|
.load(orgInfo.getAvatar_url())
|
||||||
|
.placeholder(R.drawable.loader_animated)
|
||||||
|
.transform(new RoundedTransformation(8, 0))
|
||||||
|
.resize(230, 230)
|
||||||
|
.centerCrop().into(orgAvatar);
|
||||||
|
|
||||||
|
if(!orgInfo.getDescription().isEmpty()) {
|
||||||
|
orgDescInfo.setText(orgInfo.getDescription());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
orgDescInfo.setText(getString(R.string.noDataDescription));
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!orgInfo.getWebsite().isEmpty()) {
|
||||||
|
orgWebsiteInfo.setText(orgInfo.getWebsite());
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
orgWebsiteInfo.setText(getString(R.string.noDataWebsite));
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!orgInfo.getLocation().isEmpty()) {
|
||||||
|
orgLocationInfo.setText(orgInfo.getLocation());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
orgLocationInfo.setText(getString(R.string.noDataLocation));
|
||||||
|
}
|
||||||
|
|
||||||
|
mProgressBar.setVisibility(View.GONE);
|
||||||
|
|
||||||
|
}
|
||||||
|
else if(response.code() == 404) {
|
||||||
|
|
||||||
|
mProgressBar.setVisibility(View.GONE);
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -3,12 +3,6 @@ package org.mian.gitnex.fragments;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.graphics.Typeface;
|
import android.graphics.Typeface;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import androidx.annotation.Nullable;
|
|
||||||
import androidx.fragment.app.Fragment;
|
|
||||||
import androidx.fragment.app.FragmentManager;
|
|
||||||
import androidx.fragment.app.FragmentStatePagerAdapter;
|
|
||||||
import androidx.viewpager.widget.ViewPager;
|
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuInflater;
|
import android.view.MenuInflater;
|
||||||
@ -17,13 +11,24 @@ import android.view.View;
|
|||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.fragment.app.Fragment;
|
||||||
|
import androidx.fragment.app.FragmentManager;
|
||||||
|
import androidx.fragment.app.FragmentStatePagerAdapter;
|
||||||
|
import androidx.viewpager.widget.ViewPager;
|
||||||
import com.google.android.material.tabs.TabLayout;
|
import com.google.android.material.tabs.TabLayout;
|
||||||
|
import com.squareup.picasso.Callback;
|
||||||
import org.mian.gitnex.R;
|
import org.mian.gitnex.R;
|
||||||
import org.mian.gitnex.activities.MainActivity;
|
import org.mian.gitnex.activities.MainActivity;
|
||||||
import org.mian.gitnex.clients.PicassoService;
|
import org.mian.gitnex.clients.PicassoService;
|
||||||
|
import org.mian.gitnex.helpers.ColorInverter;
|
||||||
import org.mian.gitnex.helpers.RoundedTransformation;
|
import org.mian.gitnex.helpers.RoundedTransformation;
|
||||||
import org.mian.gitnex.util.TinyDB;
|
import org.mian.gitnex.util.TinyDB;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
import eightbitlab.com.blurview.BlurView;
|
||||||
|
import eightbitlab.com.blurview.RenderScriptBlur;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Author M M Arif
|
* Author M M Arif
|
||||||
@ -31,26 +36,67 @@ import java.util.Objects;
|
|||||||
|
|
||||||
public class ProfileFragment extends Fragment {
|
public class ProfileFragment extends Fragment {
|
||||||
|
|
||||||
private Context ctx = getContext();
|
private Context ctx;
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||||
|
|
||||||
|
ctx = getContext();
|
||||||
|
|
||||||
View v = inflater.inflate(R.layout.fragment_profile, container, false);
|
View v = inflater.inflate(R.layout.fragment_profile, container, false);
|
||||||
setHasOptionsMenu(true);
|
setHasOptionsMenu(true);
|
||||||
|
|
||||||
TinyDB tinyDb = new TinyDB(getContext());
|
TinyDB tinyDb = new TinyDB(getContext());
|
||||||
|
|
||||||
|
BlurView blurView = v.findViewById(R.id.blurView);
|
||||||
TextView userFullName = v.findViewById(R.id.userFullName);
|
TextView userFullName = v.findViewById(R.id.userFullName);
|
||||||
|
ImageView userAvatarBackground = v.findViewById(R.id.userAvatarBackground);
|
||||||
ImageView userAvatar = v.findViewById(R.id.userAvatar);
|
ImageView userAvatar = v.findViewById(R.id.userAvatar);
|
||||||
TextView userLogin = v.findViewById(R.id.userLogin);
|
TextView userLogin = v.findViewById(R.id.userLogin);
|
||||||
TextView userEmail = v.findViewById(R.id.userEmail);
|
TextView userLanguage = v.findViewById(R.id.userLanguage);
|
||||||
|
|
||||||
|
ViewGroup aboutFrame = v.findViewById(R.id.aboutFrame);
|
||||||
|
|
||||||
|
String[] userLanguageCodes = tinyDb.getString("userLang").split("-");
|
||||||
|
Locale locale = new Locale(userLanguageCodes[0], userLanguageCodes[1]);
|
||||||
|
|
||||||
|
userFullName.setText(tinyDb.getString("userFullname"));
|
||||||
|
userLogin.setText(getString(R.string.usernameWithAt, tinyDb.getString("userLogin")));
|
||||||
|
userLanguage.setText(locale.getDisplayCountry());
|
||||||
|
|
||||||
|
PicassoService.getInstance(ctx).get()
|
||||||
|
.load(tinyDb.getString("userAvatar"))
|
||||||
|
.transform(new RoundedTransformation(8, 0))
|
||||||
|
.placeholder(R.drawable.loader_animated)
|
||||||
|
.resize(120, 120)
|
||||||
|
.centerCrop().into(userAvatar);
|
||||||
|
|
||||||
|
PicassoService.getInstance(ctx).get()
|
||||||
|
.load(tinyDb.getString("userAvatar"))
|
||||||
|
.into(userAvatarBackground, new Callback() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
|
||||||
|
int textColor = new ColorInverter().getImageViewContrastColor(userAvatarBackground);
|
||||||
|
|
||||||
|
userFullName.setTextColor(textColor);
|
||||||
|
userLogin.setTextColor(textColor);
|
||||||
|
userLanguage.setTextColor(textColor);
|
||||||
|
|
||||||
|
blurView.setupWith(aboutFrame)
|
||||||
|
.setBlurAlgorithm(new RenderScriptBlur(ctx))
|
||||||
|
.setBlurRadius(3)
|
||||||
|
.setHasFixedTransformationMatrix(true);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Exception e) {}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
userFullName.setText(tinyDb.getString("userFullname"));
|
|
||||||
PicassoService.getInstance(ctx).get().load(tinyDb.getString("userAvatar")).placeholder(R.drawable.loader_animated).transform(new RoundedTransformation(8, 0)).resize(120, 120).centerCrop().into(userAvatar);
|
|
||||||
userLogin.setText(getString(R.string.usernameWithAt, tinyDb.getString("userLogin")));
|
|
||||||
userEmail.setText(tinyDb.getString("userEmail"));
|
|
||||||
|
|
||||||
ProfileFragment.SectionsPagerAdapter mSectionsPagerAdapter = new SectionsPagerAdapter(getChildFragmentManager());
|
ProfileFragment.SectionsPagerAdapter mSectionsPagerAdapter = new SectionsPagerAdapter(getChildFragmentManager());
|
||||||
|
|
||||||
@ -79,11 +125,16 @@ public class ProfileFragment extends Fragment {
|
|||||||
|
|
||||||
ViewGroup vg = (ViewGroup) tabLayout.getChildAt(0);
|
ViewGroup vg = (ViewGroup) tabLayout.getChildAt(0);
|
||||||
int tabsCount = vg.getChildCount();
|
int tabsCount = vg.getChildCount();
|
||||||
|
|
||||||
for (int j = 0; j < tabsCount; j++) {
|
for (int j = 0; j < tabsCount; j++) {
|
||||||
|
|
||||||
ViewGroup vgTab = (ViewGroup) vg.getChildAt(j);
|
ViewGroup vgTab = (ViewGroup) vg.getChildAt(j);
|
||||||
int tabChildCount = vgTab.getChildCount();
|
int tabChildCount = vgTab.getChildCount();
|
||||||
|
|
||||||
for (int i = 0; i < tabChildCount; i++) {
|
for (int i = 0; i < tabChildCount; i++) {
|
||||||
|
|
||||||
View tabViewChild = vgTab.getChildAt(i);
|
View tabViewChild = vgTab.getChildAt(i);
|
||||||
|
|
||||||
if (tabViewChild instanceof TextView) {
|
if (tabViewChild instanceof TextView) {
|
||||||
((TextView) tabViewChild).setTypeface(myTypeface);
|
((TextView) tabViewChild).setTypeface(myTypeface);
|
||||||
}
|
}
|
||||||
@ -108,15 +159,22 @@ public class ProfileFragment extends Fragment {
|
|||||||
public Fragment getItem(int position) {
|
public Fragment getItem(int position) {
|
||||||
|
|
||||||
Fragment fragment = null;
|
Fragment fragment = null;
|
||||||
|
|
||||||
switch (position) {
|
switch (position) {
|
||||||
|
|
||||||
case 0: // followers
|
case 0: // followers
|
||||||
return ProfileFollowersFragment.newInstance("repoOwner", "repoName");
|
return ProfileFollowersFragment.newInstance("repoOwner", "repoName");
|
||||||
|
|
||||||
case 1: // following
|
case 1: // following
|
||||||
return ProfileFollowingFragment.newInstance("repoOwner", "repoName");
|
return ProfileFollowingFragment.newInstance("repoOwner", "repoName");
|
||||||
|
|
||||||
case 2: // emails
|
case 2: // emails
|
||||||
return ProfileEmailsFragment.newInstance("repoOwner", "repoName");
|
return ProfileEmailsFragment.newInstance("repoOwner", "repoName");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return fragment;
|
return fragment;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -128,9 +186,11 @@ public class ProfileFragment extends Fragment {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) {
|
public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) {
|
||||||
|
|
||||||
menu.clear();
|
menu.clear();
|
||||||
Objects.requireNonNull(getActivity()).getMenuInflater().inflate(R.menu.profile_dotted_menu, menu);
|
Objects.requireNonNull(getActivity()).getMenuInflater().inflate(R.menu.profile_dotted_menu, menu);
|
||||||
super.onCreateOptionsMenu(menu, inflater);
|
super.onCreateOptionsMenu(menu, inflater);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -139,17 +199,20 @@ public class ProfileFragment extends Fragment {
|
|||||||
int id = item.getItemId();
|
int id = item.getItemId();
|
||||||
|
|
||||||
switch (id) {
|
switch (id) {
|
||||||
|
|
||||||
case android.R.id.home:
|
case android.R.id.home:
|
||||||
((MainActivity)ctx).finish();
|
((MainActivity)ctx).finish();
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case R.id.profileMenu:
|
case R.id.profileMenu:
|
||||||
BottomSheetProfileFragment bottomSheet = new BottomSheetProfileFragment();
|
BottomSheetProfileFragment bottomSheet = new BottomSheetProfileFragment();
|
||||||
bottomSheet.show(getChildFragmentManager(), "profileBottomSheet");
|
bottomSheet.show(getChildFragmentManager(), "profileBottomSheet");
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -4,10 +4,34 @@ import android.content.Context;
|
|||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.text.Spanned;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.ProgressBar;
|
||||||
|
import android.widget.TextView;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
|
import org.mian.gitnex.R;
|
||||||
|
import org.mian.gitnex.clients.RetrofitClient;
|
||||||
|
import org.mian.gitnex.helpers.AlertDialogs;
|
||||||
|
import org.mian.gitnex.helpers.Authorization;
|
||||||
|
import org.mian.gitnex.helpers.ClickListener;
|
||||||
|
import org.mian.gitnex.helpers.TimeHelper;
|
||||||
|
import org.mian.gitnex.helpers.Toasty;
|
||||||
|
import org.mian.gitnex.models.UserRepositories;
|
||||||
|
import org.mian.gitnex.util.AppUtil;
|
||||||
|
import org.mian.gitnex.util.TinyDB;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.Locale;
|
||||||
|
import java.util.Objects;
|
||||||
import io.noties.markwon.AbstractMarkwonPlugin;
|
import io.noties.markwon.AbstractMarkwonPlugin;
|
||||||
import io.noties.markwon.Markwon;
|
import io.noties.markwon.Markwon;
|
||||||
import io.noties.markwon.core.CorePlugin;
|
import io.noties.markwon.core.CorePlugin;
|
||||||
@ -26,30 +50,6 @@ import io.noties.markwon.image.svg.SvgMediaDecoder;
|
|||||||
import io.noties.markwon.linkify.LinkifyPlugin;
|
import io.noties.markwon.linkify.LinkifyPlugin;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.Callback;
|
import retrofit2.Callback;
|
||||||
import android.text.Spanned;
|
|
||||||
import android.util.Log;
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.widget.Button;
|
|
||||||
import android.widget.ImageView;
|
|
||||||
import android.widget.LinearLayout;
|
|
||||||
import android.widget.ProgressBar;
|
|
||||||
import android.widget.TextView;
|
|
||||||
import org.mian.gitnex.R;
|
|
||||||
import org.mian.gitnex.clients.RetrofitClient;
|
|
||||||
import org.mian.gitnex.helpers.AlertDialogs;
|
|
||||||
import org.mian.gitnex.helpers.Authorization;
|
|
||||||
import org.mian.gitnex.helpers.ClickListener;
|
|
||||||
import org.mian.gitnex.helpers.TimeHelper;
|
|
||||||
import org.mian.gitnex.helpers.Toasty;
|
|
||||||
import org.mian.gitnex.models.UserRepositories;
|
|
||||||
import org.mian.gitnex.util.AppUtil;
|
|
||||||
import org.mian.gitnex.util.TinyDB;
|
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.Locale;
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Author M M Arif
|
* Author M M Arif
|
||||||
@ -57,405 +57,427 @@ import java.util.Objects;
|
|||||||
|
|
||||||
public class RepoInfoFragment extends Fragment {
|
public class RepoInfoFragment extends Fragment {
|
||||||
|
|
||||||
private Context ctx;
|
private Context ctx;
|
||||||
private ProgressBar mProgressBar;
|
private ProgressBar mProgressBar;
|
||||||
private LinearLayout pageContent;
|
private LinearLayout pageContent;
|
||||||
private static String repoNameF = "param2";
|
private static String repoNameF = "param2";
|
||||||
private static String repoOwnerF = "param1";
|
private static String repoOwnerF = "param1";
|
||||||
|
|
||||||
private String repoName;
|
private String repoName;
|
||||||
private String repoOwner;
|
private String repoOwner;
|
||||||
private TextView repoMetaName;
|
private TextView repoMetaName;
|
||||||
private TextView repoMetaDescription;
|
private TextView repoMetaDescription;
|
||||||
private TextView repoMetaStars;
|
private TextView repoMetaStars;
|
||||||
private TextView repoMetaPullRequests;
|
private TextView repoMetaPullRequests;
|
||||||
private LinearLayout repoMetaPullRequestsFrame;
|
private LinearLayout repoMetaPullRequestsFrame;
|
||||||
private TextView repoMetaForks;
|
private TextView repoMetaForks;
|
||||||
private TextView repoMetaSize;
|
private TextView repoMetaSize;
|
||||||
private TextView repoMetaWatchers;
|
private TextView repoMetaWatchers;
|
||||||
private TextView repoMetaCreatedAt;
|
private TextView repoMetaCreatedAt;
|
||||||
private TextView repoMetaWebsite;
|
private TextView repoMetaWebsite;
|
||||||
private Button repoAdditionalButton;
|
private Button repoAdditionalButton;
|
||||||
private TextView repoFileContents;
|
private TextView repoFileContents;
|
||||||
private LinearLayout repoMetaFrame;
|
private LinearLayout repoMetaFrame;
|
||||||
private ImageView repoMetaDataExpandCollapse;
|
private ImageView repoMetaDataExpandCollapse;
|
||||||
private ImageView repoFilenameExpandCollapse;
|
private ImageView repoFilenameExpandCollapse;
|
||||||
private LinearLayout fileContentsFrameHeader;
|
private LinearLayout fileContentsFrameHeader;
|
||||||
private LinearLayout fileContentsFrame;
|
private LinearLayout fileContentsFrame;
|
||||||
|
|
||||||
private OnFragmentInteractionListener mListener;
|
private OnFragmentInteractionListener mListener;
|
||||||
|
|
||||||
public RepoInfoFragment() {
|
public RepoInfoFragment() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static RepoInfoFragment newInstance(String param1, String param2) {
|
public static RepoInfoFragment newInstance(String param1, String param2) {
|
||||||
RepoInfoFragment fragment = new RepoInfoFragment();
|
RepoInfoFragment fragment = new RepoInfoFragment();
|
||||||
Bundle args = new Bundle();
|
Bundle args = new Bundle();
|
||||||
args.putString(repoOwnerF, param1);
|
args.putString(repoOwnerF, param1);
|
||||||
args.putString(repoNameF, param2);
|
args.putString(repoNameF, param2);
|
||||||
fragment.setArguments(args);
|
fragment.setArguments(args);
|
||||||
return fragment;
|
return fragment;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
if (getArguments() != null) {
|
if (getArguments() != null) {
|
||||||
repoName = getArguments().getString(repoNameF);
|
repoName = getArguments().getString(repoNameF);
|
||||||
repoOwner = getArguments().getString(repoOwnerF);
|
repoOwner = getArguments().getString(repoOwnerF);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
|
|
||||||
View v = inflater.inflate(R.layout.fragment_repo_info, container, false);
|
View v = inflater.inflate(R.layout.fragment_repo_info, container, false);
|
||||||
|
|
||||||
TinyDB tinyDb = new TinyDB(getContext());
|
TinyDB tinyDb = new TinyDB(getContext());
|
||||||
final String instanceUrl = tinyDb.getString("instanceUrl");
|
final String instanceUrl = tinyDb.getString("instanceUrl");
|
||||||
final String loginUid = tinyDb.getString("loginUid");
|
final String loginUid = tinyDb.getString("loginUid");
|
||||||
final String instanceToken = "token " + tinyDb.getString(loginUid + "-token");
|
final String instanceToken = "token " + tinyDb.getString(loginUid + "-token");
|
||||||
final String locale = tinyDb.getString("locale");
|
final String locale = tinyDb.getString("locale");
|
||||||
final String timeFormat = tinyDb.getString("dateFormat");
|
final String timeFormat = tinyDb.getString("dateFormat");
|
||||||
|
|
||||||
ctx = getActivity();
|
ctx = getActivity();
|
||||||
|
|
||||||
pageContent = v.findViewById(R.id.repoInfoLayout);
|
pageContent = v.findViewById(R.id.repoInfoLayout);
|
||||||
pageContent.setVisibility(View.GONE);
|
pageContent.setVisibility(View.GONE);
|
||||||
|
|
||||||
mProgressBar = v.findViewById(R.id.progress_bar);
|
mProgressBar = v.findViewById(R.id.progress_bar);
|
||||||
repoMetaName = v.findViewById(R.id.repoMetaName);
|
repoMetaName = v.findViewById(R.id.repoMetaName);
|
||||||
repoMetaDescription = v.findViewById(R.id.repoMetaDescription);
|
repoMetaDescription = v.findViewById(R.id.repoMetaDescription);
|
||||||
repoMetaStars = v.findViewById(R.id.repoMetaStars);
|
repoMetaStars = v.findViewById(R.id.repoMetaStars);
|
||||||
repoMetaPullRequests = v.findViewById(R.id.repoMetaPullRequests);
|
repoMetaPullRequests = v.findViewById(R.id.repoMetaPullRequests);
|
||||||
repoMetaPullRequestsFrame = v.findViewById(R.id.repoMetaPullRequestsFrame);
|
repoMetaPullRequestsFrame = v.findViewById(R.id.repoMetaPullRequestsFrame);
|
||||||
repoMetaForks = v.findViewById(R.id.repoMetaForks);
|
repoMetaForks = v.findViewById(R.id.repoMetaForks);
|
||||||
repoMetaSize = v.findViewById(R.id.repoMetaSize);
|
repoMetaSize = v.findViewById(R.id.repoMetaSize);
|
||||||
repoMetaWatchers = v.findViewById(R.id.repoMetaWatchers);
|
repoMetaWatchers = v.findViewById(R.id.repoMetaWatchers);
|
||||||
repoMetaCreatedAt = v.findViewById(R.id.repoMetaCreatedAt);
|
repoMetaCreatedAt = v.findViewById(R.id.repoMetaCreatedAt);
|
||||||
repoMetaWebsite = v.findViewById(R.id.repoMetaWebsite);
|
repoMetaWebsite = v.findViewById(R.id.repoMetaWebsite);
|
||||||
repoAdditionalButton = v.findViewById(R.id.repoAdditionalButton);
|
repoAdditionalButton = v.findViewById(R.id.repoAdditionalButton);
|
||||||
repoFileContents = v.findViewById(R.id.repoFileContents);
|
repoFileContents = v.findViewById(R.id.repoFileContents);
|
||||||
repoMetaFrame = v.findViewById(R.id.repoMetaFrame);
|
repoMetaFrame = v.findViewById(R.id.repoMetaFrame);
|
||||||
LinearLayout repoMetaFrameHeader = v.findViewById(R.id.repoMetaFrameHeader);
|
LinearLayout repoMetaFrameHeader = v.findViewById(R.id.repoMetaFrameHeader);
|
||||||
repoMetaDataExpandCollapse = v.findViewById(R.id.repoMetaDataExpandCollapse);
|
repoMetaDataExpandCollapse = v.findViewById(R.id.repoMetaDataExpandCollapse);
|
||||||
repoFilenameExpandCollapse = v.findViewById(R.id.repoFilenameExpandCollapse);
|
repoFilenameExpandCollapse = v.findViewById(R.id.repoFilenameExpandCollapse);
|
||||||
fileContentsFrameHeader = v.findViewById(R.id.fileContentsFrameHeader);
|
fileContentsFrameHeader = v.findViewById(R.id.fileContentsFrameHeader);
|
||||||
fileContentsFrame = v.findViewById(R.id.fileContentsFrame);
|
fileContentsFrame = v.findViewById(R.id.fileContentsFrame);
|
||||||
|
|
||||||
repoMetaFrame.setVisibility(View.GONE);
|
repoMetaFrame.setVisibility(View.GONE);
|
||||||
|
|
||||||
getRepoInfo(instanceUrl, Authorization.returnAuthentication(getContext(), loginUid, instanceToken), repoOwner, repoName, locale, timeFormat);
|
getRepoInfo(instanceUrl, Authorization.returnAuthentication(getContext(), loginUid, instanceToken), repoOwner, repoName, locale, timeFormat);
|
||||||
getFileContents(instanceUrl, Authorization.returnAuthentication(getContext(), loginUid, instanceToken), repoOwner, repoName, getResources().getString(R.string.defaultFilename));
|
getFileContents(instanceUrl, Authorization.returnAuthentication(getContext(), loginUid, instanceToken), repoOwner, repoName, getResources().getString(R.string.defaultFilename));
|
||||||
|
|
||||||
if(isExpandViewVisible()) {
|
if(isExpandViewVisible()) {
|
||||||
toggleExpandView();
|
toggleExpandView();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!isExpandViewMetaVisible()) {
|
if(!isExpandViewMetaVisible()) {
|
||||||
toggleExpandViewMeta();
|
toggleExpandViewMeta();
|
||||||
}
|
}
|
||||||
|
|
||||||
fileContentsFrameHeader.setOnClickListener(new View.OnClickListener() {
|
fileContentsFrameHeader.setOnClickListener(new View.OnClickListener() {
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
toggleExpandView();
|
toggleExpandView();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
repoMetaFrameHeader.setOnClickListener(new View.OnClickListener() {
|
repoMetaFrameHeader.setOnClickListener(new View.OnClickListener() {
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
toggleExpandViewMeta();
|
toggleExpandViewMeta();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onButtonPressed(Uri uri) {
|
public void onButtonPressed(Uri uri) {
|
||||||
if (mListener != null) {
|
if (mListener != null) {
|
||||||
mListener.onFragmentInteraction(uri);
|
mListener.onFragmentInteraction(uri);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDetach() {
|
public void onDetach() {
|
||||||
super.onDetach();
|
super.onDetach();
|
||||||
mListener = null;
|
mListener = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface OnFragmentInteractionListener {
|
public interface OnFragmentInteractionListener {
|
||||||
void onFragmentInteraction(Uri uri);
|
void onFragmentInteraction(Uri uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void toggleExpandView() {
|
private void toggleExpandView() {
|
||||||
|
|
||||||
if (repoFileContents.getVisibility() == View.GONE) {
|
if (repoFileContents.getVisibility() == View.GONE) {
|
||||||
repoFilenameExpandCollapse.setImageResource(R.drawable.ic_arrow_up);
|
repoFilenameExpandCollapse.setImageResource(R.drawable.ic_arrow_up);
|
||||||
repoFileContents.setVisibility(View.VISIBLE);
|
repoFileContents.setVisibility(View.VISIBLE);
|
||||||
//Animation slide_down = AnimationUtils.loadAnimation(getContext(), R.anim.slide_down);
|
//Animation slide_down = AnimationUtils.loadAnimation(getContext(), R.anim.slide_down);
|
||||||
//fileContentsFrame.startAnimation(slide_down);
|
//fileContentsFrame.startAnimation(slide_down);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
repoFilenameExpandCollapse.setImageResource(R.drawable.ic_arrow_down);
|
repoFilenameExpandCollapse.setImageResource(R.drawable.ic_arrow_down);
|
||||||
repoFileContents.setVisibility(View.GONE);
|
repoFileContents.setVisibility(View.GONE);
|
||||||
//Animation slide_up = AnimationUtils.loadAnimation(getContext(), R.anim.slide_up);
|
//Animation slide_up = AnimationUtils.loadAnimation(getContext(), R.anim.slide_up);
|
||||||
//fileContentsFrame.startAnimation(slide_up);
|
//fileContentsFrame.startAnimation(slide_up);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isExpandViewVisible() {
|
private boolean isExpandViewVisible() {
|
||||||
return repoFileContents.getVisibility() == View.VISIBLE;
|
return repoFileContents.getVisibility() == View.VISIBLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void toggleExpandViewMeta() {
|
private void toggleExpandViewMeta() {
|
||||||
|
|
||||||
if (repoMetaFrame.getVisibility() == View.GONE) {
|
if (repoMetaFrame.getVisibility() == View.GONE) {
|
||||||
repoMetaDataExpandCollapse.setImageResource(R.drawable.ic_arrow_up);
|
repoMetaDataExpandCollapse.setImageResource(R.drawable.ic_arrow_up);
|
||||||
repoMetaFrame.setVisibility(View.VISIBLE);
|
repoMetaFrame.setVisibility(View.VISIBLE);
|
||||||
//Animation slide_down = AnimationUtils.loadAnimation(getContext(), R.anim.slide_down);
|
//Animation slide_down = AnimationUtils.loadAnimation(getContext(), R.anim.slide_down);
|
||||||
//repoMetaFrame.startAnimation(slide_down);
|
//repoMetaFrame.startAnimation(slide_down);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
repoMetaDataExpandCollapse.setImageResource(R.drawable.ic_arrow_down);
|
repoMetaDataExpandCollapse.setImageResource(R.drawable.ic_arrow_down);
|
||||||
repoMetaFrame.setVisibility(View.GONE);
|
repoMetaFrame.setVisibility(View.GONE);
|
||||||
//Animation slide_up = AnimationUtils.loadAnimation(getContext(), R.anim.slide_up);
|
//Animation slide_up = AnimationUtils.loadAnimation(getContext(), R.anim.slide_up);
|
||||||
//repoMetaFrame.startAnimation(slide_up);
|
//repoMetaFrame.startAnimation(slide_up);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isExpandViewMetaVisible() {
|
private boolean isExpandViewMetaVisible() {
|
||||||
return repoMetaFrame.getVisibility() == View.VISIBLE;
|
return repoMetaFrame.getVisibility() == View.VISIBLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void getRepoInfo(String instanceUrl, String token, final String owner, String repo, final String locale, final String timeFormat) {
|
private void getRepoInfo(String instanceUrl, String token, final String owner, String repo, final String locale, final String timeFormat) {
|
||||||
|
|
||||||
final TinyDB tinyDb = new TinyDB(getContext());
|
final TinyDB tinyDb = new TinyDB(getContext());
|
||||||
|
|
||||||
Call<UserRepositories> call = RetrofitClient
|
Call<UserRepositories> call = RetrofitClient
|
||||||
.getInstance(instanceUrl, getContext())
|
.getInstance(instanceUrl, getContext())
|
||||||
.getApiInterface()
|
.getApiInterface()
|
||||||
.getUserRepository(token, owner, repo);
|
.getUserRepository(token, owner, repo);
|
||||||
|
|
||||||
call.enqueue(new Callback<UserRepositories>() {
|
call.enqueue(new Callback<UserRepositories>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(@NonNull Call<UserRepositories> call, @NonNull retrofit2.Response<UserRepositories> response) {
|
public void onResponse(@NonNull Call<UserRepositories> call, @NonNull retrofit2.Response<UserRepositories> response) {
|
||||||
|
|
||||||
UserRepositories repoInfo = response.body();
|
UserRepositories repoInfo = response.body();
|
||||||
|
|
||||||
if (isAdded()) {
|
if (isAdded()) {
|
||||||
|
|
||||||
if (response.isSuccessful()) {
|
if (response.isSuccessful()) {
|
||||||
|
|
||||||
if (response.code() == 200) {
|
if (response.code() == 200) {
|
||||||
|
|
||||||
assert repoInfo != null;
|
assert repoInfo != null;
|
||||||
repoMetaName.setText(repoInfo.getName());
|
repoMetaName.setText(repoInfo.getName());
|
||||||
repoMetaDescription.setText(repoInfo.getDescription());
|
|
||||||
repoMetaStars.setText(repoInfo.getStars_count());
|
|
||||||
|
|
||||||
if(repoInfo.getOpen_pull_count() != null) {
|
if(!repoInfo.getDescription().isEmpty()) {
|
||||||
repoMetaPullRequests.setText(repoInfo.getOpen_pull_count());
|
repoMetaDescription.setText(repoInfo.getDescription());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
repoMetaPullRequestsFrame.setVisibility(View.GONE);
|
repoMetaDescription.setText(getString(R.string.noDataDescription));
|
||||||
}
|
}
|
||||||
|
|
||||||
repoMetaForks.setText(repoInfo.getForks_count());
|
repoMetaStars.setText(repoInfo.getStars_count());
|
||||||
repoMetaWatchers.setText(repoInfo.getWatchers_count());
|
|
||||||
|
|
||||||
if(repoInfo.getSize() != 0) {
|
if(repoInfo.getOpen_pull_count() != null) {
|
||||||
repoMetaSize.setText(AppUtil.formatFileSize(repoInfo.getSize()));
|
repoMetaPullRequests.setText(repoInfo.getOpen_pull_count());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
repoMetaSize.setText("0");
|
repoMetaPullRequestsFrame.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
repoMetaCreatedAt.setText(TimeHelper.formatTime(repoInfo.getCreated_at(), new Locale(locale), timeFormat, ctx));
|
repoMetaForks.setText(repoInfo.getForks_count());
|
||||||
if(timeFormat.equals("pretty")) {
|
repoMetaWatchers.setText(repoInfo.getWatchers_count());
|
||||||
repoMetaCreatedAt.setOnClickListener(new ClickListener(TimeHelper.customDateFormatForToastDateFormat(repoInfo.getCreated_at()), ctx));
|
|
||||||
}
|
|
||||||
|
|
||||||
String repoMetaUpdatedAt = TimeHelper.formatTime(repoInfo.getUpdated_at(), new Locale(locale), timeFormat, ctx);
|
if(repoInfo.getSize() != 0) {
|
||||||
|
repoMetaSize.setText(AppUtil.formatFileSize(repoInfo.getSize()));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
repoMetaSize.setText("0 B");
|
||||||
|
}
|
||||||
|
|
||||||
String website = (repoInfo.getWebsite().isEmpty()) ? getResources().getString(R.string.noDataWebsite) : repoInfo.getWebsite();
|
repoMetaCreatedAt.setText(TimeHelper.formatTime(repoInfo.getCreated_at(), new Locale(locale), timeFormat, ctx));
|
||||||
repoMetaWebsite.setText(website);
|
if(timeFormat.equals("pretty")) {
|
||||||
|
repoMetaCreatedAt.setOnClickListener(new ClickListener(TimeHelper.customDateFormatForToastDateFormat(repoInfo.getCreated_at()), ctx));
|
||||||
|
}
|
||||||
|
|
||||||
repoAdditionalButton.setOnClickListener(v -> {
|
String repoMetaUpdatedAt = TimeHelper.formatTime(repoInfo.getUpdated_at(), new Locale(locale), timeFormat, ctx);
|
||||||
|
|
||||||
StringBuilder message = new StringBuilder();
|
String website = (repoInfo.getWebsite().isEmpty()) ? getResources().getString(R.string.noDataWebsite) : repoInfo.getWebsite();
|
||||||
|
repoMetaWebsite.setText(website);
|
||||||
|
|
||||||
message.append(getResources().getString(R.string.infoTabRepoDefaultBranch))
|
repoAdditionalButton.setOnClickListener(v -> {
|
||||||
.append(" :\n").append(repoInfo.getDefault_branch()).append("\n\n");
|
|
||||||
|
|
||||||
message.append(getResources().getString(R.string.infoTabRepoUpdatedAt))
|
View view = LayoutInflater.from(ctx).inflate(R.layout.layout_repo_more_info, null);
|
||||||
.append(" :\n").append(repoMetaUpdatedAt).append("\n\n");
|
|
||||||
|
|
||||||
message.append(getResources().getString(R.string.infoTabRepoSshUrl))
|
TextView defaultBranchHeader = view.findViewById(R.id.defaultBranchHeader);
|
||||||
.append(" :\n").append(repoInfo.getSsh_url()).append("\n\n");
|
TextView defaultBranchContent = view.findViewById(R.id.defaultBranchContent);
|
||||||
|
|
||||||
message.append(getResources().getString(R.string.infoTabRepoCloneUrl))
|
TextView lastUpdatedHeader = view.findViewById(R.id.lastUpdatedHeader);
|
||||||
.append(" :\n").append(repoInfo.getClone_url()).append("\n\n");
|
TextView lastUpdatedContent = view.findViewById(R.id.lastUpdatedContent);
|
||||||
|
|
||||||
message.append(getResources().getString(R.string.infoTabRepoRepoUrl))
|
TextView sshUrlHeader = view.findViewById(R.id.sshUrlHeader);
|
||||||
.append(" :\n").append(repoInfo.getHtml_url());
|
TextView sshUrlContent = view.findViewById(R.id.sshUrlContent);
|
||||||
|
|
||||||
AlertDialog.Builder alertDialog = new AlertDialog.Builder(ctx);
|
TextView cloneUrlHeader = view.findViewById(R.id.cloneUrlHeader);
|
||||||
|
TextView cloneUrlContent = view.findViewById(R.id.cloneUrlContent);
|
||||||
|
|
||||||
alertDialog.setTitle(getResources().getString(R.string.infoMoreInformation));
|
TextView repoUrlHeader = view.findViewById(R.id.repoUrlHeader);
|
||||||
alertDialog.setMessage(message);
|
TextView repoUrlContent = view.findViewById(R.id.repoUrlContent);
|
||||||
alertDialog.setPositiveButton(getResources().getString(R.string.close), (dialog, which) -> dialog.dismiss());
|
|
||||||
alertDialog.create().show();
|
|
||||||
|
|
||||||
});
|
defaultBranchHeader.setText(getString(R.string.infoTabRepoDefaultBranch));
|
||||||
|
defaultBranchContent.setText(repoInfo.getDefault_branch());
|
||||||
|
|
||||||
if(repoInfo.getHas_issues() != null) {
|
lastUpdatedHeader.setText(getString(R.string.infoTabRepoUpdatedAt));
|
||||||
tinyDb.putBoolean("hasIssues", repoInfo.getHas_issues());
|
lastUpdatedContent.setText(repoMetaUpdatedAt);
|
||||||
}
|
|
||||||
else {
|
|
||||||
tinyDb.putBoolean("hasIssues", true);
|
|
||||||
}
|
|
||||||
|
|
||||||
tinyDb.putString("repoHtmlUrl", repoInfo.getHtml_url());
|
sshUrlHeader.setText(getString(R.string.infoTabRepoSshUrl));
|
||||||
|
sshUrlContent.setText(repoInfo.getSsh_url());
|
||||||
|
|
||||||
mProgressBar.setVisibility(View.GONE);
|
cloneUrlHeader.setText(getString(R.string.infoTabRepoCloneUrl));
|
||||||
pageContent.setVisibility(View.VISIBLE);
|
cloneUrlContent.setText(repoInfo.getClone_url());
|
||||||
|
|
||||||
}
|
repoUrlHeader.setText(getString(R.string.infoTabRepoRepoUrl));
|
||||||
|
repoUrlContent.setText(repoInfo.getHtml_url());
|
||||||
|
|
||||||
}
|
AlertDialog.Builder alertDialog = new AlertDialog.Builder(ctx);
|
||||||
else {
|
|
||||||
Log.e("onFailure", String.valueOf(response.code()));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
alertDialog.setTitle(getResources().getString(R.string.infoMoreInformation));
|
||||||
|
alertDialog.setView(view);
|
||||||
|
alertDialog.setPositiveButton(getResources().getString(R.string.close), (dialog, which) -> dialog.dismiss());
|
||||||
|
alertDialog.create().show();
|
||||||
|
|
||||||
}
|
});
|
||||||
|
|
||||||
@Override
|
if(repoInfo.getHas_issues() != null) {
|
||||||
public void onFailure(@NonNull Call<UserRepositories> call, @NonNull Throwable t) {
|
tinyDb.putBoolean("hasIssues", repoInfo.getHas_issues());
|
||||||
Log.e("onFailure", t.toString());
|
}
|
||||||
}
|
else {
|
||||||
});
|
tinyDb.putBoolean("hasIssues", true);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
tinyDb.putString("repoHtmlUrl", repoInfo.getHtml_url());
|
||||||
|
|
||||||
private void getFileContents(String instanceUrl, String token, final String owner, String repo, final String filename) {
|
mProgressBar.setVisibility(View.GONE);
|
||||||
|
pageContent.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
final TinyDB tinyDb = new TinyDB(getContext());
|
}
|
||||||
|
|
||||||
Call<String> call = RetrofitClient
|
}
|
||||||
.getInstance(instanceUrl, getContext())
|
else {
|
||||||
.getApiInterface()
|
Log.e("onFailure", String.valueOf(response.code()));
|
||||||
.getFileContents(token, owner, repo, filename);
|
}
|
||||||
|
|
||||||
call.enqueue(new Callback<String>() {
|
}
|
||||||
|
|
||||||
@Override
|
}
|
||||||
public void onResponse(@NonNull Call<String> call, @NonNull retrofit2.Response<String> response) {
|
|
||||||
|
|
||||||
if (isAdded()) {
|
@Override
|
||||||
|
public void onFailure(@NonNull Call<UserRepositories> call, @NonNull Throwable t) {
|
||||||
|
Log.e("onFailure", t.toString());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
if (response.code() == 200) {
|
}
|
||||||
|
|
||||||
final Markwon markwon = Markwon.builder(Objects.requireNonNull(getContext()))
|
private void getFileContents(String instanceUrl, String token, final String owner, String repo, final String filename) {
|
||||||
.usePlugin(CorePlugin.create())
|
|
||||||
.usePlugin(ImagesPlugin.create(new ImagesPlugin.ImagesConfigure() {
|
|
||||||
@Override
|
|
||||||
public void configureImages(@NonNull ImagesPlugin plugin) {
|
|
||||||
plugin.addSchemeHandler(new SchemeHandler() {
|
|
||||||
@NonNull
|
|
||||||
@Override
|
|
||||||
public ImageItem handle(@NonNull String raw, @NonNull Uri uri) {
|
|
||||||
|
|
||||||
final int resourceId = getContext().getResources().getIdentifier(
|
final TinyDB tinyDb = new TinyDB(getContext());
|
||||||
raw.substring("drawable://".length()),
|
|
||||||
"drawable",
|
|
||||||
getContext().getPackageName());
|
|
||||||
|
|
||||||
final Drawable drawable = getContext().getDrawable(resourceId);
|
Call<String> call = RetrofitClient
|
||||||
|
.getInstance(instanceUrl, getContext())
|
||||||
|
.getApiInterface()
|
||||||
|
.getFileContents(token, owner, repo, filename);
|
||||||
|
|
||||||
assert drawable != null;
|
call.enqueue(new Callback<String>() {
|
||||||
return ImageItem.withResult(drawable);
|
|
||||||
}
|
|
||||||
|
|
||||||
@NonNull
|
@Override
|
||||||
@Override
|
public void onResponse(@NonNull Call<String> call, @NonNull retrofit2.Response<String> response) {
|
||||||
public Collection<String> supportedSchemes() {
|
|
||||||
return Collections.singleton("drawable");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
plugin.placeholderProvider(new ImagesPlugin.PlaceholderProvider() {
|
|
||||||
@Nullable
|
|
||||||
@Override
|
|
||||||
public Drawable providePlaceholder(@NonNull AsyncDrawable drawable) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
plugin.addMediaDecoder(GifMediaDecoder.create(false));
|
|
||||||
plugin.addMediaDecoder(SvgMediaDecoder.create(getContext().getResources()));
|
|
||||||
plugin.addMediaDecoder(SvgMediaDecoder.create());
|
|
||||||
plugin.defaultMediaDecoder(DefaultMediaDecoder.create(getContext().getResources()));
|
|
||||||
plugin.defaultMediaDecoder(DefaultMediaDecoder.create());
|
|
||||||
}
|
|
||||||
}))
|
|
||||||
.usePlugin(new AbstractMarkwonPlugin() {
|
|
||||||
@Override
|
|
||||||
public void configureTheme(@NonNull MarkwonTheme.Builder builder) {
|
|
||||||
builder
|
|
||||||
.codeTextColor(tinyDb.getInt("codeBlockColor"))
|
|
||||||
.codeBackgroundColor(tinyDb.getInt("codeBlockBackground"))
|
|
||||||
.linkColor(getResources().getColor(R.color.lightBlue));
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.usePlugin(TablePlugin.create(getContext()))
|
|
||||||
.usePlugin(TaskListPlugin.create(getContext()))
|
|
||||||
.usePlugin(HtmlPlugin.create())
|
|
||||||
.usePlugin(StrikethroughPlugin.create())
|
|
||||||
.usePlugin(LinkifyPlugin.create())
|
|
||||||
.build();
|
|
||||||
|
|
||||||
Spanned bodyWithMD = null;
|
if (isAdded()) {
|
||||||
|
|
||||||
if (response.body() != null) {
|
if (response.code() == 200) {
|
||||||
bodyWithMD = markwon.toMarkdown(response.body());
|
|
||||||
}
|
|
||||||
|
|
||||||
assert bodyWithMD != null;
|
final Markwon markwon = Markwon.builder(Objects.requireNonNull(getContext()))
|
||||||
markwon.setParsedMarkdown(repoFileContents, bodyWithMD);
|
.usePlugin(CorePlugin.create())
|
||||||
|
.usePlugin(ImagesPlugin.create(new ImagesPlugin.ImagesConfigure() {
|
||||||
|
@Override
|
||||||
|
public void configureImages(@NonNull ImagesPlugin plugin) {
|
||||||
|
plugin.addSchemeHandler(new SchemeHandler() {
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public ImageItem handle(@NonNull String raw, @NonNull Uri uri) {
|
||||||
|
|
||||||
} else if (response.code() == 401) {
|
final int resourceId = getContext().getResources().getIdentifier(
|
||||||
|
raw.substring("drawable://".length()),
|
||||||
|
"drawable",
|
||||||
|
getContext().getPackageName());
|
||||||
|
|
||||||
AlertDialogs.authorizationTokenRevokedDialog(ctx, getResources().getString(R.string.alertDialogTokenRevokedTitle),
|
final Drawable drawable = getContext().getDrawable(resourceId);
|
||||||
getResources().getString(R.string.alertDialogTokenRevokedMessage),
|
|
||||||
getResources().getString(R.string.alertDialogTokenRevokedCopyNegativeButton),
|
|
||||||
getResources().getString(R.string.alertDialogTokenRevokedCopyPositiveButton));
|
|
||||||
|
|
||||||
} else if (response.code() == 403) {
|
assert drawable != null;
|
||||||
|
return ImageItem.withResult(drawable);
|
||||||
|
}
|
||||||
|
|
||||||
Toasty.info(ctx, ctx.getString(R.string.authorizeError));
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public Collection<String> supportedSchemes() {
|
||||||
|
return Collections.singleton("drawable");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
plugin.placeholderProvider(new ImagesPlugin.PlaceholderProvider() {
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public Drawable providePlaceholder(@NonNull AsyncDrawable drawable) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
plugin.addMediaDecoder(GifMediaDecoder.create(false));
|
||||||
|
plugin.addMediaDecoder(SvgMediaDecoder.create(getContext().getResources()));
|
||||||
|
plugin.addMediaDecoder(SvgMediaDecoder.create());
|
||||||
|
plugin.defaultMediaDecoder(DefaultMediaDecoder.create(getContext().getResources()));
|
||||||
|
plugin.defaultMediaDecoder(DefaultMediaDecoder.create());
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
.usePlugin(new AbstractMarkwonPlugin() {
|
||||||
|
@Override
|
||||||
|
public void configureTheme(@NonNull MarkwonTheme.Builder builder) {
|
||||||
|
builder
|
||||||
|
.codeTextColor(tinyDb.getInt("codeBlockColor"))
|
||||||
|
.codeBackgroundColor(tinyDb.getInt("codeBlockBackground"))
|
||||||
|
.linkColor(getResources().getColor(R.color.lightBlue));
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.usePlugin(TablePlugin.create(getContext()))
|
||||||
|
.usePlugin(TaskListPlugin.create(getContext()))
|
||||||
|
.usePlugin(HtmlPlugin.create())
|
||||||
|
.usePlugin(StrikethroughPlugin.create())
|
||||||
|
.usePlugin(LinkifyPlugin.create())
|
||||||
|
.build();
|
||||||
|
|
||||||
} else if (response.code() == 404) {
|
Spanned bodyWithMD = null;
|
||||||
|
|
||||||
fileContentsFrameHeader.setVisibility(View.GONE);
|
if (response.body() != null) {
|
||||||
fileContentsFrame.setVisibility(View.GONE);
|
bodyWithMD = markwon.toMarkdown(response.body());
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
assert bodyWithMD != null;
|
||||||
|
markwon.setParsedMarkdown(repoFileContents, bodyWithMD);
|
||||||
|
|
||||||
Toasty.info(getContext(), getString(R.string.genericError));
|
} else if (response.code() == 401) {
|
||||||
|
|
||||||
}
|
AlertDialogs.authorizationTokenRevokedDialog(ctx, getResources().getString(R.string.alertDialogTokenRevokedTitle),
|
||||||
}
|
getResources().getString(R.string.alertDialogTokenRevokedMessage),
|
||||||
|
getResources().getString(R.string.alertDialogTokenRevokedCopyNegativeButton),
|
||||||
|
getResources().getString(R.string.alertDialogTokenRevokedCopyPositiveButton));
|
||||||
|
|
||||||
}
|
} else if (response.code() == 403) {
|
||||||
|
|
||||||
@Override
|
Toasty.info(ctx, ctx.getString(R.string.authorizeError));
|
||||||
public void onFailure(@NonNull Call<String> call, @NonNull Throwable t) {
|
|
||||||
Log.e("onFailure", t.toString());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
} else if (response.code() == 404) {
|
||||||
|
|
||||||
|
fileContentsFrameHeader.setVisibility(View.GONE);
|
||||||
|
fileContentsFrame.setVisibility(View.GONE);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
Toasty.info(getContext(), getString(R.string.genericError));
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(@NonNull Call<String> call, @NonNull Throwable t) {
|
||||||
|
Log.e("onFailure", t.toString());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
package org.mian.gitnex.helpers;
|
package org.mian.gitnex.helpers;
|
||||||
|
|
||||||
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
|
import android.graphics.drawable.BitmapDrawable;
|
||||||
|
import android.widget.ImageView;
|
||||||
import androidx.annotation.ColorInt;
|
import androidx.annotation.ColorInt;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -16,7 +19,7 @@ public class ColorInverter {
|
|||||||
|
|
||||||
int d;
|
int d;
|
||||||
if (a < 0.5) {
|
if (a < 0.5) {
|
||||||
d = 0; // black
|
d = 30; // almost black
|
||||||
} else {
|
} else {
|
||||||
d = 255; // white
|
d = 255; // white
|
||||||
}
|
}
|
||||||
@ -24,4 +27,20 @@ public class ColorInverter {
|
|||||||
return Color.rgb(d, d, d);
|
return Color.rgb(d, d, d);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ColorInt
|
||||||
|
public int getImageViewContrastColor(ImageView imageView) {
|
||||||
|
|
||||||
|
if(imageView != null) {
|
||||||
|
|
||||||
|
Bitmap bitmap = ((BitmapDrawable) imageView.getDrawable()).getBitmap();
|
||||||
|
return getContrastColor(bitmap.getPixel(bitmap.getWidth() / 2, bitmap.getHeight() / 2));
|
||||||
|
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
|
||||||
|
return Color.rgb(255, 255, 255);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
145
app/src/main/java/org/mian/gitnex/helpers/ParseDiff.java
Normal file
145
app/src/main/java/org/mian/gitnex/helpers/ParseDiff.java
Normal file
@ -0,0 +1,145 @@
|
|||||||
|
package org.mian.gitnex.helpers;
|
||||||
|
|
||||||
|
import org.mian.gitnex.models.FileDiffView;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Author 6543
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class ParseDiff {
|
||||||
|
|
||||||
|
private static String[] getFileNames(String raw) {
|
||||||
|
|
||||||
|
String[] lines2 = raw.split(" b/");
|
||||||
|
if(lines2.length < 2) {
|
||||||
|
return new String[1];
|
||||||
|
}
|
||||||
|
String oldName = lines2[0];
|
||||||
|
String newName = lines2[1].split("\\n")[0];
|
||||||
|
return new String[]{oldName, newName};
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String getFileInfo(String raw) {
|
||||||
|
|
||||||
|
if(raw.contains("\ndeleted file mode \\d+\n")) {
|
||||||
|
return "delete";
|
||||||
|
}
|
||||||
|
else if(raw.contains("\nnew file mode \\d+\n")) {
|
||||||
|
return "new";
|
||||||
|
}
|
||||||
|
return "change";
|
||||||
|
}
|
||||||
|
|
||||||
|
private static int[] countRemoveAdd(String raw) {
|
||||||
|
|
||||||
|
int rm = 0, add = 0;
|
||||||
|
|
||||||
|
Pattern rmPattern = Pattern.compile("\n-");
|
||||||
|
Pattern addPattern = Pattern.compile("\n\\+");
|
||||||
|
Matcher rmMatcher = rmPattern.matcher(raw);
|
||||||
|
Matcher addMatcher = addPattern.matcher(raw);
|
||||||
|
|
||||||
|
while(rmMatcher.find())
|
||||||
|
rm++;
|
||||||
|
while(addMatcher.find())
|
||||||
|
add++;
|
||||||
|
|
||||||
|
return new int[]{rm, add};
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<FileDiffView> getFileDiffViewArray(String raw) {
|
||||||
|
|
||||||
|
List<FileDiffView> fileContentsArray = new ArrayList<>();
|
||||||
|
|
||||||
|
String[] lines = raw.split("(^|\\n)diff --git a/");
|
||||||
|
if(lines.length > 1) {
|
||||||
|
|
||||||
|
// for each file in diff
|
||||||
|
for(int i = 1; i < lines.length; i++) {
|
||||||
|
|
||||||
|
// check if it is a binary file
|
||||||
|
if(lines[i].contains("\nBinary files a/")) {
|
||||||
|
String[] fileNames = getFileNames(lines[i]);
|
||||||
|
if(fileNames.length != 2) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
fileContentsArray.add(new FileDiffView(fileNames[0], fileNames[1], "binary", "", null));
|
||||||
|
}
|
||||||
|
|
||||||
|
// check if it is a binary patch
|
||||||
|
else if(lines[i].contains("\nGIT binary patch\n")) {
|
||||||
|
String[] fileNames = getFileNames(lines[i]);
|
||||||
|
if(fileNames.length != 2) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
String[] tmp = lines[i].split("literal \\d+\\n");
|
||||||
|
String rawContent = "";
|
||||||
|
if(tmp.length >= 2) {
|
||||||
|
rawContent = tmp[1].replace("\n", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
List<FileDiffView.Content> contents = new ArrayList<>();
|
||||||
|
contents.add(new FileDiffView.Content(rawContent));
|
||||||
|
fileContentsArray.add(new FileDiffView(fileNames[0], fileNames[1], "binary", getFileInfo(lines[i]), contents));
|
||||||
|
}
|
||||||
|
|
||||||
|
// check if it is normal diff
|
||||||
|
else if(lines[i].contains("\n@@ -")) {
|
||||||
|
String[] fileNames = getFileNames(lines[i]);
|
||||||
|
if(fileNames.length != 2) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
String[] rawDiffs = lines[i].split("\n@@ -");
|
||||||
|
if(rawDiffs.length <= 1) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
List<FileDiffView.Content> contents = new ArrayList<>();
|
||||||
|
// parse each section starting with "@@" at line beginning
|
||||||
|
for(int j = 1; j < rawDiffs.length; j++) {
|
||||||
|
// remove stats info (ending with @@)
|
||||||
|
// raw diff is the whole raw diff without any diff meta info's
|
||||||
|
String[] rawDiff = rawDiffs[j].split("^\\d+(,\\d+)? \\+\\d+(,\\d+)? @@");
|
||||||
|
if(rawDiff.length <= 1) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// extract the diff stats info of the first line
|
||||||
|
String statsLine = rawDiffs[j].split("\n")[0].split(" @@")[0];
|
||||||
|
|
||||||
|
// parse "-1,2 +2,3" and "-1 -3" and so on
|
||||||
|
int oldStart = 0, newStart = 0;
|
||||||
|
String diffPos[] = statsLine.split(" \\+");
|
||||||
|
if(diffPos.length == 2) {
|
||||||
|
oldStart = Integer.parseInt(diffPos[0].split(",")[0]);
|
||||||
|
newStart = Integer.parseInt(diffPos[1].split(",")[0]);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// get stat
|
||||||
|
int[] stats = countRemoveAdd(rawDiff[1]);
|
||||||
|
|
||||||
|
contents.add(new FileDiffView.Content(rawDiff[1], oldStart, newStart, stats[0], stats[1]));
|
||||||
|
}
|
||||||
|
fileContentsArray.add(new FileDiffView(fileNames[0], fileNames[1], "diff", getFileInfo(lines[i]), contents));
|
||||||
|
}
|
||||||
|
|
||||||
|
// a rename
|
||||||
|
else if(lines[i].contains("\nrename from")) {
|
||||||
|
String[] lines2 = lines[i].split("\\nrename (from|to )");
|
||||||
|
if(lines2.length != 3) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
fileContentsArray.add(new FileDiffView(lines2[1], lines2[2].split("\\n")[0], "rename", "rename", null));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return fileContentsArray;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,6 +1,6 @@
|
|||||||
package org.mian.gitnex.helpers;
|
package org.mian.gitnex.helpers;
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import androidx.annotation.NonNull;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
@ -70,7 +70,7 @@ public class Version {
|
|||||||
* @param v
|
* @param v
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public boolean equal(@NotNull Version v) {
|
public boolean equal(@NonNull Version v) {
|
||||||
|
|
||||||
int rounds = Math.min(this.values.size(), v.values.size());
|
int rounds = Math.min(this.values.size(), v.values.size());
|
||||||
for(int i = 0; i < rounds; i++) {
|
for(int i = 0; i < rounds; i++) {
|
||||||
@ -101,7 +101,7 @@ public class Version {
|
|||||||
* @param v
|
* @param v
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public boolean less(@NotNull Version v) {
|
public boolean less(@NonNull Version v) {
|
||||||
|
|
||||||
int rounds = Math.min(this.values.size(), v.values.size());
|
int rounds = Math.min(this.values.size(), v.values.size());
|
||||||
for(int i = 0; i < rounds; i++) {
|
for(int i = 0; i < rounds; i++) {
|
||||||
@ -142,7 +142,7 @@ public class Version {
|
|||||||
* @param v
|
* @param v
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public boolean higher(@NotNull Version v) {
|
public boolean higher(@NonNull Version v) {
|
||||||
|
|
||||||
int rounds = Math.min(this.values.size(), v.values.size());
|
int rounds = Math.min(this.values.size(), v.values.size());
|
||||||
for(int i = 0; i < rounds; i++) {
|
for(int i = 0; i < rounds; i++) {
|
||||||
@ -182,7 +182,7 @@ public class Version {
|
|||||||
* @param v
|
* @param v
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public boolean lessOrEqual(@NotNull Version v) {
|
public boolean lessOrEqual(@NonNull Version v) {
|
||||||
|
|
||||||
int rounds = Math.min(this.values.size(), v.values.size());
|
int rounds = Math.min(this.values.size(), v.values.size());
|
||||||
for(int i = 0; i < rounds; i++) {
|
for(int i = 0; i < rounds; i++) {
|
||||||
@ -213,7 +213,7 @@ public class Version {
|
|||||||
* @param v
|
* @param v
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public boolean higherOrEqual(@NotNull Version v) {
|
public boolean higherOrEqual(@NonNull Version v) {
|
||||||
|
|
||||||
int rounds = Math.min(this.values.size(), v.values.size());
|
int rounds = Math.min(this.values.size(), v.values.size());
|
||||||
for(int i = 0; i < rounds; i++) {
|
for(int i = 0; i < rounds; i++) {
|
||||||
@ -225,4 +225,4 @@ public class Version {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -605,7 +605,7 @@ public class MemorizingTrustManager implements X509TrustManager {
|
|||||||
|
|
||||||
private boolean interactHostname(X509Certificate cert, String hostname) {
|
private boolean interactHostname(X509Certificate cert, String hostname) {
|
||||||
|
|
||||||
if(interact(hostNameMessage(cert, hostname), R.string.mtm_accept_servername) == MTMDecision.DECISION_ALWAYS) {
|
if(interact(hostNameMessage(cert, hostname), R.string.mtm_accept_server_name) == MTMDecision.DECISION_ALWAYS) {
|
||||||
storeCert(hostname, cert);
|
storeCert(hostname, cert);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -267,11 +267,14 @@ public interface ApiInterface {
|
|||||||
@GET("repos/{owner}/{repo}/pulls") // get repository pull requests
|
@GET("repos/{owner}/{repo}/pulls") // get repository pull requests
|
||||||
Call<List<PullRequests>> getPullRequests(@Header("Authorization") String token, @Path("owner") String owner, @Path("repo") String repo, @Query("page") int page, @Query("state") String state, @Query("limit") int limit);
|
Call<List<PullRequests>> getPullRequests(@Header("Authorization") String token, @Path("owner") String owner, @Path("repo") String repo, @Query("page") int page, @Query("state") String state, @Query("limit") int limit);
|
||||||
|
|
||||||
|
@GET("repos/{owner}/{repo}/pulls/{index}.diff") // get pull diff file contents
|
||||||
|
Call<ResponseBody> getPullDiffContent(@Header("Authorization") String token, @Path("owner") String owner, @Path("repo") String repo, @Path("index") String pullIndex);
|
||||||
|
|
||||||
@POST("repos/{owner}/{repo}/pulls/{index}/merge") // merge a pull request
|
@POST("repos/{owner}/{repo}/pulls/{index}/merge") // merge a pull request
|
||||||
Call<ResponseBody> mergePullRequest(@Header("Authorization") String token, @Path("owner") String ownerName, @Path("repo") String repoName, @Path("index") int index, @Body MergePullRequest jsonStr);
|
Call<ResponseBody> mergePullRequest(@Header("Authorization") String token, @Path("owner") String ownerName, @Path("repo") String repoName, @Path("index") int index, @Body MergePullRequest jsonStr);
|
||||||
|
|
||||||
@GET("repos/{owner}/{repo}/commits") // get all commits
|
@GET("repos/{owner}/{repo}/commits") // get all commits
|
||||||
Call<List<Commits>> getRepositoryCommits(@Header("Authorization") String token, @Path("owner") String owner, @Path("repo") String repo, @Query("page") int page, @Query("sha") String branchName);
|
Call<List<Commits>> getRepositoryCommits(@Header("Authorization") String token, @Path("owner") String owner, @Path("repo") String repo, @Query("page") int page, @Query("sha") String branchName, @Query("limit") int limit);
|
||||||
|
|
||||||
@PATCH("repos/{owner}/{repo}/milestones/{index}") // close / reopen milestone
|
@PATCH("repos/{owner}/{repo}/milestones/{index}") // close / reopen milestone
|
||||||
Call<JsonElement> closeReopenMilestone(@Header("Authorization") String token, @Path("owner") String ownerName, @Path("repo") String repoName, @Path("index") int index, @Body Milestones jsonStr);
|
Call<JsonElement> closeReopenMilestone(@Header("Authorization") String token, @Path("owner") String ownerName, @Path("repo") String repoName, @Path("index") int index, @Body Milestones jsonStr);
|
||||||
|
@ -1,39 +1,159 @@
|
|||||||
package org.mian.gitnex.models;
|
package org.mian.gitnex.models;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Author M M Arif
|
* Author M M Arif
|
||||||
|
* Author 6543
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class FileDiffView {
|
public class FileDiffView {
|
||||||
|
|
||||||
private String fileName;
|
private String fileNewName;
|
||||||
private boolean fileType;
|
private String fileOldName;
|
||||||
private String fileInfo;
|
private String diffType;
|
||||||
private String fileContents;
|
private String fileInfo;
|
||||||
|
private Stats stats;
|
||||||
|
private List<Content> contents;
|
||||||
|
|
||||||
public FileDiffView(String fileName, boolean fileType, String fileInfo, String fileContents)
|
public class Stats {
|
||||||
{
|
|
||||||
|
|
||||||
this.fileName = fileName;
|
private int lineAdded;
|
||||||
this.fileType = fileType;
|
private int lineRemoved;
|
||||||
this.fileInfo = fileInfo;
|
|
||||||
this.fileContents = fileContents;
|
|
||||||
|
|
||||||
}
|
public Stats(int added, int removed) {
|
||||||
|
|
||||||
public String getFileName() {
|
this.lineAdded = added;
|
||||||
return fileName;
|
this.lineRemoved = removed;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isFileType() {
|
public int getAdded() {
|
||||||
return fileType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getFileInfo() {
|
return lineAdded;
|
||||||
return fileInfo;
|
}
|
||||||
}
|
|
||||||
|
public int getRemoved() {
|
||||||
|
|
||||||
|
return lineRemoved;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
public String toString() {
|
||||||
|
|
||||||
|
return "+" + this.lineAdded + ", -" + this.lineRemoved;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Content {
|
||||||
|
|
||||||
|
private int lineAdded;
|
||||||
|
private int lineRemoved;
|
||||||
|
private int oldLineStart;
|
||||||
|
private int newLineStart;
|
||||||
|
private String raw;
|
||||||
|
|
||||||
|
public Content(String content) {
|
||||||
|
|
||||||
|
this.raw = content;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Content(String content, int oldStart, int newStart, int removed, int added) {
|
||||||
|
|
||||||
|
this.raw = content;
|
||||||
|
this.lineAdded = added;
|
||||||
|
this.lineRemoved = removed;
|
||||||
|
this.oldLineStart = oldStart;
|
||||||
|
this.newLineStart = newStart;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRaw() {
|
||||||
|
|
||||||
|
return raw;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getLineAdded() {
|
||||||
|
|
||||||
|
return this.lineAdded;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getLineRemoved() {
|
||||||
|
|
||||||
|
return this.lineRemoved;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getOldLineStart() {
|
||||||
|
|
||||||
|
return this.oldLineStart;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getNewLineStart() {
|
||||||
|
|
||||||
|
return this.newLineStart;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public FileDiffView(String oldName, String newName, String diffType, String fileInfo, List<Content> fileContents) {
|
||||||
|
|
||||||
|
this.fileNewName = newName.trim();
|
||||||
|
this.fileOldName = oldName.trim();
|
||||||
|
this.diffType = diffType;
|
||||||
|
this.fileInfo = fileInfo;
|
||||||
|
this.contents = fileContents;
|
||||||
|
this.stats = new Stats(0, 0);
|
||||||
|
if(fileContents != null) {
|
||||||
|
for(Content content : this.contents) {
|
||||||
|
stats.lineAdded += content.lineAdded;
|
||||||
|
stats.lineRemoved += content.lineRemoved;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFileName() {
|
||||||
|
|
||||||
|
if(fileOldName.length() != 0 && !fileOldName.equals(fileNewName)) {
|
||||||
|
return fileOldName + " -> " + fileNewName;
|
||||||
|
}
|
||||||
|
return fileNewName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isFileBinary() {
|
||||||
|
|
||||||
|
return diffType.equals("binary");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFileInfo() {
|
||||||
|
|
||||||
|
if(diffType.equals("binary")) {
|
||||||
|
return diffType + " " + fileInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(fileInfo.equals("change") && this.stats != null) {
|
||||||
|
return this.stats.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
return fileInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
public String toString() {
|
||||||
|
|
||||||
|
StringBuilder raw = new StringBuilder();
|
||||||
|
if(this.contents != null) {
|
||||||
|
for(Content c : this.contents) {
|
||||||
|
raw.append(c.getRaw());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return raw.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
public List<Content> getFileContents() {
|
||||||
|
|
||||||
|
return this.contents;
|
||||||
|
}
|
||||||
|
|
||||||
public String getFileContents() {
|
|
||||||
return fileContents;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -31,6 +31,7 @@ public class UserRepositories {
|
|||||||
private String forks_count;
|
private String forks_count;
|
||||||
private Boolean has_issues;
|
private Boolean has_issues;
|
||||||
private String avatar_url;
|
private String avatar_url;
|
||||||
|
private boolean archived;
|
||||||
|
|
||||||
private permissionsObject permissions;
|
private permissionsObject permissions;
|
||||||
|
|
||||||
@ -167,4 +168,24 @@ public class UserRepositories {
|
|||||||
return avatar_url;
|
return avatar_url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isPrivateFlag() {
|
||||||
|
|
||||||
|
return privateFlag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOpen_pr_counter() {
|
||||||
|
|
||||||
|
return open_pr_counter;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRelease_counter() {
|
||||||
|
|
||||||
|
return release_counter;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isArchived() {
|
||||||
|
|
||||||
|
return archived;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -23,271 +23,278 @@ import java.util.Locale;
|
|||||||
|
|
||||||
public class AppUtil {
|
public class AppUtil {
|
||||||
|
|
||||||
public static String strReplace(String str, String original, String replace) {
|
public static String strReplace(String str, String original, String replace) {
|
||||||
return str.replace(original, replace);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean haveNetworkConnection(Context context) {
|
|
||||||
boolean haveConnectedWifi = false;
|
|
||||||
boolean haveConnectedMobile = false;
|
|
||||||
|
|
||||||
ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
|
|
||||||
assert cm != null;
|
|
||||||
NetworkInfo[] netInfo = cm.getAllNetworkInfo();
|
|
||||||
for (NetworkInfo ni : netInfo) {
|
|
||||||
if (ni.getTypeName().equalsIgnoreCase("WIFI"))
|
|
||||||
if (ni.isConnected())
|
|
||||||
haveConnectedWifi = true;
|
|
||||||
if (ni.getTypeName().equalsIgnoreCase("MOBILE"))
|
|
||||||
if (ni.isConnected())
|
|
||||||
haveConnectedMobile = true;
|
|
||||||
}
|
|
||||||
return haveConnectedWifi || haveConnectedMobile;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int getAppBuildNo(Context context) {
|
|
||||||
try {
|
|
||||||
PackageInfo packageInfo = context.getPackageManager()
|
|
||||||
.getPackageInfo(context.getPackageName(), 0);
|
|
||||||
return packageInfo.versionCode;
|
|
||||||
} catch (PackageManager.NameNotFoundException e) {
|
|
||||||
throw new RuntimeException("Could not get package name: " + e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getAppVersion(Context context) {
|
|
||||||
try {
|
|
||||||
PackageInfo packageInfo = context.getPackageManager()
|
|
||||||
.getPackageInfo(context.getPackageName(), 0);
|
|
||||||
return packageInfo.versionName;
|
|
||||||
} catch (PackageManager.NameNotFoundException e) {
|
|
||||||
throw new RuntimeException("Could not get package name: " + e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public int charactersLength(String str) {
|
|
||||||
return str.length();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean checkStringsWithAlphaNumeric(String str) { // [a-zA-Z0-9]
|
|
||||||
return str.matches("^[\\w]+$");
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean checkStrings(String str) { // [a-zA-Z0-9-_. ]
|
|
||||||
return str.matches("^[\\w .-]+$");
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean checkStringsWithAlphaNumericDashDotUnderscore(String str) { // [a-zA-Z0-9-_]
|
|
||||||
return str.matches("^[\\w.-]+$");
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean checkStringsWithDash(String str) { // [a-zA-Z0-9-_. ]
|
|
||||||
return str.matches("^[\\w-]+$");
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean checkIntegers(String str) {
|
|
||||||
return str.matches("\\d+");
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getResponseStatusCode(String u) throws Exception {
|
|
||||||
|
|
||||||
URL url = new URL(u);
|
|
||||||
HttpURLConnection http = (HttpURLConnection) url.openConnection();
|
|
||||||
return (http.getResponseCode());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void setAppLocale(Resources resource, String locCode) {
|
|
||||||
|
|
||||||
DisplayMetrics dm = resource.getDisplayMetrics();
|
|
||||||
Configuration config = resource.getConfiguration();
|
|
||||||
config.setLocale(new Locale(locCode.toLowerCase()));
|
|
||||||
resource.updateConfiguration(config, dm);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean httpCheck(String url) {
|
|
||||||
|
|
||||||
String pattern = "^(http|https)://.*$";
|
|
||||||
return url.matches(pattern);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String formatFileSize(long size) {
|
|
||||||
|
|
||||||
String repoSize = null;
|
|
||||||
|
|
||||||
double m = size/1024.0;
|
|
||||||
double g = ((size/1024.0)/1024.0);
|
|
||||||
double t = (((size/1024.0)/1024.0)/1024.0);
|
|
||||||
|
|
||||||
DecimalFormat dec = new DecimalFormat("0.00");
|
|
||||||
|
|
||||||
if ( t > 1 ) {
|
|
||||||
repoSize = dec.format(t).concat(" TB");
|
|
||||||
}
|
|
||||||
else if ( g > 1 ) {
|
|
||||||
repoSize = dec.format(g).concat(" GB");
|
|
||||||
}
|
|
||||||
else if ( m > 1 ) {
|
|
||||||
repoSize = dec.format(m).concat(" MB");
|
|
||||||
}
|
|
||||||
else if ( (double) size > 1 ) {
|
|
||||||
repoSize = dec.format((double) size).concat(" KB");
|
|
||||||
}
|
|
||||||
|
|
||||||
return repoSize;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String formatFileSizeInDetail(long size) {
|
|
||||||
|
|
||||||
String fileSize = null;
|
return str.replace(original, replace);
|
||||||
|
}
|
||||||
|
|
||||||
double k = size/1024.0;
|
public static boolean haveNetworkConnection(Context context) {
|
||||||
double m = ((size/1024.0)/1024.0);
|
|
||||||
double g = (((size/1024.0)/1024.0)/1024.0);
|
|
||||||
double t = ((((size/1024.0)/1024.0)/1024.0)/1024.0);
|
|
||||||
|
|
||||||
DecimalFormat dec = new DecimalFormat("0.00");
|
boolean haveConnectedWifi = false;
|
||||||
|
boolean haveConnectedMobile = false;
|
||||||
|
|
||||||
if ( t > 1 ) {
|
ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||||
fileSize = dec.format(t).concat(" TB");
|
assert cm != null;
|
||||||
}
|
NetworkInfo[] netInfo = cm.getAllNetworkInfo();
|
||||||
else if ( g > 1 ) {
|
for(NetworkInfo ni : netInfo) {
|
||||||
fileSize = dec.format(g).concat(" GB");
|
if(ni.getTypeName().equalsIgnoreCase("WIFI")) {
|
||||||
}
|
if(ni.isConnected()) {
|
||||||
else if ( m > 1 ) {
|
haveConnectedWifi = true;
|
||||||
fileSize = dec.format(m).concat(" MB");
|
}
|
||||||
}
|
}
|
||||||
else if ( k > 1 ) {
|
if(ni.getTypeName().equalsIgnoreCase("MOBILE")) {
|
||||||
fileSize = dec.format(k).concat(" KB");
|
if(ni.isConnected()) {
|
||||||
}
|
haveConnectedMobile = true;
|
||||||
else if ( (double) size > 1 ) {
|
}
|
||||||
fileSize = dec.format((double) size).concat(" B");
|
}
|
||||||
}
|
}
|
||||||
|
return haveConnectedWifi || haveConnectedMobile;
|
||||||
|
}
|
||||||
|
|
||||||
return fileSize;
|
public static int getAppBuildNo(Context context) {
|
||||||
|
|
||||||
}
|
try {
|
||||||
|
PackageInfo packageInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0);
|
||||||
|
return packageInfo.versionCode;
|
||||||
|
}
|
||||||
|
catch(PackageManager.NameNotFoundException e) {
|
||||||
|
throw new RuntimeException("Could not get package name: " + e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static String customDateFormat(String customDate) {
|
public static String getAppVersion(Context context) {
|
||||||
|
|
||||||
String[] parts = customDate.split("-");
|
try {
|
||||||
final String year = parts[0];
|
PackageInfo packageInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0);
|
||||||
final String month = parts[1];
|
return packageInfo.versionName;
|
||||||
final String day = parts[2];
|
}
|
||||||
|
catch(PackageManager.NameNotFoundException e) {
|
||||||
|
throw new RuntimeException("Could not get package name: " + e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
String sMonth;
|
public int charactersLength(String str) {
|
||||||
if (Integer.parseInt(month) < 10) {
|
|
||||||
sMonth = "0"+ month;
|
return str.length();
|
||||||
} else {
|
}
|
||||||
sMonth = month;
|
|
||||||
}
|
|
||||||
|
|
||||||
String sDay;
|
public Boolean checkStringsWithAlphaNumeric(String str) { // [a-zA-Z0-9]
|
||||||
if (Integer.parseInt(day) < 10) {
|
return str.matches("^[\\w]+$");
|
||||||
sDay = "0"+ day;
|
}
|
||||||
} else {
|
|
||||||
sDay = day;
|
|
||||||
}
|
|
||||||
|
|
||||||
return year + "-" + sMonth + "-" + sDay;
|
public Boolean checkStrings(String str) { // [a-zA-Z0-9-_. ]
|
||||||
|
return str.matches("^[\\w .-]+$");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
public Boolean checkStringsWithAlphaNumericDashDotUnderscore(String str) { // [a-zA-Z0-9-_]
|
||||||
|
return str.matches("^[\\w.-]+$");
|
||||||
|
}
|
||||||
|
|
||||||
public static String customDateCombine(String customDate) {
|
public Boolean checkStringsWithDash(String str) { // [a-zA-Z0-9-_. ]
|
||||||
|
return str.matches("^[\\w-]+$");
|
||||||
|
}
|
||||||
|
|
||||||
final Calendar c = Calendar.getInstance();
|
public Boolean checkIntegers(String str) {
|
||||||
int mHour = c.get(Calendar.HOUR_OF_DAY);
|
|
||||||
int mMinute = c.get(Calendar.MINUTE);
|
|
||||||
int mSeconds = c.get(Calendar.SECOND);
|
|
||||||
|
|
||||||
String sMin;
|
return str.matches("\\d+");
|
||||||
if ((mMinute) < 10) {
|
}
|
||||||
sMin = "0"+ mMinute;
|
|
||||||
} else {
|
public int getResponseStatusCode(String u) throws Exception {
|
||||||
sMin = String.valueOf(mMinute);
|
|
||||||
}
|
URL url = new URL(u);
|
||||||
|
HttpURLConnection http = (HttpURLConnection) url.openConnection();
|
||||||
|
return (http.getResponseCode());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setAppLocale(Resources resource, String locCode) {
|
||||||
|
|
||||||
String sSec;
|
DisplayMetrics dm = resource.getDisplayMetrics();
|
||||||
if ((mSeconds) < 10) {
|
Configuration config = resource.getConfiguration();
|
||||||
sSec = "0"+ mSeconds;
|
config.setLocale(new Locale(locCode.toLowerCase()));
|
||||||
} else {
|
resource.updateConfiguration(config, dm);
|
||||||
sSec = String.valueOf(mSeconds);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (customDate + "T" + mHour + ":" + sMin + ":" + sSec + "Z");
|
}
|
||||||
|
|
||||||
}
|
public static boolean httpCheck(String url) {
|
||||||
|
|
||||||
public String encodeBase64(String str) {
|
String pattern = "^(http|https)://.*$";
|
||||||
|
return url.matches(pattern);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String formatFileSize(long size) {
|
||||||
|
|
||||||
|
String repoSize = null;
|
||||||
|
|
||||||
|
double m = size / 1024.0;
|
||||||
|
double g = ((size / 1024.0) / 1024.0);
|
||||||
|
double t = (((size / 1024.0) / 1024.0) / 1024.0);
|
||||||
|
|
||||||
|
DecimalFormat dec = new DecimalFormat("0.00");
|
||||||
|
|
||||||
|
if(t > 1) {
|
||||||
|
repoSize = dec.format(t).concat(" TB");
|
||||||
|
}
|
||||||
|
else if(g > 1) {
|
||||||
|
repoSize = dec.format(g).concat(" GB");
|
||||||
|
}
|
||||||
|
else if(m > 1) {
|
||||||
|
repoSize = dec.format(m).concat(" MB");
|
||||||
|
}
|
||||||
|
else if((double) size > 1) {
|
||||||
|
repoSize = dec.format((double) size).concat(" KB");
|
||||||
|
}
|
||||||
|
|
||||||
String base64Str = str;
|
return repoSize;
|
||||||
if(!str.equals("")) {
|
|
||||||
byte[] data = str.getBytes(StandardCharsets.UTF_8);
|
|
||||||
base64Str = Base64.encodeToString(data, Base64.DEFAULT);
|
|
||||||
}
|
|
||||||
|
|
||||||
return base64Str;
|
}
|
||||||
|
|
||||||
}
|
public static String formatFileSizeInDetail(long size) {
|
||||||
|
|
||||||
public String decodeBase64(String str) {
|
String fileSize = null;
|
||||||
|
|
||||||
String base64Str = str;
|
double k = size / 1024.0;
|
||||||
if(!str.equals("")) {
|
double m = ((size / 1024.0) / 1024.0);
|
||||||
byte[] data = Base64.decode(base64Str, Base64.DEFAULT);
|
double g = (((size / 1024.0) / 1024.0) / 1024.0);
|
||||||
base64Str = new String(data, StandardCharsets.UTF_8);
|
double t = ((((size / 1024.0) / 1024.0) / 1024.0) / 1024.0);
|
||||||
}
|
|
||||||
|
|
||||||
return base64Str;
|
DecimalFormat dec = new DecimalFormat("0.00");
|
||||||
|
|
||||||
}
|
if(t > 1) {
|
||||||
|
fileSize = dec.format(t).concat(" TB");
|
||||||
|
}
|
||||||
|
else if(g > 1) {
|
||||||
|
fileSize = dec.format(g).concat(" GB");
|
||||||
|
}
|
||||||
|
else if(m > 1) {
|
||||||
|
fileSize = dec.format(m).concat(" MB");
|
||||||
|
}
|
||||||
|
else if(k > 1) {
|
||||||
|
fileSize = dec.format(k).concat(" KB");
|
||||||
|
}
|
||||||
|
else if((double) size > 1) {
|
||||||
|
fileSize = dec.format((double) size).concat(" B");
|
||||||
|
}
|
||||||
|
|
||||||
public Boolean sourceCodeExtension(String ext) {
|
return fileSize;
|
||||||
|
|
||||||
String[] extValues = new String[] {"md", "json", "java", "go", "php", "c", "cc", "cpp", "h", "cxx", "cyc", "m",
|
}
|
||||||
"cs", "bash", "sh", "bsh", "cv", "python", "perl", "pm", "rb", "ruby", "javascript",
|
|
||||||
"coffee", "rc", "rs", "rust", "basic", "clj", "css", "dart", "lisp", "erl", "hs", "lsp", "rkt",
|
|
||||||
"ss", "llvm", "ll", "lua", "matlab", "pascal", "r", "scala", "sql", "latex", "tex", "vb", "vbs",
|
|
||||||
"vhd", "tcl", "wiki.meta", "yaml", "yml", "markdown", "xml", "proto", "regex", "py", "pl", "js",
|
|
||||||
"html", "htm", "volt", "ini", "htaccess", "conf", "gitignore", "gradle", "txt", "properties", "bat",
|
|
||||||
"twig"};
|
|
||||||
|
|
||||||
return Arrays.asList(extValues).contains(ext);
|
public static String customDateFormat(String customDate) {
|
||||||
|
|
||||||
}
|
String[] parts = customDate.split("-");
|
||||||
|
final String year = parts[0];
|
||||||
|
final String month = parts[1];
|
||||||
|
final String day = parts[2];
|
||||||
|
|
||||||
public Boolean pdfExtension(String ext) {
|
String sMonth;
|
||||||
|
if(Integer.parseInt(month) < 10) {
|
||||||
|
sMonth = "0" + month;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
sMonth = month;
|
||||||
|
}
|
||||||
|
|
||||||
String[] extValues = new String[] {"pdf"};
|
String sDay;
|
||||||
|
if(Integer.parseInt(day) < 10) {
|
||||||
|
sDay = "0" + day;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
sDay = day;
|
||||||
|
}
|
||||||
|
|
||||||
return Arrays.asList(extValues).contains(ext);
|
return year + "-" + sMonth + "-" + sDay;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Boolean imageExtension(String ext) {
|
public static String customDateCombine(String customDate) {
|
||||||
|
|
||||||
String[] extValues = new String[] {"jpg", "jpeg", "gif", "png", "ico"};
|
final Calendar c = Calendar.getInstance();
|
||||||
|
int mHour = c.get(Calendar.HOUR_OF_DAY);
|
||||||
|
int mMinute = c.get(Calendar.MINUTE);
|
||||||
|
int mSeconds = c.get(Calendar.SECOND);
|
||||||
|
|
||||||
return Arrays.asList(extValues).contains(ext);
|
String sMin;
|
||||||
|
if((mMinute) < 10) {
|
||||||
|
sMin = "0" + mMinute;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
sMin = String.valueOf(mMinute);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
String sSec;
|
||||||
|
if((mSeconds) < 10) {
|
||||||
|
sSec = "0" + mSeconds;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
sSec = String.valueOf(mSeconds);
|
||||||
|
}
|
||||||
|
|
||||||
public Boolean excludeFilesInFileViewerExtension(String ext) {
|
return (customDate + "T" + mHour + ":" + sMin + ":" + sSec + "Z");
|
||||||
|
|
||||||
String[] extValues = new String[] {"doc", "docx", "ppt", "pptx", "xls", "xlsx", "xlsm", "odt",
|
}
|
||||||
"ott", "odf", "ods", "ots", "exe", "jar", "odg", "otg", "odp", "otp", "bin", "dmg", "psd",
|
|
||||||
"xcf"};
|
|
||||||
|
|
||||||
return Arrays.asList(extValues).contains(ext);
|
public String encodeBase64(String str) {
|
||||||
|
|
||||||
}
|
String base64Str = str;
|
||||||
|
if(!str.equals("")) {
|
||||||
|
byte[] data = str.getBytes(StandardCharsets.UTF_8);
|
||||||
|
base64Str = Base64.encodeToString(data, Base64.DEFAULT);
|
||||||
|
}
|
||||||
|
|
||||||
public String getLastCharactersOfWord( String str, int count ) {
|
return base64Str;
|
||||||
|
|
||||||
return str.substring(str.length() - count);
|
}
|
||||||
|
|
||||||
|
public String decodeBase64(String str) {
|
||||||
|
|
||||||
|
String base64Str = str;
|
||||||
|
if(!str.equals("")) {
|
||||||
|
byte[] data = Base64.decode(base64Str, Base64.DEFAULT);
|
||||||
|
base64Str = new String(data, StandardCharsets.UTF_8);
|
||||||
|
}
|
||||||
|
|
||||||
|
return base64Str;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean sourceCodeExtension(String ext) {
|
||||||
|
|
||||||
|
String[] extValues = new String[]{"md", "json", "java", "go", "php", "c", "cc", "cpp", "h", "cxx", "cyc", "m", "cs", "bash", "sh", "bsh", "cv", "python", "perl", "pm", "rb", "ruby", "javascript", "coffee", "rc", "rs", "rust", "basic", "clj", "css", "dart", "lisp", "erl", "hs", "lsp", "rkt", "ss", "llvm", "ll", "lua", "matlab", "pascal", "r", "scala", "sql", "latex", "tex", "vb", "vbs", "vhd", "tcl", "wiki.meta", "yaml", "yml", "markdown", "xml", "proto", "regex", "py", "pl", "js", "html", "htm", "volt", "ini", "htaccess", "conf", "gitignore", "gradle", "txt", "properties", "bat", "twig"};
|
||||||
|
|
||||||
|
return Arrays.asList(extValues).contains(ext);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean pdfExtension(String ext) {
|
||||||
|
|
||||||
|
String[] extValues = new String[]{"pdf"};
|
||||||
|
|
||||||
|
return Arrays.asList(extValues).contains(ext);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean imageExtension(String ext) {
|
||||||
|
|
||||||
|
String[] extValues = new String[]{"jpg", "jpeg", "gif", "png", "ico"};
|
||||||
|
|
||||||
|
return Arrays.asList(extValues).contains(ext);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean excludeFilesInFileViewerExtension(String ext) {
|
||||||
|
|
||||||
|
String[] extValues = new String[]{"doc", "docx", "ppt", "pptx", "xls", "xlsx", "xlsm", "odt", "ott", "odf", "ods", "ots", "exe", "jar", "odg", "otg", "odp", "otp", "bin", "dmg", "psd", "xcf"};
|
||||||
|
|
||||||
|
return Arrays.asList(extValues).contains(ext);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLastCharactersOfWord(String str, int count) {
|
||||||
|
|
||||||
|
return str.substring(str.length() - count);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
5
app/src/main/res/drawable/ic_archive.xml
Normal file
5
app/src/main/res/drawable/ic_archive.xml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<vector android:height="24dp" android:tint="#368F73"
|
||||||
|
android:viewportHeight="24" android:viewportWidth="24"
|
||||||
|
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<path android:fillColor="@android:color/white" android:pathData="M20.54,5.23l-1.39,-1.68C18.88,3.21 18.47,3 18,3H6c-0.47,0 -0.88,0.21 -1.16,0.55L3.46,5.23C3.17,5.57 3,6.02 3,6.5V19c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2V6.5c0,-0.48 -0.17,-0.93 -0.46,-1.27zM12,17.5L6.5,12H10v-2h4v2h3.5L12,17.5zM5.12,5l0.81,-1h12l0.94,1H5.12z"/>
|
||||||
|
</vector>
|
5
app/src/main/res/drawable/ic_arrow_right.xml
Normal file
5
app/src/main/res/drawable/ic_arrow_right.xml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<vector android:height="24dp" android:tint="#368F73"
|
||||||
|
android:viewportHeight="24.0" android:viewportWidth="24.0"
|
||||||
|
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<path android:fillColor="#FF000000" android:pathData="M8.59,16.34l4.58,-4.59 -4.58,-4.59L10,5.75l6,6 -6,6z"/>
|
||||||
|
</vector>
|
5
app/src/main/res/drawable/ic_code.xml
Normal file
5
app/src/main/res/drawable/ic_code.xml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<vector android:height="24dp" android:tint="#368F73"
|
||||||
|
android:viewportHeight="24.0" android:viewportWidth="24.0"
|
||||||
|
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<path android:fillColor="#FF000000" android:pathData="M9.4,16.6L4.8,12l4.6,-4.6L8,6l-6,6 6,6 1.4,-1.4zM14.6,16.6l4.6,-4.6 -4.6,-4.6L16,6l6,6 -6,6 -1.4,-1.4z"/>
|
||||||
|
</vector>
|
5
app/src/main/res/drawable/ic_location.xml
Normal file
5
app/src/main/res/drawable/ic_location.xml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<vector android:height="24dp" android:tint="#368F73"
|
||||||
|
android:viewportHeight="24" android:viewportWidth="24"
|
||||||
|
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<path android:fillColor="@android:color/white" android:pathData="M12,2C8.13,2 5,5.13 5,9c0,5.25 7,13 7,13s7,-7.75 7,-13c0,-3.87 -3.13,-7 -7,-7zM12,11.5c-1.38,0 -2.5,-1.12 -2.5,-2.5s1.12,-2.5 2.5,-2.5 2.5,1.12 2.5,2.5 -1.12,2.5 -2.5,2.5z"/>
|
||||||
|
</vector>
|
@ -9,8 +9,8 @@
|
|||||||
android:right="1dp"
|
android:right="1dp"
|
||||||
android:left="1dp">
|
android:left="1dp">
|
||||||
<shape>
|
<shape>
|
||||||
<corners android:radius="15dp"/>
|
<corners android:radius="10dp"/>
|
||||||
<solid android:color="@color/divider"/>
|
<solid android:color="?attr/inputBackgroundColor"/>
|
||||||
</shape>
|
</shape>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
@ -23,9 +23,9 @@
|
|||||||
|
|
||||||
<scale android:scaleWidth="100%">
|
<scale android:scaleWidth="100%">
|
||||||
<shape>
|
<shape>
|
||||||
<corners android:radius="15dp" />
|
<corners android:radius="10dp" />
|
||||||
</shape>
|
</shape>
|
||||||
</scale>
|
</scale>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
</layer-list>
|
</layer-list>
|
||||||
|
8
app/src/main/res/drawable/shape_archived.xml
Normal file
8
app/src/main/res/drawable/shape_archived.xml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle" >
|
||||||
|
|
||||||
|
<corners android:radius="3dp"/>
|
||||||
|
<solid android:color="@color/releasePre" />
|
||||||
|
|
||||||
|
</shape>
|
14
app/src/main/res/drawable/shape_pre_release.xml
Normal file
14
app/src/main/res/drawable/shape_pre_release.xml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
|
||||||
|
<solid
|
||||||
|
android:color="@color/releasePre">
|
||||||
|
</solid>
|
||||||
|
|
||||||
|
<corners
|
||||||
|
android:radius="3dp">
|
||||||
|
</corners>
|
||||||
|
|
||||||
|
</shape>
|
14
app/src/main/res/drawable/shape_stable_release.xml
Normal file
14
app/src/main/res/drawable/shape_stable_release.xml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
|
||||||
|
<solid
|
||||||
|
android:color="@color/releaseStable">
|
||||||
|
</solid>
|
||||||
|
|
||||||
|
<corners
|
||||||
|
android:radius="3dp">
|
||||||
|
</corners>
|
||||||
|
|
||||||
|
</shape>
|
@ -54,7 +54,6 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="?attr/primaryBackgroundColor"
|
android:background="?attr/primaryBackgroundColor"
|
||||||
android:padding="4dp"
|
|
||||||
android:scrollbars="vertical" />
|
android:scrollbars="vertical" />
|
||||||
|
|
||||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
@ -70,4 +69,4 @@
|
|||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
android:visibility="visible" />
|
android:visibility="visible" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -58,7 +58,6 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="?attr/primaryBackgroundColor"
|
android:background="?attr/primaryBackgroundColor"
|
||||||
android:padding="4dp"
|
|
||||||
android:scrollbars="vertical" />
|
android:scrollbars="vertical" />
|
||||||
|
|
||||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
@ -83,4 +82,4 @@
|
|||||||
android:indeterminate="true"
|
android:indeterminate="true"
|
||||||
android:visibility="visible" />
|
android:visibility="visible" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
@ -160,7 +160,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/releaseTypeText"
|
android:text="@string/releaseTypeText"
|
||||||
android:checked="true"
|
android:checked="false"
|
||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
android:textColor="?attr/primaryTextColor"/>
|
android:textColor="?attr/primaryTextColor"/>
|
||||||
@ -170,7 +170,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/releaseDraftText"
|
android:text="@string/releaseDraftText"
|
||||||
android:checked="true"
|
android:checked="false"
|
||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
android:textColor="?attr/primaryTextColor"/>
|
android:textColor="?attr/primaryTextColor"/>
|
||||||
@ -194,4 +194,4 @@
|
|||||||
|
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -74,7 +74,7 @@
|
|||||||
android:background="@drawable/shape_inputs"
|
android:background="@drawable/shape_inputs"
|
||||||
android:textColor="?attr/inputTextColor"
|
android:textColor="?attr/inputTextColor"
|
||||||
android:textColorHint="?attr/hintColor"
|
android:textColorHint="?attr/hintColor"
|
||||||
android:textColorHighlight="?attr/primaryTextColor"/>
|
android:textColorHighlight="?attr/primaryTextColor" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -97,7 +97,7 @@
|
|||||||
android:background="@drawable/shape_inputs"
|
android:background="@drawable/shape_inputs"
|
||||||
android:textColor="?attr/inputTextColor"
|
android:textColor="?attr/inputTextColor"
|
||||||
android:textColorHint="?attr/hintColor"
|
android:textColorHint="?attr/hintColor"
|
||||||
android:textColorHighlight="?attr/primaryTextColor"/>
|
android:textColorHighlight="?attr/primaryTextColor" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -105,7 +105,7 @@
|
|||||||
android:text="@string/newTeamPermission"
|
android:text="@string/newTeamPermission"
|
||||||
android:textColor="?attr/primaryTextColor"
|
android:textColor="?attr/primaryTextColor"
|
||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
android:layout_marginTop="10dp"/>
|
android:layout_marginTop="10dp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/teamPermission"
|
android:id="@+id/teamPermission"
|
||||||
@ -116,10 +116,10 @@
|
|||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
tools:ignore="Autofill"
|
tools:ignore="Autofill"
|
||||||
android:background="@drawable/shape_inputs"
|
android:background="@drawable/shape_inputs"
|
||||||
android:textColor="@color/white"
|
android:textColor="?attr/inputTextColor"
|
||||||
android:textColorHint="@color/white"
|
android:textColorHint="?attr/hintColor"
|
||||||
android:inputType="none"
|
android:textColorHighlight="?attr/primaryTextColor"
|
||||||
android:textColorHighlight="@color/white"/>
|
android:inputType="none" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/teamPermissionDetail"
|
android:id="@+id/teamPermissionDetail"
|
||||||
@ -128,7 +128,7 @@
|
|||||||
android:textColor="?attr/primaryTextColor"
|
android:textColor="?attr/primaryTextColor"
|
||||||
android:textSize="12sp"
|
android:textSize="12sp"
|
||||||
android:gravity="start"
|
android:gravity="start"
|
||||||
android:visibility="gone"/>
|
android:visibility="gone" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -136,7 +136,7 @@
|
|||||||
android:text="@string/newTeamAccessControls"
|
android:text="@string/newTeamAccessControls"
|
||||||
android:textColor="?attr/primaryTextColor"
|
android:textColor="?attr/primaryTextColor"
|
||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
android:layout_marginTop="10dp"/>
|
android:layout_marginTop="10dp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/teamAccessControls"
|
android:id="@+id/teamAccessControls"
|
||||||
@ -147,16 +147,16 @@
|
|||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
tools:ignore="Autofill"
|
tools:ignore="Autofill"
|
||||||
android:background="@drawable/shape_inputs"
|
android:background="@drawable/shape_inputs"
|
||||||
android:textColor="?attr/primaryTextColor"
|
android:textColor="?attr/inputTextColor"
|
||||||
android:textColorHint="?attr/primaryTextColor"
|
android:textColorHint="?attr/hintColor"
|
||||||
android:inputType="none"
|
android:textColorHighlight="?attr/primaryTextColor"
|
||||||
android:textColorHighlight="?attr/primaryTextColor"/>
|
android:inputType="none" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/teamAccessControlsArray"
|
android:id="@+id/teamAccessControlsArray"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:visibility="gone"/>
|
android:visibility="gone" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/createTeamButton"
|
android:id="@+id/createTeamButton"
|
||||||
@ -171,10 +171,10 @@
|
|||||||
|
|
||||||
<View
|
<View
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="35dp"/>
|
android:layout_height="35dp" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:background="?attr/primaryBackgroundColor"
|
android:background="?attr/primaryBackgroundColor"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
@ -239,4 +239,4 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="?attr/primaryBackgroundColor"
|
android:background="?attr/primaryBackgroundColor"
|
||||||
android:padding="4dp"
|
|
||||||
android:scrollbars="vertical" />
|
android:scrollbars="vertical" />
|
||||||
|
|
||||||
<GridView
|
<GridView
|
||||||
@ -50,4 +49,4 @@
|
|||||||
android:indeterminate="true"
|
android:indeterminate="true"
|
||||||
android:visibility="visible" />
|
android:visibility="visible" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
@ -49,10 +49,6 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="?attr/primaryBackgroundColor"
|
android:background="?attr/primaryBackgroundColor"
|
||||||
android:layout_marginStart="5dp"
|
|
||||||
android:layout_marginEnd="5dp"
|
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
android:layout_marginBottom="0dp"
|
|
||||||
android:scrollbars="vertical" />
|
android:scrollbars="vertical" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -34,7 +34,6 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="?attr/primaryBackgroundColor"
|
android:background="?attr/primaryBackgroundColor"
|
||||||
android:padding="4dp"
|
|
||||||
android:scrollbars="vertical" />
|
android:scrollbars="vertical" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@ -59,4 +58,4 @@
|
|||||||
android:indeterminate="true"
|
android:indeterminate="true"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="?attr/primaryBackgroundColor"
|
android:background="?attr/primaryBackgroundColor"
|
||||||
android:padding="4dp"
|
|
||||||
android:scrollbars="vertical" />
|
android:scrollbars="vertical" />
|
||||||
|
|
||||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
@ -41,4 +40,4 @@
|
|||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="?attr/primaryBackgroundColor"
|
android:background="?attr/primaryBackgroundColor"
|
||||||
android:padding="4dp"
|
|
||||||
android:scrollbars="vertical" />
|
android:scrollbars="vertical" />
|
||||||
|
|
||||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
@ -41,4 +40,4 @@
|
|||||||
android:indeterminate="true"
|
android:indeterminate="true"
|
||||||
android:visibility="visible" />
|
android:visibility="visible" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="?attr/primaryBackgroundColor"
|
android:background="?attr/primaryBackgroundColor"
|
||||||
android:padding="4dp"
|
|
||||||
android:scrollbars="vertical" />
|
android:scrollbars="vertical" />
|
||||||
|
|
||||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
@ -54,4 +53,4 @@
|
|||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
android:contentDescription="@string/addNewContent" />
|
android:contentDescription="@string/addNewContent" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="?attr/primaryBackgroundColor"
|
android:background="?attr/primaryBackgroundColor"
|
||||||
android:padding="4dp"
|
|
||||||
android:scrollbars="vertical" />
|
android:scrollbars="vertical" />
|
||||||
|
|
||||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
@ -52,4 +51,4 @@
|
|||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
@ -11,90 +13,131 @@
|
|||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:padding="15dp"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:id="@+id/orgInfoLayout"
|
android:id="@+id/orgInfoLayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="15dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:visibility="visible">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/orgAvatar"
|
android:id="@+id/orgAvatar"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_gravity="center_horizontal"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="20dp"
|
||||||
android:contentDescription="@string/orgContentAvatar"
|
android:layout_marginBottom="30dp"
|
||||||
android:layout_marginBottom="20dp"/>
|
android:contentDescription="@string/orgContentAvatar" />
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:text="@string/nameText"
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:textColor="?attr/primaryTextColor"/>
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/orgNameInfo"
|
android:id="@+id/orgNameInfo"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:textIsSelectable="true"
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:paddingTop="5dp"
|
|
||||||
android:textColor="?attr/primaryTextColor"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:text="@string/descriptionText"
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:textColor="?attr/primaryTextColor"
|
android:textColor="?attr/primaryTextColor"
|
||||||
android:layout_marginTop="15dp"/>
|
android:layout_marginBottom="5dp"
|
||||||
|
android:textSize="22sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/orgDescInfo"
|
android:id="@+id/orgDescInfo"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:textIsSelectable="true"
|
android:autoLink="web"
|
||||||
android:textSize="16sp"
|
android:ellipsize="end"
|
||||||
android:paddingTop="5dp"
|
android:maxLines="3"
|
||||||
android:textColor="?attr/primaryTextColor"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:text="@string/websiteText"
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:textColor="?attr/primaryTextColor"
|
android:textColor="?attr/primaryTextColor"
|
||||||
android:layout_marginTop="15dp"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/orgWebsiteInfo"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:textIsSelectable="true"
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:paddingTop="5dp"
|
|
||||||
android:textColorLink="@color/lightBlue"
|
android:textColorLink="@color/lightBlue"
|
||||||
android:autoLink="web"
|
android:textSize="16sp" />
|
||||||
android:textColor="?attr/primaryTextColor"/>
|
|
||||||
|
|
||||||
<TextView
|
<View
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="1dp"
|
||||||
android:text="@string/locationText"
|
android:layout_marginTop="25dp"
|
||||||
android:textSize="16sp"
|
android:layout_marginBottom="25dp"
|
||||||
android:textColor="?attr/primaryTextColor"
|
android:background="?attr/dividerColor" />
|
||||||
android:layout_marginTop="15dp"/>
|
|
||||||
|
|
||||||
<TextView
|
<LinearLayout
|
||||||
android:id="@+id/orgLocationInfo"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:textIsSelectable="true"
|
android:layout_marginBottom="20dp"
|
||||||
android:textSize="16sp"
|
android:orientation="horizontal"
|
||||||
android:paddingTop="5dp"
|
android:paddingLeft="15dp"
|
||||||
android:autoLink="web"
|
android:paddingRight="15dp">
|
||||||
android:textColor="?attr/primaryTextColor"/>
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:contentDescription="@string/websiteText"
|
||||||
|
app:srcCompat="@drawable/ic_link_24dp" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="15dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/websiteText"
|
||||||
|
android:textColor="?attr/primaryTextColor"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/orgWebsiteInfo"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:alpha="0.9"
|
||||||
|
android:autoLink="web"
|
||||||
|
android:textColor="?attr/primaryTextColor"
|
||||||
|
android:textColorLink="@color/lightBlue"
|
||||||
|
android:textSize="14sp"
|
||||||
|
tools:text="29" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="20dp"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingLeft="15dp"
|
||||||
|
android:paddingRight="15dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:contentDescription="@string/locationText"
|
||||||
|
app:srcCompat="@drawable/ic_location" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="15dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/locationText"
|
||||||
|
android:textColor="?attr/primaryTextColor"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/orgLocationInfo"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:alpha="0.9"
|
||||||
|
android:textColor="?attr/primaryTextColor"
|
||||||
|
android:textSize="14sp"
|
||||||
|
tools:text="29" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
@ -105,14 +148,16 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<ProgressBar android:id="@+id/progress_bar"
|
<ProgressBar
|
||||||
|
android:id="@+id/progress_bar"
|
||||||
style="@style/Base.Widget.AppCompat.ProgressBar"
|
style="@style/Base.Widget.AppCompat.ProgressBar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
android:indeterminate="true"
|
android:indeterminate="true"
|
||||||
android:visibility="visible"
|
android:visibility="visible"
|
||||||
android:layout_centerInParent="true" />
|
tools:visibility="gone" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="?attr/primaryBackgroundColor"
|
android:background="?attr/primaryBackgroundColor"
|
||||||
android:padding="4dp"
|
|
||||||
android:scrollbars="vertical" />
|
android:scrollbars="vertical" />
|
||||||
|
|
||||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
|
@ -10,58 +10,89 @@
|
|||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/aboutFrame"
|
android:id="@+id/aboutFrame"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="172dp"
|
android:layout_height="200dp"
|
||||||
android:orientation="vertical"
|
android:gravity="top"
|
||||||
android:background="@drawable/nav_background"
|
android:orientation="vertical">
|
||||||
android:gravity="top">
|
|
||||||
|
|
||||||
<LinearLayout
|
<ImageView
|
||||||
android:id="@+id/layoutFrameAccount"
|
android:id="@+id/userAvatarBackground"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="186dp"
|
android:layout_height="match_parent"
|
||||||
android:padding="16dp"
|
android:contentDescription="@string/generalImgContentText"
|
||||||
android:orientation="vertical">
|
android:scaleType="centerCrop" />
|
||||||
|
|
||||||
<ImageView
|
<eightbitlab.com.blurview.BlurView
|
||||||
android:id="@+id/userAvatar"
|
android:id="@+id/blurView"
|
||||||
android:layout_width="54dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="54dp"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginBottom="8dp"
|
app:blurOverlayColor="@color/blurColor">
|
||||||
android:layout_gravity="center"
|
|
||||||
android:contentDescription="@string/generalImgContentText"
|
|
||||||
android:src="@mipmap/app_logo_round" />
|
|
||||||
|
|
||||||
<TextView
|
<LinearLayout
|
||||||
android:id="@+id/userFullName"
|
android:id="@+id/layoutFrameAccount"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:textIsSelectable="true"
|
android:gravity="center"
|
||||||
android:layout_marginBottom="8dp"
|
android:orientation="vertical"
|
||||||
android:textSize="16sp"
|
android:padding="16dp">
|
||||||
android:textColor="@color/white"
|
|
||||||
android:layout_gravity="center" />
|
|
||||||
|
|
||||||
<TextView
|
<ImageView
|
||||||
android:id="@+id/userLogin"
|
android:id="@+id/userAvatar"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="54dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="54dp"
|
||||||
android:textIsSelectable="true"
|
android:layout_marginBottom="8dp"
|
||||||
android:layout_marginBottom="8dp"
|
android:contentDescription="@string/generalImgContentText"
|
||||||
android:textSize="16sp"
|
android:src="@mipmap/app_logo_round" />
|
||||||
android:textColor="@color/white"
|
|
||||||
android:layout_gravity="center" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/userEmail"
|
android:id="@+id/userFullName"
|
||||||
android:textIsSelectable="true"
|
android:layout_width="wrap_content"
|
||||||
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:textColor="@color/white"
|
||||||
android:layout_marginBottom="0dp"
|
android:textIsSelectable="true"
|
||||||
android:textSize="16sp"
|
android:textSize="18sp" />
|
||||||
android:textColor="@color/white"
|
|
||||||
android:layout_gravity="center" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
<TextView
|
||||||
|
android:id="@+id/userLogin"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="10dp"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textIsSelectable="true"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="50dp"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_marginBottom="10dp"
|
||||||
|
android:background="@color/colorWhite" />
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="18dp"
|
||||||
|
android:layout_marginRight="2dp"
|
||||||
|
android:contentDescription="@string/generalImgContentText"
|
||||||
|
android:src="@drawable/ic_language"
|
||||||
|
app:tint="@color/colorWhite" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/userLanguage"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textIsSelectable="true"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</eightbitlab.com.blurview.BlurView>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
@ -108,4 +139,4 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -14,7 +14,6 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="?attr/primaryBackgroundColor"
|
android:background="?attr/primaryBackgroundColor"
|
||||||
android:padding="4dp"
|
|
||||||
android:scrollbars="vertical" />
|
android:scrollbars="vertical" />
|
||||||
|
|
||||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
@ -39,4 +38,4 @@
|
|||||||
android:indeterminate="true"
|
android:indeterminate="true"
|
||||||
android:visibility="visible" />
|
android:visibility="visible" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
@ -14,7 +14,6 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="?attr/primaryBackgroundColor"
|
android:background="?attr/primaryBackgroundColor"
|
||||||
android:padding="4dp"
|
|
||||||
android:scrollbars="vertical" />
|
android:scrollbars="vertical" />
|
||||||
|
|
||||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
@ -39,4 +38,4 @@
|
|||||||
android:indeterminate="true"
|
android:indeterminate="true"
|
||||||
android:visibility="visible" />
|
android:visibility="visible" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
@ -14,7 +14,6 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="?attr/primaryBackgroundColor"
|
android:background="?attr/primaryBackgroundColor"
|
||||||
android:padding="4dp"
|
|
||||||
android:scrollbars="vertical" />
|
android:scrollbars="vertical" />
|
||||||
|
|
||||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
@ -39,4 +38,4 @@
|
|||||||
android:indeterminate="true"
|
android:indeterminate="true"
|
||||||
android:visibility="visible" />
|
android:visibility="visible" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="?attr/primaryBackgroundColor"
|
android:background="?attr/primaryBackgroundColor"
|
||||||
android:padding="4dp"
|
|
||||||
android:scrollbars="vertical" />
|
android:scrollbars="vertical" />
|
||||||
|
|
||||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
@ -41,4 +40,4 @@
|
|||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="?attr/primaryBackgroundColor"
|
android:background="?attr/primaryBackgroundColor"
|
||||||
android:padding="4dp"
|
|
||||||
android:scrollbars="vertical" />
|
android:scrollbars="vertical" />
|
||||||
|
|
||||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
@ -41,4 +40,4 @@
|
|||||||
android:indeterminate="true"
|
android:indeterminate="true"
|
||||||
android:visibility="visible" />
|
android:visibility="visible" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
@ -62,9 +62,9 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textColor="?attr/primaryTextColor"
|
android:textColor="?attr/primaryTextColor"
|
||||||
|
android:layout_marginBottom="5dp"
|
||||||
android:textSize="22sp"
|
android:textSize="22sp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold" />
|
||||||
tools:text="GitNex" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/repoMetaDescription"
|
android:id="@+id/repoMetaDescription"
|
||||||
@ -75,12 +75,12 @@
|
|||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:maxLines="3"
|
android:maxLines="3"
|
||||||
android:textColor="?attr/primaryTextColor"
|
android:textColor="?attr/primaryTextColor"
|
||||||
android:textSize="16sp"
|
android:textColorLink="@color/lightBlue"
|
||||||
tools:text="Android client for Gitea https://gitnex.com" />
|
android:textSize="16sp" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="20dp"
|
android:layout_marginTop="20dp"
|
||||||
android:baselineAligned="false"
|
android:baselineAligned="false"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
@ -88,7 +88,7 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/repoMetaStarsFrame"
|
android:id="@+id/repoMetaStarsFrame"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
@ -110,7 +110,7 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/repoMetaPullRequestsFrame"
|
android:id="@+id/repoMetaPullRequestsFrame"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
@ -132,7 +132,7 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/repoMetaForksFrame"
|
android:id="@+id/repoMetaForksFrame"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
@ -154,7 +154,7 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/repoMetaWatchersFrame"
|
android:id="@+id/repoMetaWatchersFrame"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
@ -179,12 +179,11 @@
|
|||||||
android:layout_height="1dp"
|
android:layout_height="1dp"
|
||||||
android:layout_marginTop="25dp"
|
android:layout_marginTop="25dp"
|
||||||
android:layout_marginBottom="25dp"
|
android:layout_marginBottom="25dp"
|
||||||
android:alpha="0.2"
|
android:background="?attr/dividerColor" />
|
||||||
android:background="@color/lightGray" />
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="20dp"
|
android:layout_marginBottom="20dp"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:paddingLeft="15dp"
|
android:paddingLeft="15dp"
|
||||||
@ -224,7 +223,7 @@
|
|||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="20dp"
|
android:layout_marginBottom="20dp"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:paddingLeft="15dp"
|
android:paddingLeft="15dp"
|
||||||
@ -264,7 +263,7 @@
|
|||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="20dp"
|
android:layout_marginBottom="20dp"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:paddingLeft="15dp"
|
android:paddingLeft="15dp"
|
||||||
@ -387,4 +386,4 @@
|
|||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="?attr/primaryBackgroundColor"
|
android:background="?attr/primaryBackgroundColor"
|
||||||
android:padding="4dp"
|
|
||||||
android:scrollbars="vertical" />
|
android:scrollbars="vertical" />
|
||||||
|
|
||||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
@ -40,4 +39,4 @@
|
|||||||
android:indeterminate="true"
|
android:indeterminate="true"
|
||||||
android:visibility="visible" />
|
android:visibility="visible" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:paddingStart="60dp"
|
android:paddingStart="60dp"
|
||||||
android:paddingEnd="12dp"
|
android:paddingEnd="12dp"
|
||||||
android:text="@string/appreanceHintText"
|
android:text="@string/appearanceHintText"
|
||||||
android:textColor="?attr/primaryTextColor"
|
android:textColor="?attr/primaryTextColor"
|
||||||
android:textSize="12sp" />
|
android:textSize="12sp" />
|
||||||
|
|
||||||
@ -180,4 +180,4 @@
|
|||||||
|
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="?attr/primaryBackgroundColor"
|
android:background="?attr/primaryBackgroundColor"
|
||||||
android:padding="4dp"
|
|
||||||
android:scrollbars="vertical" />
|
android:scrollbars="vertical" />
|
||||||
|
|
||||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
@ -52,4 +51,4 @@
|
|||||||
android:padding="@dimen/fab_padding"
|
android:padding="@dimen/fab_padding"
|
||||||
android:contentDescription="@string/addNewContent" />
|
android:contentDescription="@string/addNewContent" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="?attr/primaryBackgroundColor"
|
android:background="?attr/primaryBackgroundColor"
|
||||||
android:padding="4dp"
|
|
||||||
android:scrollbars="vertical" />
|
android:scrollbars="vertical" />
|
||||||
|
|
||||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
@ -40,4 +39,4 @@
|
|||||||
android:indeterminate="true"
|
android:indeterminate="true"
|
||||||
android:visibility="visible" />
|
android:visibility="visible" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
116
app/src/main/res/layout/layout_repo_more_info.xml
Normal file
116
app/src/main/res/layout/layout_repo_more_info.xml
Normal file
@ -0,0 +1,116 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="25dp">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/defaultBranchHeader"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="?attr/primaryTextColor"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/defaultBranchContent"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="?attr/primaryTextColor" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginTop="15dp"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/lastUpdatedHeader"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="?attr/primaryTextColor"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/lastUpdatedContent"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="?attr/primaryTextColor" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginTop="15dp"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/sshUrlHeader"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="?attr/primaryTextColor"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/sshUrlContent"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="?attr/primaryTextColor" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginTop="15dp"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/cloneUrlHeader"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="?attr/primaryTextColor"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/cloneUrlContent"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:autoLink="web"
|
||||||
|
android:textColorLink="@color/lightBlue"
|
||||||
|
android:textColor="?attr/primaryTextColor" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginTop="15dp"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/repoUrlHeader"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="?attr/primaryTextColor"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/repoUrlContent"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:autoLink="web"
|
||||||
|
android:textColorLink="@color/lightBlue"
|
||||||
|
android:textColor="?attr/primaryTextColor" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
@ -3,10 +3,7 @@
|
|||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingBottom="10dp"
|
android:padding="15dp"
|
||||||
android:paddingTop="10dp"
|
|
||||||
android:paddingStart="15dp"
|
|
||||||
android:paddingEnd="15dp"
|
|
||||||
android:background="?attr/primaryBackgroundColor" >
|
android:background="?attr/primaryBackgroundColor" >
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:id="@+id/commitList"
|
android:id="@+id/commitList"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
tools:context=".activities.CommitsActivity"
|
|
||||||
android:background="?attr/primaryBackgroundColor">
|
android:background="?attr/primaryBackgroundColor">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@ -12,10 +11,8 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentTop="true"
|
android:layout_alignParentTop="true"
|
||||||
android:fitsSystemWindows="true"
|
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_margin="15dp"
|
android:layout_margin="15dp">
|
||||||
tools:ignore="UselessParent">
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/commitTitleVw"
|
android:id="@+id/commitTitleVw"
|
||||||
@ -80,7 +77,6 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="1dp"
|
android:layout_height="1dp"
|
||||||
android:id="@+id/divider"
|
android:id="@+id/divider"
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:background="?attr/dividerColor" />
|
android:background="?attr/dividerColor" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
android:id="@+id/linearLayoutFilesFrame"
|
android:id="@+id/linearLayoutFilesFrame"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="10dp"
|
android:layout_margin="12dp"
|
||||||
android:background="?attr/primaryBackgroundColor">
|
android:background="?attr/primaryBackgroundColor">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@ -62,4 +62,4 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
@ -1,15 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:id="@+id/relativeLayoutFrameIssuesList"
|
android:id="@+id/relativeLayoutFrameIssuesList"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="15dp"
|
android:background="?attr/primaryBackgroundColor">
|
||||||
android:layout_marginStart="15dp"
|
|
||||||
android:layout_marginEnd="15dp"
|
|
||||||
android:background="?attr/primaryBackgroundColor"
|
|
||||||
tools:context=".activities.RepoDetailActivity">
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/issueNumber"
|
android:id="@+id/issueNumber"
|
||||||
@ -17,86 +12,95 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:visibility="invisible" />
|
android:visibility="invisible" />
|
||||||
|
|
||||||
<ImageView
|
<RelativeLayout
|
||||||
android:id="@+id/assigneeAvatar"
|
android:id="@+id/mainFrame"
|
||||||
android:layout_width="48dp"
|
|
||||||
android:layout_height="48dp"
|
|
||||||
android:layout_marginEnd="15dp"
|
|
||||||
android:contentDescription="@string/generalImgContentText"
|
|
||||||
android:src="@drawable/ic_android" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/infoSection"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_toEndOf="@+id/assigneeAvatar"
|
android:layout_alignParentTop="true"
|
||||||
|
android:layout_margin="15dp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<LinearLayout
|
<ImageView
|
||||||
android:id="@+id/frameIssueNameStatus"
|
android:id="@+id/assigneeAvatar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="48dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="48dp"
|
||||||
android:layout_marginBottom="10dp"
|
android:layout_marginEnd="15dp"
|
||||||
android:orientation="horizontal">
|
android:contentDescription="@string/generalImgContentText"
|
||||||
|
android:src="@drawable/ic_android" />
|
||||||
<TextView
|
|
||||||
android:id="@+id/issueTitle"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="top|center_vertical"
|
|
||||||
android:textAlignment="gravity"
|
|
||||||
android:text="@string/strFilter"
|
|
||||||
android:textColor="?attr/primaryTextColor"
|
|
||||||
android:textSize="18sp" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/frameCreatedDate"
|
android:id="@+id/infoSection"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_toEndOf="@+id/assigneeAvatar"
|
||||||
android:orientation="horizontal">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/frameCommentsCount"
|
android:id="@+id/frameIssueNameStatus"
|
||||||
android:layout_width="0dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_weight=".25"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="10dp"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/issueCommentsCount"
|
android:id="@+id/issueTitle"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="start"
|
android:gravity="top|center_vertical"
|
||||||
android:drawablePadding="5dp"
|
android:textAlignment="gravity"
|
||||||
android:drawableStart="@drawable/ic_comment_20"
|
android:text="@string/strFilter"
|
||||||
android:layout_gravity="center_horizontal"
|
android:textColor="?attr/primaryTextColor"
|
||||||
|
android:textSize="18sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/frameCreatedDate"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/frameCommentsCount"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_weight=".25"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/issueCommentsCount"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="start"
|
||||||
|
android:drawablePadding="5dp"
|
||||||
|
android:drawableStart="@drawable/ic_comment_20"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:textColor="?attr/primaryTextColor"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/issueCreatedTime"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_weight=".25"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="end"
|
||||||
android:textColor="?attr/primaryTextColor"
|
android:textColor="?attr/primaryTextColor"
|
||||||
android:textSize="14sp" />
|
android:textSize="14sp" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/issueCreatedTime"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_weight=".25"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="end"
|
|
||||||
android:textColor="?attr/primaryTextColor"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:layout_below="@id/infoSection"
|
android:layout_below="@id/mainFrame"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="1dp"
|
android:layout_height="1dp"
|
||||||
android:id="@+id/divider"
|
android:id="@+id/divider"
|
||||||
android:layout_marginTop="15dp"
|
|
||||||
android:background="?attr/dividerColor" />
|
android:background="?attr/dividerColor" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
@ -1,11 +1,30 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:id="@+id/relativeLayoutMainFrame"
|
android:id="@+id/relativeLayoutMainFrame"
|
||||||
android:background="?attr/primaryBackgroundColor">
|
android:background="?attr/primaryBackgroundColor">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:id="@+id/labelTitle"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:id="@+id/labelId"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:id="@+id/labelColor"/>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
@ -18,6 +37,7 @@
|
|||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="start"
|
android:layout_gravity="start"
|
||||||
|
android:paddingTop="5dp"
|
||||||
android:contentDescription="@string/labelMenuContentDesc"
|
android:contentDescription="@string/labelMenuContentDesc"
|
||||||
android:gravity="start"
|
android:gravity="start"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
@ -35,24 +55,6 @@
|
|||||||
android:scaleType="fitEnd"
|
android:scaleType="fitEnd"
|
||||||
android:src="@drawable/ic_dotted_menu_horizontal" />
|
android:src="@drawable/ic_dotted_menu_horizontal" />
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:id="@+id/labelTitle"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:id="@+id/labelId"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:id="@+id/labelColor"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
android:gravity="top|center_horizontal"
|
android:gravity="top|center_horizontal"
|
||||||
android:layout_marginTop="1dp"
|
android:layout_marginTop="1dp"
|
||||||
android:text="@string/orgMember"
|
android:text="@string/orgMember"
|
||||||
|
android:textColor="?attr/primaryTextColor"
|
||||||
android:textSize="14sp" />
|
android:textSize="14sp" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout
|
<RelativeLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
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_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="15dp"
|
|
||||||
android:id="@+id/milestoneFrame"
|
android:id="@+id/milestoneFrame"
|
||||||
android:background="?attr/primaryBackgroundColor"
|
android:background="?attr/primaryBackgroundColor"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
@ -15,125 +16,173 @@
|
|||||||
android:id="@+id/milestoneId" />
|
android:id="@+id/milestoneId" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/milestoneStatus"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
android:id="@+id/milestoneStatus" />
|
tools:visibility="visible" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/frameTitle"
|
android:id="@+id/mainFrame"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal">
|
android:layout_alignParentTop="true"
|
||||||
|
android:layout_margin="15dp"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
<TextView
|
<LinearLayout
|
||||||
android:id="@+id/milestoneTitle"
|
android:id="@+id/frameTitle"
|
||||||
android:layout_width="0dp"
|
android:layout_width="match_parent"
|
||||||
android:textIsSelectable="true"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight=".80"
|
android:gravity="center_vertical"
|
||||||
android:layout_marginBottom="5dp"
|
android:orientation="horizontal">
|
||||||
android:textColor="?attr/primaryTextColor"
|
|
||||||
android:textSize="18sp" />
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/milestoneState"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight=".15"
|
|
||||||
android:layout_gravity="end"
|
|
||||||
android:gravity="end"
|
|
||||||
android:scaleType="fitEnd"
|
|
||||||
android:contentDescription="@string/pageTitleCreateMilestone"
|
|
||||||
android:layout_marginBottom="5dp" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/milestoneDescription"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/repoDescription"
|
|
||||||
android:textIsSelectable="true"
|
|
||||||
android:textColor="?attr/primaryTextColor"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:layout_marginBottom="5dp"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/milestoneIssuesClosed"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="8"
|
|
||||||
android:text="@string/repoWatchers"
|
|
||||||
android:gravity="start"
|
|
||||||
android:textColor="?attr/primaryTextColor"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
|
|
||||||
<ProgressBar
|
|
||||||
android:id="@+id/milestoneProgress"
|
|
||||||
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="80"
|
|
||||||
android:progress="50"
|
|
||||||
android:layout_marginTop="2dp"
|
|
||||||
android:progressDrawable="@drawable/progress_bar"
|
|
||||||
android:progressTint="@color/colorLightGreen" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/milestoneIssuesOpen"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="8"
|
|
||||||
android:text="@string/repoStars"
|
|
||||||
android:gravity="end"
|
|
||||||
android:textColor="?attr/primaryTextColor"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:id="@+id/milestoneDateMenuFrame"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_weight=".90"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:id="@+id/dueDateFrame"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_marginTop="3dp">
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/milestoneDueDate"
|
android:id="@+id/milestoneTitle"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/dueDate"
|
android:layout_weight="0"
|
||||||
android:gravity="start"
|
|
||||||
android:textColor="?attr/primaryTextColor"
|
android:textColor="?attr/primaryTextColor"
|
||||||
android:textSize="12sp" />
|
android:textIsSelectable="true"
|
||||||
|
android:textSize="18sp" />
|
||||||
|
|
||||||
</RelativeLayout>
|
<ProgressBar
|
||||||
|
android:id="@+id/milestoneProgress"
|
||||||
|
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="10dp"
|
||||||
|
android:layout_marginLeft="15dp"
|
||||||
|
android:layout_marginRight="10dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:indeterminate="false"
|
||||||
|
android:progress="50"
|
||||||
|
android:progressDrawable="@drawable/progress_bar"
|
||||||
|
android:progressTint="@color/btnBackground" />
|
||||||
|
|
||||||
<ImageView
|
</LinearLayout>
|
||||||
android:id="@+id/milestonesMenu"
|
|
||||||
android:layout_width="0dp"
|
<LinearLayout
|
||||||
android:layout_weight=".10"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="end"
|
android:layout_marginTop="10dp"
|
||||||
android:scaleType="fitEnd"
|
android:orientation="horizontal">
|
||||||
android:src="@drawable/ic_dotted_menu_horizontal"
|
|
||||||
android:contentDescription="@string/menuContentDesc" />
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginRight="15dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="15dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginRight="5dp"
|
||||||
|
android:contentDescription="@string/generalImgContentText"
|
||||||
|
app:srcCompat="@drawable/ic_calendar" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/milestoneDueDate"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/dueDate"
|
||||||
|
android:textColor="?attr/primaryTextColor"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginRight="15dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="15dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginRight="5dp"
|
||||||
|
android:contentDescription="@string/generalImgContentText"
|
||||||
|
app:srcCompat="@drawable/ic_issue_open" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/milestoneIssuesOpen"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/repoStars"
|
||||||
|
android:textColor="?attr/primaryTextColor"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="15dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginRight="5dp"
|
||||||
|
android:contentDescription="@string/generalImgContentText"
|
||||||
|
app:srcCompat="@drawable/ic_issue_closed" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/milestoneIssuesClosed"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/repoWatchers"
|
||||||
|
android:textColor="?attr/primaryTextColor"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/milestoneDateMenuFrame"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/dueDateFrame"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="3dp"
|
||||||
|
android:layout_weight=".90"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/milestoneDescription"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/repoDescription"
|
||||||
|
android:textColor="?attr/primaryTextColor"
|
||||||
|
android:textIsSelectable="true"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:visibility="visible" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/milestonesMenu"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="end|bottom"
|
||||||
|
android:layout_weight=".10"
|
||||||
|
android:contentDescription="@string/menuContentDesc"
|
||||||
|
android:scaleType="fitEnd"
|
||||||
|
android:src="@drawable/ic_dotted_menu_horizontal" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
<View
|
||||||
|
android:layout_below="@id/mainFrame"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:id="@+id/divider"
|
||||||
|
android:background="?attr/dividerColor" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
@ -1,19 +1,17 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="?attr/primaryBackgroundColor" >
|
android:background="?attr/primaryBackgroundColor">
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/linearLayoutFrame"
|
android:id="@+id/linearLayoutFrame"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentTop="true"
|
android:layout_alignParentTop="true"
|
||||||
android:fitsSystemWindows="true"
|
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:padding="10dp"
|
android:padding="15dp">
|
||||||
tools:context=".activities.MainActivity">
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/organizationId"
|
android:id="@+id/organizationId"
|
||||||
@ -26,7 +24,6 @@
|
|||||||
android:layout_width="40dp"
|
android:layout_width="40dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="40dp"
|
||||||
android:layout_marginEnd="15dp"
|
android:layout_marginEnd="15dp"
|
||||||
android:layout_marginBottom="5dp"
|
|
||||||
android:src="@drawable/ic_android"
|
android:src="@drawable/ic_android"
|
||||||
android:contentDescription="@string/orgContentAvatar"/>
|
android:contentDescription="@string/orgContentAvatar"/>
|
||||||
|
|
||||||
@ -50,7 +47,6 @@
|
|||||||
android:id="@+id/orgDescription"
|
android:id="@+id/orgDescription"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="10dp"
|
|
||||||
android:text="@string/orgDescription"
|
android:text="@string/orgDescription"
|
||||||
android:textColor="?attr/primaryTextColor"
|
android:textColor="?attr/primaryTextColor"
|
||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
|
@ -1,12 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:id="@+id/relativeLayoutFrame"
|
android:id="@+id/relativeLayoutFrame"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="15dp"
|
android:background="?attr/primaryBackgroundColor">
|
||||||
tools:context=".activities.RepoDetailActivity">
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/prNumber"
|
android:id="@+id/prNumber"
|
||||||
@ -38,77 +36,87 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:visibility="invisible"/>
|
android:visibility="invisible"/>
|
||||||
|
|
||||||
<ImageView
|
<RelativeLayout
|
||||||
android:id="@+id/assigneeAvatar"
|
android:id="@+id/mainFrame"
|
||||||
android:layout_width="48dp"
|
|
||||||
android:layout_height="48dp"
|
|
||||||
android:layout_marginEnd="15dp"
|
|
||||||
android:contentDescription="@string/generalImgContentText"
|
|
||||||
android:src="@drawable/ic_android" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/infoSection"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_toEndOf="@+id/assigneeAvatar"
|
android:layout_alignParentTop="true"
|
||||||
|
android:layout_margin="15dp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<LinearLayout
|
<ImageView
|
||||||
android:id="@+id/framePrNameStatus"
|
android:id="@+id/assigneeAvatar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="48dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="48dp"
|
||||||
android:layout_marginBottom="10dp"
|
android:layout_marginEnd="15dp"
|
||||||
android:orientation="horizontal">
|
android:contentDescription="@string/generalImgContentText"
|
||||||
|
android:src="@drawable/ic_android" />
|
||||||
<TextView
|
|
||||||
android:id="@+id/prTitle"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="top|center_vertical"
|
|
||||||
android:textAlignment="gravity"
|
|
||||||
android:textColor="?attr/primaryTextColor"
|
|
||||||
android:textSize="18sp" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/frameCreatedDate"
|
android:id="@+id/infoSection"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_toEndOf="@+id/assigneeAvatar"
|
||||||
android:orientation="horizontal">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/frameCommentsCount"
|
android:id="@+id/framePrNameStatus"
|
||||||
android:layout_width="0dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_weight=".25"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="10dp"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/prCommentsCount"
|
android:id="@+id/prTitle"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="start"
|
android:gravity="top|center_vertical"
|
||||||
android:drawablePadding="5dp"
|
android:textAlignment="gravity"
|
||||||
android:drawableStart="@drawable/ic_comment_20"
|
android:textColor="?attr/primaryTextColor"
|
||||||
android:layout_gravity="center_horizontal"
|
android:textSize="18sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/frameCreatedDate"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/frameCommentsCount"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_weight=".25"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/prCommentsCount"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="start"
|
||||||
|
android:drawablePadding="5dp"
|
||||||
|
android:drawableStart="@drawable/ic_comment_20"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:textColor="?attr/primaryTextColor"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/prCreatedTime"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_weight=".25"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="end"
|
||||||
android:textColor="?attr/primaryTextColor"
|
android:textColor="?attr/primaryTextColor"
|
||||||
android:textSize="14sp" />
|
android:textSize="14sp" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/prCreatedTime"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_weight=".25"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="end"
|
|
||||||
android:textColor="?attr/primaryTextColor"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
@ -3,10 +3,7 @@
|
|||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingBottom="15dp"
|
android:padding="15dp"
|
||||||
android:paddingTop="15dp"
|
|
||||||
android:paddingStart="20dp"
|
|
||||||
android:paddingEnd="20dp"
|
|
||||||
android:background="?attr/primaryBackgroundColor" >
|
android:background="?attr/primaryBackgroundColor" >
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingBottom="10dp"
|
android:padding="15dp"
|
||||||
android:paddingTop="10dp"
|
|
||||||
android:paddingStart="20dp"
|
|
||||||
android:paddingEnd="20dp"
|
|
||||||
android:background="?attr/primaryBackgroundColor" >
|
android:background="?attr/primaryBackgroundColor" >
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@ -27,7 +25,6 @@
|
|||||||
android:id="@+id/userFullName"
|
android:id="@+id/userFullName"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="5dp"
|
|
||||||
android:text="@string/userName"
|
android:text="@string/userName"
|
||||||
android:textColor="?attr/primaryTextColor"
|
android:textColor="?attr/primaryTextColor"
|
||||||
android:textSize="16sp" />
|
android:textSize="16sp" />
|
||||||
@ -36,10 +33,9 @@
|
|||||||
android:id="@+id/userName"
|
android:id="@+id/userName"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="5dp"
|
|
||||||
android:text="@string/userName"
|
android:text="@string/userName"
|
||||||
android:textColor="?attr/primaryTextColor"
|
android:textColor="?attr/primaryTextColor"
|
||||||
android:textSize="16sp" />
|
android:textSize="14sp" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingBottom="10dp"
|
android:padding="15dp"
|
||||||
android:paddingTop="10dp"
|
|
||||||
android:paddingStart="20dp"
|
|
||||||
android:paddingEnd="20dp"
|
|
||||||
android:background="?attr/primaryBackgroundColor" >
|
android:background="?attr/primaryBackgroundColor" >
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@ -27,7 +25,6 @@
|
|||||||
android:id="@+id/userFullName"
|
android:id="@+id/userFullName"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="5dp"
|
|
||||||
android:text="@string/userName"
|
android:text="@string/userName"
|
||||||
android:textColor="?attr/primaryTextColor"
|
android:textColor="?attr/primaryTextColor"
|
||||||
android:textSize="16sp" />
|
android:textSize="16sp" />
|
||||||
@ -36,10 +33,9 @@
|
|||||||
android:id="@+id/userName"
|
android:id="@+id/userName"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="5dp"
|
|
||||||
android:text="@string/userName"
|
android:text="@string/userName"
|
||||||
android:textColor="?attr/primaryTextColor"
|
android:textColor="?attr/primaryTextColor"
|
||||||
android:textSize="16sp" />
|
android:textSize="14sp" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@ -1,100 +1,259 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout 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_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="?attr/primaryBackgroundColor" >
|
android:orientation="vertical"
|
||||||
|
android:padding="15dp">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/linearLayoutFrame"
|
android:id="@+id/headerFrame"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:layout_alignParentTop="true"
|
android:orientation="vertical">
|
||||||
android:fitsSystemWindows="true"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_margin="15dp" >
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="10dp"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/releaseTitle"
|
android:id="@+id/releaseName"
|
||||||
android:layout_width="0dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_weight=".70"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/releaseTitle"
|
android:layout_weight="1"
|
||||||
android:textIsSelectable="true"
|
android:singleLine="true"
|
||||||
android:textColor="?attr/primaryTextColor"
|
android:textColor="?attr/primaryTextColor"
|
||||||
android:textSize="18sp" />
|
android:textSize="18sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="3.0.0-rc1" />
|
||||||
|
|
||||||
<ImageView
|
<TextView
|
||||||
android:id="@+id/releaseType"
|
android:id="@+id/releaseType"
|
||||||
android:layout_width="0dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_weight=".30"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="end"
|
android:layout_weight="0"
|
||||||
android:scaleType="fitEnd"
|
android:background="@drawable/shape_stable_release"
|
||||||
android:contentDescription="@string/releaseType"
|
android:paddingLeft="5dp"
|
||||||
android:src="@drawable/ic_android" />
|
android:paddingRight="5dp"
|
||||||
|
android:textColor="@color/colorWhite"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
<LinearLayout
|
||||||
android:id="@+id/releaseTag"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginTop="10dp"
|
android:orientation="horizontal">
|
||||||
android:text="@string/releaseTag"
|
|
||||||
android:textIsSelectable="true"
|
|
||||||
android:textColor="?attr/primaryTextColor"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
|
|
||||||
<TextView
|
<LinearLayout
|
||||||
android:id="@+id/releaseDescription"
|
android:layout_width="wrap_content"
|
||||||
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:gravity="center_vertical"
|
||||||
android:layout_marginTop="10dp"
|
android:orientation="horizontal"
|
||||||
android:text="@string/releaseDescription"
|
tools:ignore="UseCompoundDrawables">
|
||||||
android:textIsSelectable="true"
|
|
||||||
android:textColor="?attr/primaryTextColor"
|
|
||||||
android:textSize="16sp" />
|
|
||||||
|
|
||||||
<TextView
|
<ImageView
|
||||||
android:id="@+id/releaseDownload"
|
android:id="@+id/authorAvatar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="24dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="24dp"
|
||||||
android:text="@string/releaseDownloadText"
|
tools:srcCompat="@tools:sample/avatars[7]"
|
||||||
android:textIsSelectable="true"
|
android:contentDescription="@string/generalImgContentText" />
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:textColor="?attr/primaryTextColor"
|
|
||||||
android:textSize="18sp" />
|
|
||||||
|
|
||||||
<View
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:id="@+id/authorName"
|
||||||
android:layout_height="1dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_marginTop="5dp"
|
android:layout_height="wrap_content"
|
||||||
android:background="?attr/inputBackgroundColor" />
|
android:layout_marginStart="5dp"
|
||||||
|
android:textColor="?attr/primaryTextColor"
|
||||||
|
android:textSize="14sp"
|
||||||
|
tools:text="Published by @mmarif" />
|
||||||
|
|
||||||
<TextView
|
</LinearLayout>
|
||||||
android:id="@+id/releaseZipDownload"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
android:text="@string/releaseZip"
|
|
||||||
android:textColor="?attr/primaryTextColor"
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:textColorLink="@color/lightBlue"/>
|
|
||||||
|
|
||||||
<TextView
|
<LinearLayout
|
||||||
android:id="@+id/releaseTarDownload"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:gravity="end"
|
||||||
android:text="@string/releaseTar"
|
android:orientation="vertical">
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
android:textColor="?attr/primaryTextColor"
|
<LinearLayout
|
||||||
android:textSize="16sp"
|
android:layout_width="match_parent"
|
||||||
android:textColorLink="@color/lightBlue"/>
|
android:layout_height="match_parent"
|
||||||
|
android:gravity="end|center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
tools:ignore="UseCompoundDrawables">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="18dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:srcCompat="@drawable/ic_label"
|
||||||
|
android:contentDescription="@string/generalImgContentText" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/releaseTag"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="5dp"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textColor="?attr/primaryTextColor"
|
||||||
|
android:textSize="14sp"
|
||||||
|
tools:text="3.0.0-rc1" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="end|center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
tools:ignore="UseCompoundDrawables"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="18dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:srcCompat="@drawable/ic_code"
|
||||||
|
android:contentDescription="@string/generalImgContentText" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/releaseCommitSha"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="5dp"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textColor="?attr/primaryTextColor"
|
||||||
|
android:textSize="14sp"
|
||||||
|
tools:text="8b1c79c0c3" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="end|center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
tools:ignore="UseCompoundDrawables">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="18dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:srcCompat="@drawable/ic_calendar"
|
||||||
|
android:contentDescription="@string/generalImgContentText" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/releaseDate"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="5dp"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textColor="?attr/primaryTextColor"
|
||||||
|
android:textSize="14sp"
|
||||||
|
tools:text="1 day ago" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</RelativeLayout>
|
<LinearLayout
|
||||||
|
android:id="@+id/bodyFrame"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/releaseBodyContent"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="?attr/primaryTextColor"
|
||||||
|
android:textSize="14sp"
|
||||||
|
tools:text="Put your release body here" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/downloadFrame"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
tools:ignore="UseCompoundDrawables">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/downloadDropdownIcon"
|
||||||
|
android:layout_width="15dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:contentDescription="@string/generalImgContentText"
|
||||||
|
android:tint="?attr/primaryTextColor"
|
||||||
|
android:src="@drawable/ic_arrow_right"
|
||||||
|
app:srcCompat="@drawable/ic_arrow_right" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="3dp"
|
||||||
|
android:textColor="?attr/primaryTextColor"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:text="@string/releaseDownloadText"
|
||||||
|
tools:text="Downloads" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/downloads"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:paddingTop="8dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/releaseZipDownload"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:drawableStart="@drawable/ic_file_download_24dp"
|
||||||
|
android:drawablePadding="8dp"
|
||||||
|
android:textColor="?attr/primaryTextColor"
|
||||||
|
android:textSize="14sp"
|
||||||
|
tools:text="Source code (ZIP)" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/releaseTarDownload"
|
||||||
|
android:layout_below="@+id/releaseZipDownload"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:drawableStart="@drawable/ic_file_download_24dp"
|
||||||
|
android:drawablePadding="8dp"
|
||||||
|
android:textColor="?attr/primaryTextColor"
|
||||||
|
android:textSize="14sp"
|
||||||
|
tools:text="Source code (TAR)" />
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/downloadList"
|
||||||
|
android:layout_below="@+id/releaseTarDownload"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="?attr/primaryBackgroundColor"
|
||||||
|
android:scrollbars="vertical" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
27
app/src/main/res/layout/list_releases_downloads.xml
Normal file
27
app/src/main/res/layout/list_releases_downloads.xml
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout 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="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
tools:ignore="UseCompoundDrawables">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:srcCompat="@drawable/ic_file_download_24dp"
|
||||||
|
android:contentDescription="@string/generalImgContentText" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/downloadName"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:textColor="?attr/primaryTextColor"
|
||||||
|
android:textSize="14sp"
|
||||||
|
tools:text="Source code (ZIP)" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
@ -20,6 +20,7 @@
|
|||||||
android:gravity="top|center_horizontal"
|
android:gravity="top|center_horizontal"
|
||||||
android:layout_marginTop="1dp"
|
android:layout_marginTop="1dp"
|
||||||
android:text="@string/starMember"
|
android:text="@string/starMember"
|
||||||
|
android:textColor="?attr/primaryTextColor"
|
||||||
android:textSize="14sp" />
|
android:textSize="14sp" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
android:gravity="top|center_horizontal"
|
android:gravity="top|center_horizontal"
|
||||||
android:layout_marginTop="1dp"
|
android:layout_marginTop="1dp"
|
||||||
android:text="@string/watcherMember"
|
android:text="@string/watcherMember"
|
||||||
|
android:textColor="?attr/primaryTextColor"
|
||||||
android:textSize="14sp" />
|
android:textSize="14sp" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout 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_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="?attr/primaryBackgroundColor" >
|
android:background="?attr/primaryBackgroundColor">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/repoType"
|
android:id="@+id/repoType"
|
||||||
@ -14,7 +16,6 @@
|
|||||||
android:id="@+id/linearLayoutFrame"
|
android:id="@+id/linearLayoutFrame"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentTop="true"
|
|
||||||
android:layout_margin="15dp"
|
android:layout_margin="15dp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
@ -37,23 +38,54 @@
|
|||||||
android:id="@+id/frameRepoName"
|
android:id="@+id/frameRepoName"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="5dp"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/repoName"
|
android:id="@+id/repoName"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="5dp"
|
|
||||||
android:layout_weight=".95"
|
android:layout_weight=".95"
|
||||||
android:text="@string/repoName"
|
android:text="@string/repoName"
|
||||||
android:textColor="?attr/primaryTextColor"
|
android:textColor="?attr/primaryTextColor"
|
||||||
android:textSize="18sp" />
|
android:textSize="18sp" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/archiveRepoFrame"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_marginEnd="6dp"
|
||||||
|
android:background="@drawable/shape_archived"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingLeft="5dp"
|
||||||
|
android:paddingRight="5dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:visibility="visible">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="0"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:text="@string/archivedRepository"
|
||||||
|
android:textColor="@color/colorWhite" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="18dp"
|
||||||
|
android:layout_height="18dp"
|
||||||
|
android:layout_marginStart="3dp"
|
||||||
|
android:layout_weight="0"
|
||||||
|
android:contentDescription="@string/generalImgContentText"
|
||||||
|
app:srcCompat="@drawable/ic_archive"
|
||||||
|
app:tint="@color/colorWhite" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/imageRepoType"
|
android:id="@+id/imageRepoType"
|
||||||
android:layout_width="10dp"
|
android:layout_width="10dp"
|
||||||
android:layout_height="20dp"
|
android:layout_height="20dp"
|
||||||
android:layout_gravity="end"
|
|
||||||
android:layout_weight=".05"
|
android:layout_weight=".05"
|
||||||
android:contentDescription="@string/privateAvatar"
|
android:contentDescription="@string/privateAvatar"
|
||||||
android:src="@drawable/ic_lock_24dp" />
|
android:src="@drawable/ic_lock_24dp" />
|
||||||
|
@ -1,62 +1,83 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:orientation="vertical"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:id="@+id/navHeaderFrame"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="200dp"
|
android:layout_height="200dp">
|
||||||
android:background="@drawable/nav_background"
|
|
||||||
android:gravity="bottom"
|
|
||||||
android:paddingTop="16dp">
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/userAvatar"
|
android:id="@+id/userAvatarBackground"
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:src="@drawable/ic_android"
|
|
||||||
android:maxHeight="24dp"
|
|
||||||
android:maxWidth="24dp"
|
|
||||||
android:paddingStart="20dp"
|
|
||||||
android:paddingEnd="5dp"
|
|
||||||
android:contentDescription="@string/app_name"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/userFullname"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:paddingTop="10dp"
|
|
||||||
android:text="@string/app_name"
|
|
||||||
android:textSize="18sp"
|
|
||||||
android:textIsSelectable="true"
|
|
||||||
android:textColor="@color/white"
|
|
||||||
android:paddingStart="20dp"
|
|
||||||
android:paddingEnd="5dp" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginTop="5dp">
|
android:contentDescription="@string/generalImgContentText"
|
||||||
|
android:scaleType="centerCrop" />
|
||||||
|
|
||||||
<TextView
|
<eightbitlab.com.blurview.BlurView
|
||||||
android:id="@+id/userEmail"
|
android:id="@+id/blurView"
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_weight="0.85"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/appEmail"
|
|
||||||
android:textSize="14sp"
|
|
||||||
android:textIsSelectable="true"
|
|
||||||
android:textColor="@color/white"
|
|
||||||
android:gravity="start"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:paddingStart="20dp"
|
|
||||||
android:paddingEnd="5dp" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="1dp"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginTop="16dp"
|
app:blurOverlayColor="@color/blurColor">
|
||||||
android:background="?attr/dividerColor" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
<LinearLayout
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:gravity="bottom"
|
||||||
|
android:paddingTop="16dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/userAvatar"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:src="@drawable/ic_android"
|
||||||
|
android:maxHeight="24dp"
|
||||||
|
android:maxWidth="24dp"
|
||||||
|
android:paddingStart="20dp"
|
||||||
|
android:paddingEnd="5dp"
|
||||||
|
android:contentDescription="@string/app_name"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/userFullname"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingTop="10dp"
|
||||||
|
android:text="@string/app_name"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textIsSelectable="true"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:paddingStart="20dp"
|
||||||
|
android:paddingEnd="5dp" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="5dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/userEmail"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_weight="0.85"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/appEmail"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textIsSelectable="true"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:gravity="start"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:paddingStart="20dp"
|
||||||
|
android:paddingEnd="5dp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:background="?attr/dividerColor" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</eightbitlab.com.blurview.BlurView>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
@ -11,14 +11,15 @@
|
|||||||
<color name="black">#000009</color>
|
<color name="black">#000009</color>
|
||||||
<color name="white">#ffffff</color>
|
<color name="white">#ffffff</color>
|
||||||
<color name="tooltipBackground">#1e88ce</color>
|
<color name="tooltipBackground">#1e88ce</color>
|
||||||
|
<color name="blurColor">#41818181</color>
|
||||||
<color name="btnBackground">#009486</color>
|
<color name="btnBackground">#009486</color>
|
||||||
<color name="btnTextColor">#ffffff</color>
|
<color name="btnTextColor">#ffffff</color>
|
||||||
<color name="inputBackground">#1d1d1d</color>
|
<color name="inputBackground">#1d1d1d</color>
|
||||||
<color name="toastBackground">#1d1d1d</color>
|
<color name="toastBackground">#1d1d1d</color>
|
||||||
<color name="divider">#1d1d1d</color>
|
<color name="divider">#1d1d1d</color>
|
||||||
<color name="releasePre">#eb7121</color>
|
<color name="releasePre">#f2711c</color>
|
||||||
<color name="releaseStable">#219214</color>
|
<color name="releaseStable">@color/btnBackground</color>
|
||||||
<color name="colorRed">#eb3718</color>
|
<color name="colorRed">#CC361C</color>
|
||||||
<color name="colorLightGreen">#49da39</color>
|
<color name="colorLightGreen">#49da39</color>
|
||||||
<color name="colorDarkGreen">#009486</color>
|
<color name="colorDarkGreen">#009486</color>
|
||||||
<color name="darkRed">#e74c3c</color>
|
<color name="darkRed">#e74c3c</color>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
|
|
||||||
<string name="versionLow" translatable="false">1.10</string>
|
<string name="versionLow" translatable="false">1.11</string>
|
||||||
<string name="versionHigh" translatable="false">1.12</string>
|
<string name="versionHigh" translatable="false">1.13</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -4,9 +4,9 @@
|
|||||||
<string name="appAuthor" translatable="false">Developer : M M Arif</string>
|
<string name="appAuthor" translatable="false">Developer : M M Arif</string>
|
||||||
<string name="appEmail" translatable="false">gitnex@swatian.com</string>
|
<string name="appEmail" translatable="false">gitnex@swatian.com</string>
|
||||||
<string name="appRepo" translatable="false">Source code</string>
|
<string name="appRepo" translatable="false">Source code</string>
|
||||||
<string name="appRepoLink" translatable="false">https://gitea.com/gitnex/GitNex</string>
|
<string name="appRepoLink" translatable="false">https://codeberg.org/gitnex/GitNex</string>
|
||||||
<string name="appRepoIssuesLink" translatable="false">https://gitea.com/gitnex/GitNex/issues</string>
|
<string name="appRepoIssuesLink" translatable="false">https://codeberg.org/gitnex/GitNex/issues</string>
|
||||||
<string name="appRepoContributingLink" translatable="false">https://gitea.com/gitnex/GitNex/src/branch/master/CONTRIBUTING.md</string>
|
<string name="appRepoContributingLink" translatable="false">https://codeberg.org/gitnex/GitNex/src/branch/master/CONTRIBUTING.md</string>
|
||||||
<string name="appWebsite" translatable="false">Website</string>
|
<string name="appWebsite" translatable="false">Website</string>
|
||||||
<string name="appWebsiteLink" translatable="false">https://gitnex.com/</string>
|
<string name="appWebsiteLink" translatable="false">https://gitnex.com/</string>
|
||||||
<string name="commitPage" translatable="false">Your Gitea version\n</string>
|
<string name="commitPage" translatable="false">Your Gitea version\n</string>
|
||||||
@ -216,6 +216,7 @@
|
|||||||
<string name="releaseTypeStable" translatable="false">Stable</string>
|
<string name="releaseTypeStable" translatable="false">Stable</string>
|
||||||
<string name="noDataReleasesTab">No releases found</string>
|
<string name="noDataReleasesTab">No releases found</string>
|
||||||
<string name="releaseTag">Tag: %1$s</string>
|
<string name="releaseTag">Tag: %1$s</string>
|
||||||
|
<string name="releasePublishedBy">Published by @%1$s</string>
|
||||||
|
|
||||||
<string name="collaboratorsNameToast">Collaborator : %1$s</string>
|
<string name="collaboratorsNameToast">Collaborator : %1$s</string>
|
||||||
<string name="noDataCollaboratorTab">No collaborators found</string>
|
<string name="noDataCollaboratorTab">No collaborators found</string>
|
||||||
@ -232,8 +233,10 @@
|
|||||||
<string name="milestoneCreated">Milestone created successfully</string>
|
<string name="milestoneCreated">Milestone created successfully</string>
|
||||||
<string name="milestoneCreatedError">Something went wrong, please try again</string>
|
<string name="milestoneCreatedError">Something went wrong, please try again</string>
|
||||||
<string name="milestoneDateEmpty">Please choose due date</string>
|
<string name="milestoneDateEmpty">Please choose due date</string>
|
||||||
<string name="milestoneOpenIssues">Open issues : %1$d</string>
|
<string name="milestoneNoDueDate">No due date</string>
|
||||||
<string name="milestoneClosedIssues">Closed issues : %1$d</string>
|
<string name="milestoneNoDescription">No description</string>
|
||||||
|
<string name="milestoneIssueStatusOpen">%1$d Open</string>
|
||||||
|
<string name="milestoneIssueStatusClosed">%1$d Closed</string>
|
||||||
|
|
||||||
<string name="newIssueSelectAssigneesListTitle">Select Assignees</string>
|
<string name="newIssueSelectAssigneesListTitle">Select Assignees</string>
|
||||||
<string name="newIssueSelectLabelsListTitle">Select Labels</string>
|
<string name="newIssueSelectLabelsListTitle">Select Labels</string>
|
||||||
@ -276,7 +279,7 @@
|
|||||||
<string name="settingsCodeBlockSelectorDialogTitle">Code Block Color Selector</string>
|
<string name="settingsCodeBlockSelectorDialogTitle">Code Block Color Selector</string>
|
||||||
<string name="settingsHomeScreenHeaderText">Home Screen</string>
|
<string name="settingsHomeScreenHeaderText">Home Screen</string>
|
||||||
<string name="settingsHomeScreenSelectedText">My Repositories</string>
|
<string name="settingsHomeScreenSelectedText">My Repositories</string>
|
||||||
<string name="settingshomeScreenSelectorDialogTitle">Select Home Screen</string>
|
<string name="settingsHomeScreenSelectorDialogTitle">Select Home Screen</string>
|
||||||
<string name="settingsCustomFontHeaderText">Font</string>
|
<string name="settingsCustomFontHeaderText">Font</string>
|
||||||
<string name="settingsCustomFontSelectorDialogTitle">Choose Font</string>
|
<string name="settingsCustomFontSelectorDialogTitle">Choose Font</string>
|
||||||
<string name="settingsCustomFontDefault" translatable="false">Manrope</string>
|
<string name="settingsCustomFontDefault" translatable="false">Manrope</string>
|
||||||
@ -404,7 +407,7 @@
|
|||||||
<string name="emailErrorInUse">Email address is already in use</string>
|
<string name="emailErrorInUse">Email address is already in use</string>
|
||||||
<string name="emailTypeText">Primary</string>
|
<string name="emailTypeText">Primary</string>
|
||||||
<string name="profileTabEmails">Emails</string>
|
<string name="profileTabEmails">Emails</string>
|
||||||
<string name="usernameWithAt" translatable="false">\u0040\u0020%1$s</string>
|
<string name="usernameWithAt" translatable="false">\u0040%1$s</string>
|
||||||
<!-- profile section -->
|
<!-- profile section -->
|
||||||
|
|
||||||
<!-- single issue section -->
|
<!-- single issue section -->
|
||||||
@ -484,12 +487,14 @@
|
|||||||
<string name="noDataStargazers">No stars found</string>
|
<string name="noDataStargazers">No stars found</string>
|
||||||
<string name="noDataWatchers">No watchers found</string>
|
<string name="noDataWatchers">No watchers found</string>
|
||||||
<string name="noDataWebsite">No website found</string>
|
<string name="noDataWebsite">No website found</string>
|
||||||
|
<string name="noDataDescription">No description found</string>
|
||||||
|
<string name="noDataLocation">No location found</string>
|
||||||
<string name="starMember">Star</string>
|
<string name="starMember">Star</string>
|
||||||
<string name="watcherMember">Watcher</string>
|
<string name="watcherMember">Watcher</string>
|
||||||
|
|
||||||
<string name="commitLinkBranchesTab">Commit</string>
|
<string name="commitLinkBranchesTab">Commit</string>
|
||||||
<string name="zipArchiveDownloadReleasesTab">Zip Archive</string>
|
<string name="zipArchiveDownloadReleasesTab">Source code (ZIP)</string>
|
||||||
<string name="tarArchiveDownloadReleasesTab">Tar Archive</string>
|
<string name="tarArchiveDownloadReleasesTab">Source code (TAR.GZ)</string>
|
||||||
|
|
||||||
<!-- new file -->
|
<!-- new file -->
|
||||||
<string name="newFileNameTintCopy">File Name</string>
|
<string name="newFileNameTintCopy">File Name</string>
|
||||||
@ -573,7 +578,7 @@
|
|||||||
<string name="versionUnsupportedNew">New Gitea version detected! Please UPDATE GitNex!</string>
|
<string name="versionUnsupportedNew">New Gitea version detected! Please UPDATE GitNex!</string>
|
||||||
<string name="versionSupportedLatest">Gitea version is up to date</string>
|
<string name="versionSupportedLatest">Gitea version is up to date</string>
|
||||||
<string name="versionDevelopment">Gitea development version</string>
|
<string name="versionDevelopment">Gitea development version</string>
|
||||||
<string name="versionUnknow">No Gitea detected!</string>
|
<string name="versionUnknown">No Gitea detected!</string>
|
||||||
<string name="versionAlertTitle">Version Alert</string>
|
<string name="versionAlertTitle">Version Alert</string>
|
||||||
<string name="versionAlertDialogHeader">Unsupported Version of Gitea</string>
|
<string name="versionAlertDialogHeader">Unsupported Version of Gitea</string>
|
||||||
|
|
||||||
@ -627,7 +632,7 @@
|
|||||||
<string name="mtm_accept_cert">Accept Unknown Certificate?</string>
|
<string name="mtm_accept_cert">Accept Unknown Certificate?</string>
|
||||||
<string name="mtm_trust_anchor">The server certificate is not signed by a known Certificate Authority.</string>
|
<string name="mtm_trust_anchor">The server certificate is not signed by a known Certificate Authority.</string>
|
||||||
<string name="mtm_cert_expired">The server certificate is expired.</string>
|
<string name="mtm_cert_expired">The server certificate is expired.</string>
|
||||||
<string name="mtm_accept_servername">Accept Mismatching Server Name?</string>
|
<string name="mtm_accept_server_name">Accept Mismatching Server Name?</string>
|
||||||
<string name="mtm_hostname_mismatch">Server could not authenticate as \"%s\". The certificate is only valid for:</string>
|
<string name="mtm_hostname_mismatch">Server could not authenticate as \"%s\". The certificate is only valid for:</string>
|
||||||
<string name="mtm_connect_anyway">Do you want to connect anyway?</string>
|
<string name="mtm_connect_anyway">Do you want to connect anyway?</string>
|
||||||
<string name="mtm_cert_details">Certificate details:</string>
|
<string name="mtm_cert_details">Certificate details:</string>
|
||||||
@ -637,10 +642,10 @@
|
|||||||
|
|
||||||
<string name="subscribedSuccessfully">Subscribed successfully</string>
|
<string name="subscribedSuccessfully">Subscribed successfully</string>
|
||||||
<string name="alreadySubscribed">You have already subscribed</string>
|
<string name="alreadySubscribed">You have already subscribed</string>
|
||||||
<string name="subscribtionError">Subscription failed</string>
|
<string name="subscriptionError">Subscription failed</string>
|
||||||
<string name="unsubscribedSuccessfully">Unsubscribed successfully</string>
|
<string name="unsubscribedSuccessfully">Unsubscribed successfully</string>
|
||||||
<string name="alreadyUnsubscribed">You have already Unsubscribed</string>
|
<string name="alreadyUnsubscribed">You have already Unsubscribed</string>
|
||||||
<string name="unsubscribtionError">Un-Subscription failed</string>
|
<string name="unsubscriptionError">Un-Subscription failed</string>
|
||||||
|
|
||||||
<string name="closeMilestone">Close Milestone</string>
|
<string name="closeMilestone">Close Milestone</string>
|
||||||
<string name="openMilestone">Open Milestone</string>
|
<string name="openMilestone">Open Milestone</string>
|
||||||
@ -654,9 +659,11 @@
|
|||||||
<string name="setCrashReports">Crash reports</string>
|
<string name="setCrashReports">Crash reports</string>
|
||||||
<string name="crashMessage">You can tap the OK button to send the crash report by email. It will help to fix it :)\n\nYou can also add additional content in the email. Thank you!</string>
|
<string name="crashMessage">You can tap the OK button to send the crash report by email. It will help to fix it :)\n\nYou can also add additional content in the email. Thank you!</string>
|
||||||
|
|
||||||
<string name="appreanceHintText">Themes, fonts, badges, code block theme</string>
|
<string name="appearanceHintText">Themes, fonts, badges, code block theme</string>
|
||||||
<string name="fileViewerHintText">PDF mode, source code theme</string>
|
<string name="fileViewerHintText">PDF mode, source code theme</string>
|
||||||
<string name="securityHintText">SSL certificates, cache</string>
|
<string name="securityHintText">SSL certificates, cache</string>
|
||||||
<string name="languagesHintText">Languages</string>
|
<string name="languagesHintText">Languages</string>
|
||||||
<string name="reportsHintText">Crash reports</string>
|
<string name="reportsHintText">Crash reports</string>
|
||||||
|
|
||||||
|
<string name="archivedRepository">Archived</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<changelog>
|
<changelog>
|
||||||
|
|
||||||
<release version="3.0.0-rc1" versioncode="295">
|
<release version="3.0.0-rc2" versioncode="296">
|
||||||
<change>Under development</change>
|
<change>Under development</change>
|
||||||
</release>
|
</release>
|
||||||
|
|
||||||
|
51
app/src/test/java/org/mian/gitnex/helpers/ParseDiffTest.java
Normal file
51
app/src/test/java/org/mian/gitnex/helpers/ParseDiffTest.java
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
package org.mian.gitnex.helpers;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.mian.gitnex.models.FileDiffView;
|
||||||
|
import java.util.List;
|
||||||
|
import static org.junit.Assert.assertEquals;
|
||||||
|
import static org.junit.Assert.assertFalse;
|
||||||
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Author 6543
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class ParseDiffTest {
|
||||||
|
|
||||||
|
private String commitDiff = "diff --git a/blob.bin b/blob.bin\n" + "deleted file mode 100644\n" + "index 0d73bd2..0000000\n" + "Binary files a/blob.bin and /dev/null differ\n" + "diff --git a/newOne.txt b/newOne.txt\n" + "new file mode 100644\n" + "index 0000000..d46eed0\n" + "--- /dev/null\n" + "+++ b/newOne.txt\n" + "@@ -0,0 +1,2 @@\n" + "+a new file\n" + "+is ok\n" + "diff --git a/toDel.txt b/toDel.txt\n" + "deleted file mode 100644\n" + "index db7b61d..0000000\n" + "--- a/toDel.txt\n" + "+++ /dev/null\n" + "@@ -1,6 +0,0 @@\n" + "-fdsafew\n" + "-fcdsafd\n" + "-saf\n" + "-dsa\n" + "-fds\n" + "-af\n" + "diff --git a/wow.txt b/wow.txt\n" + "index 92e7b0a..c6f2550 100644\n" + "--- a/wow.txt\n" + "+++ b/wow.txt\n" + "@@ -1 +1 @@\n" + "-no newLN\n" + "\\ No newline at end of file\n" + "+no newLN";
|
||||||
|
private String pullDiff = "diff --git a/blob.bin b/blob.bin\n" + "deleted file mode 100644\n" + "index 0d73bd22356cdedbda15802490dbba5677c0bf82..0000000000000000000000000000000000000000\n" + "GIT binary patch\n" + "literal 0\n" + "HcmV?d00001\n" + "\n" + "literal 1048576\n" + "zcmV(nK=QwPuB28ikRJ&1O;k}2;ZJdPRlcSh&H3ZzL{FUXh$7I70$=OgJ&|C6l9n5^\n" + "z)($UbdKG~u1=kru;-zP`c59V|o(6s6w`nh4BZjq62uO^~OO=?T8h^2Wd<-s#e_iI~\n" + "zURkze=$MhaJ$k?4&39P$(BT6=fYUYoKa5hsMqqt;d=e0W61jUQXj5h&>9Mf9aHlLn\n" + "zL?z4mKo3>xs9>gwR}Cx#ZeNWKy0M;5CRQHq%6NVh5=X<1a8P)FsE7yASIj-Jq{{ex\n" + "z2A~tfI3XyuL5>6ot@$SpZItcakZOhIGXKm-LOOpY_XVQ@3=@2EfJq~TXJfiw$1e+3\n" + "zGr~C0-C$O1g|{ndCbn0qMk{!T3Yz523kz;7D*LkRfhH7eYxM4fpC`qUAu4irPjtJy\n" + "Jx`FK##b8Ms9rXYJ\n" + "diff --git a/newOne.txt b/newOne.txt\n" + "new file mode 100644\n" + "index 0000000..d46eed0\n" + "--- /dev/null\n" + "+++ b/newOne.txt\n" + "@@ -0,0 +1,2 @@\n" + "+a new file\n" + "+is ok\n" + "diff --git a/toDel.txt b/toDel.txt\n" + "deleted file mode 100644\n" + "index db7b61d..0000000\n" + "--- a/toDel.txt\n" + "+++ /dev/null\n" + "@@ -1,6 +0,0 @@\n" + "-fdsafew\n" + "-fcdsafd\n" + "-saf\n" + "-dsa\n" + "-fds\n" + "-af\n" + "diff --git a/wow.txt b/wow.txt\n" + "index 92e7b0a..c6f2550 100644\n" + "--- a/wow.txt\n" + "+++ b/wow.txt\n" + "@@ -1 +1 @@\n" + "-no newLN\n" + "\\ No newline at end of file\n" + "+no newLN";
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void parseCommitDiff() {
|
||||||
|
|
||||||
|
List<FileDiffView> parsed = ParseDiff.getFileDiffViewArray(commitDiff);
|
||||||
|
assertEquals(4, parsed.size());
|
||||||
|
assertTrue(parsed.get(0).isFileBinary());
|
||||||
|
assertFalse(parsed.get(1).isFileBinary());
|
||||||
|
|
||||||
|
assertEquals(1, parsed.get(1).getFileContents().size());
|
||||||
|
assertEquals(2, parsed.get(1).getFileContents().get(0).getLineAdded());
|
||||||
|
assertEquals(0, parsed.get(1).getFileContents().get(0).getLineRemoved());
|
||||||
|
|
||||||
|
assertEquals(1, parsed.get(3).getFileContents().get(0).getLineAdded());
|
||||||
|
assertEquals(1, parsed.get(3).getFileContents().get(0).getLineRemoved());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void parsePullDiff() {
|
||||||
|
|
||||||
|
List<FileDiffView> parsed = ParseDiff.getFileDiffViewArray(pullDiff);
|
||||||
|
assertEquals(4, parsed.size());
|
||||||
|
assertTrue(parsed.get(0).isFileBinary());
|
||||||
|
assertFalse(parsed.get(1).isFileBinary());
|
||||||
|
|
||||||
|
assertEquals(1, parsed.get(1).getFileContents().size());
|
||||||
|
assertEquals(2, parsed.get(1).getFileContents().get(0).getLineAdded());
|
||||||
|
assertEquals(0, parsed.get(1).getFileContents().get(0).getLineRemoved());
|
||||||
|
|
||||||
|
assertEquals(1, parsed.get(3).getFileContents().get(0).getLineAdded());
|
||||||
|
assertEquals(1, parsed.get(3).getFileContents().get(0).getLineRemoved());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,13 +1,13 @@
|
|||||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
jcenter()
|
jcenter()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:3.6.3'
|
classpath 'com.android.tools.build:gradle:4.0.0'
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -22,4 +22,4 @@ allprojects {
|
|||||||
|
|
||||||
task clean(type: Delete) {
|
task clean(type: Delete) {
|
||||||
delete rootProject.buildDir
|
delete rootProject.buildDir
|
||||||
}
|
}
|
||||||
|
@ -3,4 +3,4 @@
|
|||||||
Release notes will be published with the stable release.
|
Release notes will be published with the stable release.
|
||||||
In the mean time check the milestone for pull requests and issues that are merged/closed.
|
In the mean time check the milestone for pull requests and issues that are merged/closed.
|
||||||
|
|
||||||
https://gitea.com/gitnex/GitNex/milestone/171?q=&type=all&sort=&state=closed&labels=&assignee=0
|
https://codeberg.org/gitnex/GitNex/milestone/296?type=all&state=closed
|
||||||
|
@ -3,4 +3,4 @@
|
|||||||
Release notes will be published with the stable release.
|
Release notes will be published with the stable release.
|
||||||
In the mean time check the milestone for pull requests and issues that are merged/closed.
|
In the mean time check the milestone for pull requests and issues that are merged/closed.
|
||||||
|
|
||||||
https://gitea.com/gitnex/GitNex/milestone/171?q=&type=all&state=closed
|
https://codeberg.org/gitnex/GitNex/milestone/296?type=all&state=closed
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user