Compare commits
39 Commits
3.1.2
...
release-3.
Author | SHA1 | Date | |
---|---|---|---|
0f014c2822 | |||
996983d7a3 | |||
00cfcbc9cf | |||
74669a9dcb | |||
d52d7a188e | |||
d20a773d1d | |||
bf19e52799 | |||
8612258174 | |||
a31abf0974 | |||
6d466e2542 | |||
01bd61ad8e | |||
4031c32fc8 | |||
d51d2d5164 | |||
7b8bc21a83 | |||
1c1f73eafc | |||
02672aef3d | |||
23fb1ce71f | |||
1f5eeb5632 | |||
78782d159a | |||
a75ffe0381 | |||
c4279dcd77 | |||
14b1256ce1 | |||
7b72815bcb | |||
5e6c600e71 | |||
dbf5be25a5 | |||
2bfe0b8d1a | |||
0c92eb3fa2 | |||
32f3080283 | |||
7342668a1b | |||
6f9bbe4c58 | |||
b2b42887f7 | |||
37f622b952 | |||
d677c90b01 | |||
23d3ba7f42 | |||
a42d888eb7 | |||
bbcffd67d6 | |||
00eb9c9135 | |||
28a23d30f8 | |||
82f874dc37 |
@ -66,7 +66,7 @@ steps:
|
||||
- name: build
|
||||
image: nextcloudci/android:android-49
|
||||
commands:
|
||||
- ./gradlew build
|
||||
- ./gradlew assembleFreeRelease
|
||||
|
||||
- name: sign
|
||||
image: nextcloudci/android:android-49
|
||||
@ -78,7 +78,7 @@ steps:
|
||||
KEY_PASS:
|
||||
from_secret: KEY_PASS
|
||||
OUTPUT: signed.apk
|
||||
GITEA: https://gitea.com
|
||||
INSTANCE: https://codeberg.org
|
||||
KS_FILE: ci_keystore.jks
|
||||
KS_REPO:
|
||||
from_secret: KS_REPO
|
||||
|
3
.gitignore
vendored
@ -11,6 +11,9 @@
|
||||
# Release dir
|
||||
app/release/*
|
||||
|
||||
# Pro dir
|
||||
app/pro/*
|
||||
|
||||
# Files for the ART/Dalvik VM
|
||||
*.dex
|
||||
|
||||
|
@ -7,6 +7,9 @@ stages:
|
||||
test:
|
||||
image: nextcloudci/android:android-49
|
||||
stage: test
|
||||
only:
|
||||
- master
|
||||
- tags
|
||||
script:
|
||||
- ./gradlew test
|
||||
|
||||
@ -15,8 +18,9 @@ build:
|
||||
stage: build
|
||||
only:
|
||||
- master
|
||||
- tags
|
||||
script:
|
||||
- ./gradlew build
|
||||
- ./gradlew assembleFreeRelease
|
||||
artifacts:
|
||||
paths:
|
||||
- app/build/outputs/
|
||||
@ -27,9 +31,10 @@ sign:
|
||||
stage: sign
|
||||
only:
|
||||
- master
|
||||
- tags
|
||||
variables:
|
||||
OUTPUT: "signed.apk"
|
||||
GITEA: "https://gitea.com"
|
||||
INSTANCE: "https://codeberg.org"
|
||||
KS_FILE: "ci_keystore.jks"
|
||||
script:
|
||||
- ./scripts/sign-build.sh
|
||||
@ -43,6 +48,7 @@ latest:
|
||||
stage: publish
|
||||
only:
|
||||
- master
|
||||
- tags
|
||||
variables:
|
||||
WEBDAV_USERNAME: "GitNexBot"
|
||||
PLUGIN_FILE: "signed.apk"
|
||||
|
20
.idea/codeStyles/Project.xml
generated
@ -16,6 +16,24 @@
|
||||
</value>
|
||||
</option>
|
||||
</JavaCodeStyleSettings>
|
||||
<JetCodeStyleSettings>
|
||||
<option name="PACKAGES_TO_USE_STAR_IMPORTS">
|
||||
<value>
|
||||
<package name="java.util" alias="false" withSubpackages="false" />
|
||||
<package name="kotlinx.android.synthetic" alias="false" withSubpackages="true" />
|
||||
<package name="io.ktor" alias="false" withSubpackages="true" />
|
||||
</value>
|
||||
</option>
|
||||
<option name="PACKAGES_IMPORT_LAYOUT">
|
||||
<value>
|
||||
<package name="" alias="false" withSubpackages="true" />
|
||||
<package name="java" alias="false" withSubpackages="true" />
|
||||
<package name="javax" alias="false" withSubpackages="true" />
|
||||
<package name="kotlin" alias="false" withSubpackages="true" />
|
||||
<package name="" alias="true" withSubpackages="true" />
|
||||
</value>
|
||||
</option>
|
||||
</JetCodeStyleSettings>
|
||||
<codeStyleSettings language="JAVA">
|
||||
<option name="RIGHT_MARGIN" value="220" />
|
||||
<option name="KEEP_LINE_BREAKS" value="false" />
|
||||
@ -162,4 +180,4 @@
|
||||
</arrangement>
|
||||
</codeStyleSettings>
|
||||
</code_scheme>
|
||||
</component>
|
||||
</component>
|
||||
|
10
README.md
@ -1,16 +1,16 @@
|
||||
[](https://www.gnu.org/licenses/gpl-3.0) [](https://codeberg.org/gitnex/GitNex/releases) [](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)
|
||||
|
||||
# GitNex - Android client for Gitea
|
||||
|
||||
GitNex is a free, open-source Android client for Git repository management tool Gitea. Gitea is a community managed fork of Gogs, lightweight code hosting solution written in Go.
|
||||
GitNex is a free/paid, open-source Android client for Git repository management tool Gitea. Gitea is a community managed fork of Gogs, lightweight code hosting solution written in Go.
|
||||
|
||||
GitNex is licensed under GPLv3 License. See the LICENSE file for the full license text. No trackers are used and source code is available here for anyone to audit.
|
||||
|
||||
## Downloads
|
||||
[<img alt='Get it on F-droid' src='https://gitlab.com/fdroid/artwork/raw/master/badge/get-it-on.png' height="80"/>](https://f-droid.org/en/packages/org.mian.gitnex/)
|
||||
[<img alt='Get it on Google Play' src='https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png' height="80"/>](https://play.google.com/store/apps/details?id=org.mian.gitnex)
|
||||
[<img alt='Get it on Google Play' src='https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png' height="80"/>](https://play.google.com/store/apps/details?id=org.mian.gitnex.pro)
|
||||
[<img alt='Download builds and releases' src='assets/apk-badge.png' height="82"/>](https://cloud.swatian.com/s/DN7E5xxtaw4fRbE)
|
||||
|
||||
## Note about Gitea version
|
||||
@ -21,11 +21,10 @@ Check the versions [compatibility page](https://codeberg.org/gitnex/GitNex/wiki/
|
||||
## Build from source
|
||||
Option 1 - Download the source code, open it in Android Studio and build it there.
|
||||
|
||||
Option 2 - Open terminal(Linux) and cd to the project dir. Run `./gradlew build`.
|
||||
Option 2 - Open terminal(Linux) and cd to the project dir. Run `./gradlew assembleFree`.
|
||||
|
||||
## Features
|
||||
- Multiple accounts support
|
||||
- Repositories / issues/ org list
|
||||
- File and directory browser
|
||||
- File viewer
|
||||
- Create files
|
||||
@ -34,6 +33,7 @@ Option 2 - Open terminal(Linux) and cd to the project dir. Run `./gradlew build`
|
||||
- Files diff for PRs
|
||||
- Notifications
|
||||
- Drafts
|
||||
- Repositories / issues / org list
|
||||
- [MANY MORE](https://codeberg.org/gitnex/GitNex/wiki/Features)
|
||||
|
||||
## Contributing
|
||||
|
@ -1,15 +1,28 @@
|
||||
apply plugin: 'com.android.application'
|
||||
|
||||
android {
|
||||
compileSdkVersion 29
|
||||
compileSdkVersion 30
|
||||
defaultConfig {
|
||||
applicationId "org.mian.gitnex"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 29
|
||||
versionCode 310
|
||||
versionName "3.1.0"
|
||||
targetSdkVersion 30
|
||||
versionCode 320
|
||||
versionName "3.2.0"
|
||||
multiDexEnabled true
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
dexOptions {
|
||||
javaMaxHeapSize "4g"
|
||||
}
|
||||
flavorDimensions "default"
|
||||
productFlavors {
|
||||
free {
|
||||
applicationId "org.mian.gitnex"
|
||||
}
|
||||
pro {
|
||||
applicationId "org.mian.gitnex.pro"
|
||||
}
|
||||
}
|
||||
buildFeatures {
|
||||
viewBinding = true
|
||||
}
|
||||
@ -39,29 +52,29 @@ configurations {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
def lifecycle_version = "2.3.0-alpha06"
|
||||
def markwon_version = "4.4.0"
|
||||
def lifecycle_version = '2.3.0-alpha07'
|
||||
def markwon_version = '4.6.0'
|
||||
def work_version = "2.4.0"
|
||||
def acra = "5.5.0"
|
||||
|
||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||
implementation "androidx.appcompat:appcompat:1.3.0-alpha01"
|
||||
implementation 'androidx.appcompat:appcompat:1.3.0-alpha02'
|
||||
implementation "com.google.android.material:material:1.3.0-alpha02"
|
||||
implementation "androidx.constraintlayout:constraintlayout:1.1.3"
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
|
||||
implementation "androidx.legacy:legacy-support-v4:1.0.0"
|
||||
implementation "androidx.lifecycle:lifecycle-viewmodel:$lifecycle_version"
|
||||
testImplementation "junit:junit:4.13"
|
||||
androidTestImplementation "androidx.test:runner:1.2.0"
|
||||
androidTestImplementation "androidx.test.espresso:espresso-core:3.2.0"
|
||||
androidTestImplementation 'androidx.test:runner:1.3.0'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
|
||||
implementation "com.github.vihtarb:tooltip:0.2.0"
|
||||
implementation 'com.squareup.okhttp3:okhttp:4.8.0'
|
||||
implementation 'com.squareup.okhttp3:okhttp:4.9.0'
|
||||
implementation "com.google.code.gson:gson:2.8.6"
|
||||
implementation "com.squareup.picasso:picasso:2.71828"
|
||||
implementation "com.amulyakhare:com.amulyakhare.textdrawable:1.0.1"
|
||||
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
||||
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
||||
implementation 'com.squareup.retrofit2:converter-scalars:2.9.0'
|
||||
implementation 'com.squareup.okhttp3:logging-interceptor:4.8.0'
|
||||
implementation 'com.squareup.okhttp3:logging-interceptor:4.9.0'
|
||||
implementation 'org.ocpsoft.prettytime:prettytime:4.0.5.Final'
|
||||
implementation "com.vdurmont:emoji-java:5.1.1"
|
||||
implementation "com.pes.materialcolorpicker:library:1.2.5"
|
||||
|
@ -84,6 +84,8 @@
|
||||
<activity android:name=".activities.SettingsDraftsActivity" />
|
||||
<activity android:name=".activities.RepoForksActivity" />
|
||||
<activity android:name=".activities.AddNewAccountActivity" />
|
||||
<activity android:name=".activities.RepositorySettingsActivity" />
|
||||
<activity android:name=".activities.CreatePullRequestActivity" />
|
||||
|
||||
<!-- Version < 3.0. DeX Mode and Screen Mirroring support -->
|
||||
<meta-data android:name="com.samsung.android.keepalive.density" android:value="true"/>
|
||||
|
BIN
app/src/main/app_logo-playstore.png
Normal file
After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 15 KiB |
@ -144,5 +144,4 @@ public class AddCollaboratorToRepositoryActivity extends BaseActivity {
|
||||
onClickListener = view -> finish();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -40,9 +40,11 @@ public class AddNewAccountActivity extends BaseActivity {
|
||||
private ActivityAddNewAccountBinding viewBinding;
|
||||
|
||||
private enum Protocol {HTTPS, HTTP}
|
||||
private String spinnerSelectedValue;
|
||||
|
||||
@Override
|
||||
protected int getLayoutResourceId(){
|
||||
protected int getLayoutResourceId() {
|
||||
|
||||
return R.layout.activity_add_new_account;
|
||||
}
|
||||
|
||||
@ -62,12 +64,12 @@ public class AddNewAccountActivity extends BaseActivity {
|
||||
initCloseListener();
|
||||
viewBinding.close.setOnClickListener(onClickListener);
|
||||
|
||||
ArrayAdapter<AddNewAccountActivity.Protocol> adapterProtocols = new ArrayAdapter<>(AddNewAccountActivity.this, R.layout.spinner_item, AddNewAccountActivity.Protocol.values());
|
||||
adapterProtocols.setDropDownViewResource(R.layout.spinner_dropdown_item);
|
||||
|
||||
ArrayAdapter<Protocol> adapterProtocols = new ArrayAdapter<>(ctx, R.layout.list_spinner_items, Protocol.values());
|
||||
viewBinding.protocolSpinner.setAdapter(adapterProtocols);
|
||||
|
||||
viewBinding.addNewAccount.setOnClickListener(login -> {
|
||||
viewBinding.protocolSpinner.setOnItemClickListener((parent, view1, position, id) -> spinnerSelectedValue = String.valueOf(parent.getItemAtPosition(position)));
|
||||
|
||||
viewBinding.addNewAccount.setOnClickListener(login -> {
|
||||
|
||||
boolean connToInternet = AppUtil.hasNetworkConnection(appCtx);
|
||||
|
||||
@ -80,7 +82,7 @@ public class AddNewAccountActivity extends BaseActivity {
|
||||
|
||||
processLogin();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@ -88,9 +90,15 @@ public class AddNewAccountActivity extends BaseActivity {
|
||||
|
||||
try {
|
||||
|
||||
String instanceUrlET = viewBinding.instanceUrl.getText().toString();
|
||||
String loginToken = viewBinding.loginToken.getText().toString();
|
||||
Protocol protocol = (Protocol) viewBinding.protocolSpinner.getSelectedItem();
|
||||
String instanceUrlET = String.valueOf(viewBinding.instanceUrl.getText());
|
||||
String loginToken = String.valueOf(viewBinding.loginToken.getText());
|
||||
String protocol = spinnerSelectedValue;
|
||||
|
||||
if(protocol == null) {
|
||||
|
||||
Toasty.error(ctx, getResources().getString(R.string.protocolEmptyError));
|
||||
return;
|
||||
}
|
||||
|
||||
if(instanceUrlET.equals("")) {
|
||||
|
||||
@ -106,10 +114,7 @@ public class AddNewAccountActivity extends BaseActivity {
|
||||
|
||||
URI rawInstanceUrl = UrlBuilder.fromString(UrlHelper.fixScheme(instanceUrlET, "http")).toUri();
|
||||
|
||||
URI instanceUrlWithProtocol = UrlBuilder.fromUri(rawInstanceUrl).withPath(PathsHelper.join(rawInstanceUrl.getPath()))
|
||||
.withScheme(protocol.name().toLowerCase()).toUri();
|
||||
|
||||
URI instanceUrl = UrlBuilder.fromUri(instanceUrlWithProtocol).withPath(PathsHelper.join(instanceUrlWithProtocol.getPath(), "/api/v1/"))
|
||||
URI instanceUrl = UrlBuilder.fromUri(rawInstanceUrl).withScheme(protocol.toLowerCase()).withPath(PathsHelper.join(rawInstanceUrl.getPath(), "/api/v1/"))
|
||||
.toUri();
|
||||
|
||||
versionCheck(instanceUrl.toString(), loginToken);
|
||||
@ -127,7 +132,7 @@ public class AddNewAccountActivity extends BaseActivity {
|
||||
|
||||
Call<GiteaVersion> callVersion;
|
||||
|
||||
callVersion = RetrofitClient.getInstance(instanceUrl, ctx).getApiInterface().getGiteaVersionWithToken(loginToken);
|
||||
callVersion = RetrofitClient.getInstance(instanceUrl, ctx).getApiInterface().getGiteaVersionWithToken("token " + loginToken);
|
||||
|
||||
callVersion.enqueue(new Callback<GiteaVersion>() {
|
||||
|
||||
@ -137,19 +142,16 @@ public class AddNewAccountActivity extends BaseActivity {
|
||||
if(responseVersion.code() == 200) {
|
||||
|
||||
GiteaVersion version = responseVersion.body();
|
||||
Version giteaVersion;
|
||||
|
||||
assert version != null;
|
||||
|
||||
try {
|
||||
giteaVersion = new Version(version.getVersion());
|
||||
}
|
||||
catch(Exception e) {
|
||||
|
||||
if(!Version.valid(version.getVersion())) {
|
||||
Toasty.error(ctx, getResources().getString(R.string.versionUnknown));
|
||||
return;
|
||||
}
|
||||
|
||||
tinyDB.putString("giteaVersion", version.getVersion());
|
||||
Version giteaVersion = new Version(version.getVersion());
|
||||
|
||||
if(giteaVersion.less(getString(R.string.versionLow))) {
|
||||
|
||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(ctx).setTitle(getString(R.string.versionAlertDialogHeader))
|
||||
@ -159,7 +161,6 @@ public class AddNewAccountActivity extends BaseActivity {
|
||||
alertDialogBuilder.setNegativeButton(getString(R.string.cancelButton), (dialog, which) -> {
|
||||
|
||||
dialog.dismiss();
|
||||
//enableProcessButton();
|
||||
});
|
||||
|
||||
alertDialogBuilder.setPositiveButton(getString(R.string.textContinue), (dialog, which) -> {
|
||||
@ -239,12 +240,12 @@ public class AddNewAccountActivity extends BaseActivity {
|
||||
|
||||
case 401:
|
||||
|
||||
Toasty.error(ctx,getResources().getString(R.string.unauthorizedApiError));
|
||||
Toasty.error(ctx, getResources().getString(R.string.unauthorizedApiError));
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
Toasty.error(ctx,getResources().getString(R.string.genericApiStatusError) + response.code());
|
||||
Toasty.error(ctx, getResources().getString(R.string.genericApiStatusError) + response.code());
|
||||
}
|
||||
|
||||
}
|
||||
@ -253,7 +254,7 @@ public class AddNewAccountActivity extends BaseActivity {
|
||||
public void onFailure(@NonNull Call<UserInfo> call, @NonNull Throwable t) {
|
||||
|
||||
Log.e("onFailure", t.toString());
|
||||
Toasty.error(ctx,getResources().getString(R.string.genericError));
|
||||
Toasty.error(ctx, getResources().getString(R.string.genericError));
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -5,6 +5,7 @@ import android.os.Bundle;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import org.acra.ACRA;
|
||||
import org.acra.BuildConfig;
|
||||
import org.acra.annotation.AcraCore;
|
||||
import org.acra.annotation.AcraNotification;
|
||||
import org.acra.config.CoreConfigurationBuilder;
|
||||
import org.acra.config.LimiterConfigurationBuilder;
|
||||
@ -16,6 +17,7 @@ import org.mian.gitnex.helpers.FontsOverride;
|
||||
import org.mian.gitnex.helpers.TimeHelper;
|
||||
import org.mian.gitnex.helpers.TinyDB;
|
||||
import org.mian.gitnex.notifications.NotificationsMaster;
|
||||
import static org.acra.ReportField.*;
|
||||
|
||||
/**
|
||||
* Author M M Arif
|
||||
@ -25,6 +27,7 @@ import org.mian.gitnex.notifications.NotificationsMaster;
|
||||
resTitle = R.string.crashTitle,
|
||||
resChannelName = R.string.setCrashReports,
|
||||
resText = R.string.crashMessage)
|
||||
@AcraCore(reportContent = { ANDROID_VERSION, PHONE_MODEL, STACK_TRACE })
|
||||
|
||||
public abstract class BaseActivity extends AppCompatActivity {
|
||||
|
||||
@ -133,11 +136,6 @@ public abstract class BaseActivity extends AppCompatActivity {
|
||||
tinyDb.putString("draftsCommentsDeletionEnabledInit", "yes");
|
||||
}
|
||||
|
||||
if(!tinyDb.getString("instanceUrlWithProtocol").endsWith("/")) {
|
||||
|
||||
tinyDb.putString("instanceUrlWithProtocol", tinyDb.getString("instanceUrlWithProtocol") + "/");
|
||||
}
|
||||
|
||||
if (tinyDb.getBoolean("crashReportingEnabled")) {
|
||||
|
||||
CoreConfigurationBuilder ACRABuilder = new CoreConfigurationBuilder(this);
|
||||
|
@ -94,8 +94,9 @@ public class CreateIssueActivity extends BaseActivity implements View.OnClickLis
|
||||
final String repoName = parts[1];
|
||||
final String instanceToken = "token " + tinyDb.getString(loginUid + "-token");
|
||||
|
||||
// if gitea is 1.12 or higher use the new limit
|
||||
// require gitea 1.12 or higher
|
||||
if(new Version(tinyDb.getString("giteaVersion")).higherOrEqual("1.12.0")) {
|
||||
|
||||
resultLimit = StaticGlobalVariables.resultLimitNewGiteaInstances;
|
||||
}
|
||||
|
||||
@ -199,9 +200,9 @@ public class CreateIssueActivity extends BaseActivity implements View.OnClickLis
|
||||
}
|
||||
|
||||
int[] integers;
|
||||
if (!newIssueLabelsIdHolderForm.equals("")) {
|
||||
if (!newIssueLabelsIdHolderForm.equals("") && !newIssueLabelsIdHolderForm.equals("[]")) {
|
||||
|
||||
String[] items = newIssueLabelsIdHolderForm.replaceAll("\\[", "").replaceAll("\\]", "").replaceAll("\\s", "").split(",");
|
||||
String[] items = newIssueLabelsIdHolderForm.replaceAll("\\[", "").replaceAll("]", "").replaceAll("\\s", "").split(",");
|
||||
integers = new int[items.length];
|
||||
for (int i = 0; i < integers.length; i++) {
|
||||
integers[i] = Integer.parseInt(items[i]);
|
||||
|
@ -0,0 +1,431 @@
|
||||
package org.mian.gitnex.activities;
|
||||
|
||||
import android.app.DatePickerDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.ImageView;
|
||||
import androidx.annotation.NonNull;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.adapters.LabelsListAdapter;
|
||||
import org.mian.gitnex.clients.RetrofitClient;
|
||||
import org.mian.gitnex.databinding.ActivityCreatePrBinding;
|
||||
import org.mian.gitnex.databinding.CustomLabelsSelectionDialogBinding;
|
||||
import org.mian.gitnex.helpers.AppUtil;
|
||||
import org.mian.gitnex.helpers.Authorization;
|
||||
import org.mian.gitnex.helpers.StaticGlobalVariables;
|
||||
import org.mian.gitnex.helpers.TinyDB;
|
||||
import org.mian.gitnex.helpers.Toasty;
|
||||
import org.mian.gitnex.helpers.Version;
|
||||
import org.mian.gitnex.models.Branches;
|
||||
import org.mian.gitnex.models.CreatePullRequest;
|
||||
import org.mian.gitnex.models.Labels;
|
||||
import org.mian.gitnex.models.Milestones;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
import okhttp3.ResponseBody;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
|
||||
/**
|
||||
* Author M M Arif
|
||||
*/
|
||||
|
||||
public class CreatePullRequestActivity extends BaseActivity implements LabelsListAdapter.LabelsListAdapterListener {
|
||||
|
||||
private View.OnClickListener onClickListener;
|
||||
private Context ctx = this;
|
||||
private Context appCtx;
|
||||
private TinyDB tinyDb;
|
||||
private ActivityCreatePrBinding viewBinding;
|
||||
private CustomLabelsSelectionDialogBinding labelsBinding;
|
||||
private int resultLimit = StaticGlobalVariables.resultLimitOldGiteaInstances;
|
||||
private Dialog dialogLabels;
|
||||
private String labelsSetter;
|
||||
private ArrayList<Integer> labelsIds = new ArrayList<>();
|
||||
private ArrayList<String> assignees = new ArrayList<>();
|
||||
private int milestoneId;
|
||||
|
||||
private String instanceUrl;
|
||||
private String loginUid;
|
||||
private String instanceToken;
|
||||
private String repoOwner;
|
||||
private String repoName;
|
||||
|
||||
private LabelsListAdapter labelsAdapter;
|
||||
|
||||
List<Milestones> milestonesList = new ArrayList<>();
|
||||
List<Branches> branchesList = new ArrayList<>();
|
||||
List<Labels> labelsList = new ArrayList<>();
|
||||
|
||||
public CreatePullRequestActivity() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutResourceId(){
|
||||
return R.layout.activity_create_pr;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
appCtx = getApplicationContext();
|
||||
tinyDb = new TinyDB(appCtx);
|
||||
|
||||
viewBinding = ActivityCreatePrBinding.inflate(getLayoutInflater());
|
||||
View view = viewBinding.getRoot();
|
||||
setContentView(view);
|
||||
|
||||
instanceUrl = tinyDb.getString("instanceUrl");
|
||||
loginUid = tinyDb.getString("loginUid");
|
||||
String repoFullName = tinyDb.getString("repoFullName");
|
||||
String[] parts = repoFullName.split("/");
|
||||
repoOwner = parts[0];
|
||||
repoName = parts[1];
|
||||
instanceToken = "token " + tinyDb.getString(loginUid + "-token");
|
||||
|
||||
// require gitea 1.12 or higher
|
||||
if(new Version(tinyDb.getString("giteaVersion")).higherOrEqual("1.12.0")) {
|
||||
resultLimit = StaticGlobalVariables.resultLimitNewGiteaInstances;
|
||||
}
|
||||
|
||||
labelsAdapter = new LabelsListAdapter(labelsList, CreatePullRequestActivity.this);
|
||||
|
||||
ImageView closeActivity = findViewById(R.id.close);
|
||||
|
||||
initCloseListener();
|
||||
closeActivity.setOnClickListener(onClickListener);
|
||||
|
||||
viewBinding.prDueDate.setOnClickListener(dueDate ->
|
||||
setDueDate()
|
||||
);
|
||||
|
||||
disableProcessButton();
|
||||
|
||||
getMilestones(instanceUrl, instanceToken, repoOwner, repoName, loginUid, resultLimit);
|
||||
getBranches(instanceUrl, instanceToken, repoOwner, repoName, loginUid);
|
||||
|
||||
viewBinding.prLabels.setOnClickListener(prLabels ->
|
||||
showLabels()
|
||||
);
|
||||
|
||||
viewBinding.createPr.setOnClickListener(createPr ->
|
||||
processPullRequest()
|
||||
);
|
||||
}
|
||||
|
||||
private void processPullRequest() {
|
||||
|
||||
String prTitle = String.valueOf(viewBinding.prTitle.getText());
|
||||
String prDescription = String.valueOf(viewBinding.prBody.getText());
|
||||
String mergeInto = viewBinding.mergeIntoBranchSpinner.getText().toString();
|
||||
String pullFrom = viewBinding.pullFromBranchSpinner.getText().toString();
|
||||
String dueDate = String.valueOf(viewBinding.prDueDate.getText());
|
||||
|
||||
assignees.add("");
|
||||
|
||||
if (labelsIds.size() == 0) {
|
||||
labelsIds.add(0);
|
||||
}
|
||||
|
||||
if (dueDate.matches("")) {
|
||||
dueDate = null;
|
||||
}
|
||||
else {
|
||||
dueDate = AppUtil.customDateCombine(AppUtil.customDateFormat(dueDate));
|
||||
}
|
||||
|
||||
if(prTitle.matches("")) {
|
||||
|
||||
Toasty.error(ctx, getString(R.string.titleError));
|
||||
}
|
||||
else if(mergeInto.matches("")) {
|
||||
|
||||
Toasty.error(ctx, getString(R.string.mergeIntoError));
|
||||
}
|
||||
else if(pullFrom.matches("")) {
|
||||
|
||||
Toasty.error(ctx, getString(R.string.pullFromError));
|
||||
}
|
||||
else if(pullFrom.equals(mergeInto)) {
|
||||
|
||||
Toasty.error(ctx, getString(R.string.sameBranchesError));
|
||||
}
|
||||
else {
|
||||
createPullRequest(prTitle, prDescription, mergeInto, pullFrom, milestoneId, dueDate, assignees);
|
||||
}
|
||||
//Log.e("processPullRequest", String.valueOf(milestoneId));
|
||||
}
|
||||
|
||||
private void createPullRequest(String prTitle, String prDescription, String mergeInto, String pullFrom, int milestoneId, String dueDate, ArrayList<String> assignees) {
|
||||
|
||||
CreatePullRequest createPullRequest = new CreatePullRequest(prTitle, prDescription, loginUid, mergeInto, pullFrom, milestoneId, dueDate, assignees, labelsIds);
|
||||
|
||||
Call<ResponseBody> transferCall = RetrofitClient
|
||||
.getInstance(instanceUrl, ctx)
|
||||
.getApiInterface()
|
||||
.createPullRequest(instanceToken, repoOwner, repoName, createPullRequest);
|
||||
|
||||
transferCall.enqueue(new Callback<ResponseBody>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(@NonNull Call<ResponseBody> call, @NonNull retrofit2.Response<ResponseBody> response) {
|
||||
|
||||
disableProcessButton();
|
||||
|
||||
if (response.code() == 201) {
|
||||
|
||||
Toasty.success(ctx, getString(R.string.prCreateSuccess));
|
||||
finish();
|
||||
}
|
||||
else if (response.code() == 409 && response.message().equals("Conflict")) {
|
||||
|
||||
enableProcessButton();
|
||||
Toasty.error(ctx, getString(R.string.prAlreadyExists));
|
||||
}
|
||||
else if (response.code() == 404) {
|
||||
|
||||
enableProcessButton();
|
||||
Toasty.error(ctx, getString(R.string.apiNotFound));
|
||||
}
|
||||
else {
|
||||
|
||||
enableProcessButton();
|
||||
Toasty.error(ctx, getString(R.string.genericError));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(@NonNull Call<ResponseBody> call, @NonNull Throwable t) {
|
||||
|
||||
enableProcessButton();
|
||||
Toasty.error(ctx, getString(R.string.genericServerResponseError));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void labelsStringData(ArrayList<String> data) {
|
||||
|
||||
labelsSetter = String.valueOf(data);
|
||||
viewBinding.prLabels.setText(labelsSetter.replace("]", "").replace("[", ""));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void labelsIdsData(ArrayList<Integer> data) {
|
||||
|
||||
labelsIds = data;
|
||||
}
|
||||
|
||||
private void showLabels() {
|
||||
|
||||
dialogLabels = new Dialog(ctx, R.style.ThemeOverlay_MaterialComponents_Dialog_Alert);
|
||||
|
||||
if (dialogLabels.getWindow() != null) {
|
||||
dialogLabels.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
}
|
||||
|
||||
labelsBinding = CustomLabelsSelectionDialogBinding.inflate(LayoutInflater.from(ctx));
|
||||
|
||||
View view = labelsBinding.getRoot();
|
||||
dialogLabels.setContentView(view);
|
||||
|
||||
labelsBinding.cancel.setOnClickListener(editProperties ->
|
||||
dialogLabels.dismiss()
|
||||
);
|
||||
|
||||
Call<List<Labels>> call = RetrofitClient
|
||||
.getInstance(instanceUrl, ctx)
|
||||
.getApiInterface()
|
||||
.getlabels(instanceToken, repoOwner, repoName);
|
||||
|
||||
call.enqueue(new Callback<List<Labels>>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(@NonNull Call<List<Labels>> call, @NonNull retrofit2.Response<List<Labels>> response) {
|
||||
|
||||
labelsList.clear();
|
||||
List<Labels> labelsList_ = response.body();
|
||||
|
||||
labelsBinding.progressBar.setVisibility(View.GONE);
|
||||
labelsBinding.dialogFrame.setVisibility(View.VISIBLE);
|
||||
|
||||
if (response.code() == 200) {
|
||||
|
||||
assert labelsList_ != null;
|
||||
if(labelsList_.size() > 0) {
|
||||
for (int i = 0; i < labelsList_.size(); i++) {
|
||||
|
||||
labelsList.add(new Labels(labelsList_.get(i).getId(), labelsList_.get(i).getName()));
|
||||
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
dialogLabels.dismiss();
|
||||
Toasty.warning(ctx, getString(R.string.noLabelsFound));
|
||||
}
|
||||
|
||||
labelsBinding.labelsRecyclerView.setAdapter(labelsAdapter);
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
Toasty.error(ctx, getString(R.string.genericError));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(@NonNull Call<List<Labels>> call, @NonNull Throwable t) {
|
||||
|
||||
Toasty.error(ctx, getString(R.string.genericServerResponseError));
|
||||
}
|
||||
});
|
||||
|
||||
dialogLabels.show();
|
||||
|
||||
}
|
||||
|
||||
private void getBranches(String instanceUrl, String instanceToken, String repoOwner, String repoName, String loginUid) {
|
||||
|
||||
Call<List<Branches>> call = RetrofitClient
|
||||
.getInstance(instanceUrl, ctx)
|
||||
.getApiInterface()
|
||||
.getBranches(Authorization.returnAuthentication(ctx, loginUid, instanceToken), repoOwner, repoName);
|
||||
|
||||
call.enqueue(new Callback<List<Branches>>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(@NonNull Call<List<Branches>> call, @NonNull retrofit2.Response<List<Branches>> response) {
|
||||
|
||||
if(response.isSuccessful()) {
|
||||
if(response.code() == 200) {
|
||||
|
||||
List<Branches> branchesList_ = response.body();
|
||||
|
||||
assert branchesList_ != null;
|
||||
if(branchesList_.size() > 0) {
|
||||
for (int i = 0; i < branchesList_.size(); i++) {
|
||||
|
||||
Branches data = new Branches(
|
||||
branchesList_.get(i).getName()
|
||||
);
|
||||
branchesList.add(data);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
ArrayAdapter<Branches> adapter = new ArrayAdapter<>(CreatePullRequestActivity.this,
|
||||
R.layout.list_spinner_items, branchesList);
|
||||
|
||||
viewBinding.mergeIntoBranchSpinner.setAdapter(adapter);
|
||||
viewBinding.pullFromBranchSpinner.setAdapter(adapter);
|
||||
enableProcessButton();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(@NonNull Call<List<Branches>> call, @NonNull Throwable t) {
|
||||
|
||||
Toasty.error(ctx, getString(R.string.genericServerResponseError));
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void getMilestones(String instanceUrl, String instanceToken, String repoOwner, String repoName, String loginUid, int resultLimit) {
|
||||
|
||||
String msState = "open";
|
||||
Call<List<Milestones>> call = RetrofitClient
|
||||
.getInstance(instanceUrl, ctx)
|
||||
.getApiInterface()
|
||||
.getMilestones(Authorization.returnAuthentication(ctx, loginUid, instanceToken), repoOwner, repoName, 1, resultLimit, msState);
|
||||
|
||||
call.enqueue(new Callback<List<Milestones>>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(@NonNull Call<List<Milestones>> call, @NonNull retrofit2.Response<List<Milestones>> response) {
|
||||
|
||||
if(response.code() == 200) {
|
||||
|
||||
List<Milestones> milestonesList_ = response.body();
|
||||
|
||||
milestonesList.add(new Milestones(0,getString(R.string.issueCreatedNoMilestone)));
|
||||
assert milestonesList_ != null;
|
||||
if(milestonesList_.size() > 0) {
|
||||
for (int i = 0; i < milestonesList_.size(); i++) {
|
||||
|
||||
//Don't translate "open" is a enum
|
||||
if(milestonesList_.get(i).getState().equals("open")) {
|
||||
Milestones data = new Milestones(
|
||||
milestonesList_.get(i).getId(),
|
||||
milestonesList_.get(i).getTitle()
|
||||
);
|
||||
milestonesList.add(data);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
ArrayAdapter<Milestones> adapter = new ArrayAdapter<>(CreatePullRequestActivity.this,
|
||||
R.layout.list_spinner_items, milestonesList);
|
||||
|
||||
viewBinding.milestonesSpinner.setAdapter(adapter);
|
||||
enableProcessButton();
|
||||
|
||||
viewBinding.milestonesSpinner.setOnItemClickListener ((parent, view, position, id) ->
|
||||
|
||||
milestoneId = milestonesList.get(position).getId()
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(@NonNull Call<List<Milestones>> call, @NonNull Throwable t) {
|
||||
|
||||
Toasty.error(ctx, getString(R.string.genericServerResponseError));
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void setDueDate() {
|
||||
|
||||
final Calendar c = Calendar.getInstance();
|
||||
int mYear = c.get(Calendar.YEAR);
|
||||
final int mMonth = c.get(Calendar.MONTH);
|
||||
final int mDay = c.get(Calendar.DAY_OF_MONTH);
|
||||
|
||||
DatePickerDialog datePickerDialog = new DatePickerDialog(this,
|
||||
(view, year, monthOfYear, dayOfMonth) -> viewBinding.prDueDate.setText(getString(R.string.setDueDate, year, (monthOfYear + 1), dayOfMonth)), mYear, mMonth, mDay);
|
||||
datePickerDialog.show();
|
||||
}
|
||||
|
||||
private void initCloseListener() {
|
||||
|
||||
onClickListener = view -> finish();
|
||||
}
|
||||
|
||||
private void disableProcessButton() {
|
||||
|
||||
viewBinding.createPr.setEnabled(false);
|
||||
}
|
||||
|
||||
private void enableProcessButton() {
|
||||
|
||||
viewBinding.createPr.setEnabled(true);
|
||||
}
|
||||
}
|
@ -104,6 +104,7 @@ public class IssueDetailActivity extends BaseActivity {
|
||||
private LinearLayout assigneesLayout;
|
||||
private View divider;
|
||||
private ProgressBar progressBar;
|
||||
private ImageView issuePrState;
|
||||
|
||||
@Override
|
||||
protected int getLayoutResourceId() {
|
||||
@ -145,6 +146,7 @@ public class IssueDetailActivity extends BaseActivity {
|
||||
assigneesLayout = findViewById(R.id.frameAssignees);
|
||||
divider = findViewById(R.id.divider);
|
||||
progressBar = findViewById(R.id.progressBar);
|
||||
issuePrState = findViewById(R.id.issuePrState);
|
||||
|
||||
Toolbar toolbar = findViewById(R.id.toolbar);
|
||||
TextView toolbarTitle = toolbar.findViewById(R.id.toolbar_title);
|
||||
@ -351,6 +353,27 @@ public class IssueDetailActivity extends BaseActivity {
|
||||
Issues singleIssue = response.body();
|
||||
assert singleIssue != null;
|
||||
|
||||
issuePrState.setVisibility(View.VISIBLE);
|
||||
if(singleIssue.getPull_request() != null) {
|
||||
|
||||
if(singleIssue.getPull_request().isMerged()) { // merged
|
||||
|
||||
issuePrState.setImageResource(R.drawable.ic_pull_request_merged);
|
||||
}
|
||||
else if(!singleIssue.getPull_request().isMerged() && singleIssue.getState().equals("closed")) { // closed
|
||||
|
||||
issuePrState.setImageResource(R.drawable.ic_pull_request_closed);
|
||||
}
|
||||
else { // open
|
||||
|
||||
issuePrState.setImageResource(R.drawable.ic_pull_request);
|
||||
}
|
||||
}
|
||||
else if(singleIssue.getState().equals("closed")) { // issue closed
|
||||
|
||||
issuePrState.setImageResource(R.drawable.ic_issue_closed_red);
|
||||
}
|
||||
|
||||
final Markwon markwon = Markwon.builder(Objects.requireNonNull(ctx)).usePlugin(CorePlugin.create())
|
||||
.usePlugin(ImagesPlugin.create(plugin -> {
|
||||
plugin.addSchemeHandler(new SchemeHandler() {
|
||||
|
@ -167,16 +167,12 @@ public class LoginActivity extends BaseActivity {
|
||||
|
||||
URI rawInstanceUrl = UrlBuilder.fromString(UrlHelper.fixScheme(instanceUrlET.getText().toString(), "http")).toUri();
|
||||
|
||||
URI instanceUrlWithProtocol = UrlBuilder.fromUri(rawInstanceUrl).withPath(PathsHelper.join(rawInstanceUrl.getPath()))
|
||||
.withScheme(protocol.name().toLowerCase()).toUri();
|
||||
|
||||
URI instanceUrl = UrlBuilder.fromUri(instanceUrlWithProtocol).withPath(PathsHelper.join(instanceUrlWithProtocol.getPath(), "/api/v1/"))
|
||||
URI instanceUrl = UrlBuilder.fromUri(rawInstanceUrl).withScheme(protocol.name().toLowerCase()).withPath(PathsHelper.join(rawInstanceUrl.getPath(), "/api/v1/"))
|
||||
.toUri();
|
||||
|
||||
tinyDB.putString("loginType", loginType.name().toLowerCase());
|
||||
tinyDB.putString("instanceUrlRaw", instanceUrlET.getText().toString());
|
||||
tinyDB.putString("instanceUrl", instanceUrl.toString());
|
||||
tinyDB.putString("instanceUrlWithProtocol", instanceUrlWithProtocol.toString());
|
||||
|
||||
if(instanceUrlET.getText().toString().equals("")) {
|
||||
|
||||
@ -256,7 +252,7 @@ public class LoginActivity extends BaseActivity {
|
||||
|
||||
if(!loginToken.equals("")) {
|
||||
|
||||
callVersion = RetrofitClient.getInstance(instanceUrl, ctx).getApiInterface().getGiteaVersionWithToken(loginToken);
|
||||
callVersion = RetrofitClient.getInstance(instanceUrl, ctx).getApiInterface().getGiteaVersionWithToken("token " + loginToken);
|
||||
}
|
||||
else {
|
||||
|
||||
@ -276,20 +272,17 @@ public class LoginActivity extends BaseActivity {
|
||||
if(responseVersion.code() == 200) {
|
||||
|
||||
GiteaVersion version = responseVersion.body();
|
||||
Version gitea_version;
|
||||
|
||||
assert version != null;
|
||||
|
||||
try {
|
||||
gitea_version = new Version(version.getVersion());
|
||||
}
|
||||
catch(Exception e) {
|
||||
|
||||
if(!Version.valid(version.getVersion())) {
|
||||
Toasty.error(ctx, getResources().getString(R.string.versionUnknown));
|
||||
enableProcessButton();
|
||||
return;
|
||||
}
|
||||
|
||||
tinyDB.putString("giteaVersion", version.getVersion());
|
||||
Version gitea_version = new Version(version.getVersion());
|
||||
|
||||
if(gitea_version.less(getString(R.string.versionLow))) {
|
||||
|
||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(ctx).setTitle(getString(R.string.versionAlertDialogHeader))
|
||||
@ -570,7 +563,8 @@ public class LoginActivity extends BaseActivity {
|
||||
|
||||
if(checkAccount == 0) {
|
||||
|
||||
accountId = userAccountsApi.insertNewAccount(accountName, instanceUrl, userDetails.getUsername(), newToken.getSha1(), "");
|
||||
accountId = userAccountsApi
|
||||
.insertNewAccount(accountName, instanceUrl, userDetails.getUsername(), newToken.getSha1(), "");
|
||||
tinyDB.putInt("currentActiveAccountId", (int) accountId);
|
||||
}
|
||||
else {
|
||||
|
@ -1,15 +1,14 @@
|
||||
package org.mian.gitnex.activities;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.Typeface;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@ -32,11 +31,10 @@ import org.mian.gitnex.clients.PicassoService;
|
||||
import org.mian.gitnex.clients.RetrofitClient;
|
||||
import org.mian.gitnex.database.api.UserAccountsApi;
|
||||
import org.mian.gitnex.database.models.UserAccount;
|
||||
import org.mian.gitnex.fragments.AboutFragment;
|
||||
import org.mian.gitnex.fragments.AdministrationFragment;
|
||||
import org.mian.gitnex.fragments.BottomSheetDraftsFragment;
|
||||
import org.mian.gitnex.fragments.DraftsFragment;
|
||||
import org.mian.gitnex.fragments.ExploreRepositoriesFragment;
|
||||
import org.mian.gitnex.fragments.ExploreFragment;
|
||||
import org.mian.gitnex.fragments.MyRepositoriesFragment;
|
||||
import org.mian.gitnex.fragments.NotificationsFragment;
|
||||
import org.mian.gitnex.fragments.OrganizationsFragment;
|
||||
@ -55,6 +53,7 @@ import org.mian.gitnex.helpers.TinyDB;
|
||||
import org.mian.gitnex.helpers.Toasty;
|
||||
import org.mian.gitnex.helpers.Version;
|
||||
import org.mian.gitnex.models.GiteaVersion;
|
||||
import org.mian.gitnex.models.NotificationCount;
|
||||
import org.mian.gitnex.models.UserInfo;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -82,6 +81,14 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
|
||||
private Context appCtx;
|
||||
private Typeface myTypeface;
|
||||
|
||||
private String instanceUrl;
|
||||
private String loginUid;
|
||||
private String instanceToken;
|
||||
|
||||
private View hView;
|
||||
private MenuItem navNotifications;
|
||||
private TextView notificationCounter;
|
||||
|
||||
@Override
|
||||
protected int getLayoutResourceId() {
|
||||
|
||||
@ -100,9 +107,9 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
|
||||
Intent mainIntent = getIntent();
|
||||
String launchFragment = mainIntent.getStringExtra("launchFragment");
|
||||
|
||||
final String instanceUrl = tinyDb.getString("instanceUrl");
|
||||
final String loginUid = tinyDb.getString("loginUid");
|
||||
final String instanceToken = "token " + tinyDb.getString(loginUid + "-token");
|
||||
instanceUrl = tinyDb.getString("instanceUrl");
|
||||
loginUid = tinyDb.getString("loginUid");
|
||||
instanceToken = "token " + tinyDb.getString(loginUid + "-token");
|
||||
|
||||
if(tinyDb.getString("dateFormat").isEmpty()) {
|
||||
tinyDb.putString("dateFormat", "pretty");
|
||||
@ -169,7 +176,7 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
|
||||
else if(fragmentById instanceof OrganizationsFragment) {
|
||||
toolbarTitle.setText(getResources().getString(R.string.pageTitleOrganizations));
|
||||
}
|
||||
else if(fragmentById instanceof ExploreRepositoriesFragment) {
|
||||
else if(fragmentById instanceof ExploreFragment) {
|
||||
toolbarTitle.setText(getResources().getString(R.string.pageTitleExplore));
|
||||
}
|
||||
else if(fragmentById instanceof NotificationsFragment) {
|
||||
@ -178,9 +185,6 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
|
||||
else if(fragmentById instanceof ProfileFragment) {
|
||||
toolbarTitle.setText(getResources().getString(R.string.pageTitleProfile));
|
||||
}
|
||||
else if(fragmentById instanceof AboutFragment) {
|
||||
toolbarTitle.setText(getResources().getString(R.string.pageTitleAbout));
|
||||
}
|
||||
else if(fragmentById instanceof DraftsFragment) {
|
||||
toolbarTitle.setText(getResources().getString(R.string.titleDrafts));
|
||||
}
|
||||
@ -191,10 +195,15 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
|
||||
toolbarTitle.setText(getResources().getString(R.string.pageTitleUserAccounts));
|
||||
}
|
||||
|
||||
getNotificationsCount(instanceUrl, instanceToken);
|
||||
|
||||
drawer = findViewById(R.id.drawer_layout);
|
||||
NavigationView navigationView = findViewById(R.id.nav_view);
|
||||
navigationView.setNavigationItemSelectedListener(this);
|
||||
final View hView = navigationView.getHeaderView(0);
|
||||
hView = navigationView.getHeaderView(0);
|
||||
|
||||
Menu menu = navigationView.getMenu();
|
||||
navNotifications = menu.findItem(R.id.nav_notifications);
|
||||
|
||||
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
|
||||
|
||||
@ -204,6 +213,7 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
|
||||
@Override
|
||||
public void onDrawerOpened(@NonNull View drawerView) {
|
||||
|
||||
getNotificationsCount(instanceUrl, instanceToken);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -295,6 +305,7 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
|
||||
|
||||
toolbarTitle.setText(getResources().getString(R.string.pageTitleProfile));
|
||||
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new ProfileFragment()).commit();
|
||||
navigationView.setCheckedItem(R.id.nav_profile);
|
||||
drawer.closeDrawers();
|
||||
});
|
||||
|
||||
@ -374,7 +385,7 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
|
||||
|
||||
case 5:
|
||||
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 ExploreFragment()).commit();
|
||||
navigationView.setCheckedItem(R.id.nav_explore);
|
||||
break;
|
||||
|
||||
@ -439,6 +450,11 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
|
||||
}
|
||||
}
|
||||
|
||||
public void setActionBarTitle(String title) {
|
||||
|
||||
toolbarTitle.setText(title);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onButtonClicked(String text) {
|
||||
|
||||
@ -528,15 +544,6 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
|
||||
overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
|
||||
break;
|
||||
|
||||
case R.id.nav_about:
|
||||
toolbarTitle.setText(getResources().getString(R.string.pageTitleAbout));
|
||||
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new AboutFragment()).commit();
|
||||
break;
|
||||
|
||||
case R.id.nav_rate_app:
|
||||
rateThisApp();
|
||||
break;
|
||||
|
||||
case R.id.nav_starred_repos:
|
||||
toolbarTitle.setText(getResources().getString(R.string.pageTitleStarredRepos));
|
||||
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new StarredRepositoriesFragment()).commit();
|
||||
@ -544,7 +551,7 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
|
||||
|
||||
case R.id.nav_explore:
|
||||
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 ExploreFragment()).commit();
|
||||
break;
|
||||
|
||||
case R.id.nav_notifications:
|
||||
@ -568,16 +575,6 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
|
||||
return true;
|
||||
}
|
||||
|
||||
public void rateThisApp() {
|
||||
|
||||
try {
|
||||
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + getPackageName())));
|
||||
}
|
||||
catch(ActivityNotFoundException e) {
|
||||
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + getPackageName())));
|
||||
}
|
||||
}
|
||||
|
||||
public static void logout(Activity activity, Context ctx) {
|
||||
|
||||
TinyDB tinyDb = new TinyDB(ctx.getApplicationContext());
|
||||
@ -705,4 +702,31 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
|
||||
|
||||
}
|
||||
|
||||
private void getNotificationsCount(String instanceUrl, String token) {
|
||||
|
||||
Call<NotificationCount> call = RetrofitClient.getInstance(instanceUrl, ctx).getApiInterface().checkUnreadNotifications(token);
|
||||
|
||||
call.enqueue(new Callback<NotificationCount>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(@NonNull Call<NotificationCount> call, @NonNull retrofit2.Response<NotificationCount> response) {
|
||||
|
||||
NotificationCount notificationCount = response.body();
|
||||
|
||||
if(response.code() == 200) {
|
||||
|
||||
assert notificationCount != null;
|
||||
notificationCounter = navNotifications.getActionView().findViewById(R.id.counterBadgeNotification);
|
||||
notificationCounter.setText(String.valueOf(notificationCount.getCounter()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(@NonNull Call<NotificationCount> call, @NonNull Throwable t) {
|
||||
|
||||
Log.e("onFailure-notification", t.toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -104,7 +104,12 @@ public class ReplyToIssueActivity extends BaseActivity {
|
||||
}
|
||||
else {
|
||||
|
||||
draftIdOnCreate = returnDraftId();
|
||||
if(getIntent().getStringExtra("commentBody") != null) {
|
||||
draftIdOnCreate = returnDraftId(getIntent().getStringExtra("commentBody"));
|
||||
}
|
||||
else {
|
||||
draftIdOnCreate = returnDraftId("");
|
||||
}
|
||||
}
|
||||
|
||||
replyButton = findViewById(R.id.replyButton);
|
||||
@ -216,7 +221,7 @@ public class ReplyToIssueActivity extends BaseActivity {
|
||||
|
||||
}
|
||||
|
||||
private long returnDraftId() {
|
||||
private long returnDraftId(String draftText) {
|
||||
|
||||
TinyDB tinyDb = new TinyDB(getApplicationContext());
|
||||
|
||||
@ -226,7 +231,7 @@ public class ReplyToIssueActivity extends BaseActivity {
|
||||
|
||||
DraftsApi draftsApi = new DraftsApi(appCtx);
|
||||
|
||||
return draftsApi.insertDraft(repositoryId, currentActiveAccountId, issueNumber, "", StaticGlobalVariables.draftTypeComment, "");
|
||||
return draftsApi.insertDraft(repositoryId, currentActiveAccountId, issueNumber, draftText, StaticGlobalVariables.draftTypeComment, "");
|
||||
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,6 @@ import org.mian.gitnex.fragments.BottomSheetIssuesFilterFragment;
|
||||
import org.mian.gitnex.fragments.BottomSheetMilestonesFilterFragment;
|
||||
import org.mian.gitnex.fragments.BottomSheetPullRequestFilterFragment;
|
||||
import org.mian.gitnex.fragments.BottomSheetRepoFragment;
|
||||
import org.mian.gitnex.fragments.BranchesFragment;
|
||||
import org.mian.gitnex.fragments.CollaboratorsFragment;
|
||||
import org.mian.gitnex.fragments.FilesFragment;
|
||||
import org.mian.gitnex.fragments.IssuesFragment;
|
||||
@ -163,7 +162,7 @@ public class RepoDetailActivity extends BaseActivity implements BottomSheetRepoF
|
||||
}
|
||||
|
||||
// Only show collaborators tab, if you have permission to
|
||||
View collaboratorTab = viewGroup.getChildAt(8);
|
||||
View collaboratorTab = viewGroup.getChildAt(7);
|
||||
|
||||
if(tinyDB.getBoolean("isRepoAdmin") || new Version(tinyDB.getString("giteaVersion")).higherOrEqual("1.12.0")) {
|
||||
|
||||
@ -229,8 +228,8 @@ public class RepoDetailActivity extends BaseActivity implements BottomSheetRepoF
|
||||
|
||||
if(textViewBadgeRelease.getText() != "") { // only show if API returned a number
|
||||
|
||||
Objects.requireNonNull(tabLayout.getTabAt(5)).setCustomView(tabHeader6);
|
||||
TabLayout.Tab tabOpenRelease = tabLayout.getTabAt(5);
|
||||
Objects.requireNonNull(tabLayout.getTabAt(4)).setCustomView(tabHeader6);
|
||||
TabLayout.Tab tabOpenRelease = tabLayout.getTabAt(4);
|
||||
assert tabOpenRelease != null; // FIXME This should be cleaned up
|
||||
TextView openReleaseTabView = Objects.requireNonNull(tabOpenRelease.getCustomView()).findViewById(R.id.counterBadgeReleaseText);
|
||||
openReleaseTabView.setTextColor(textColor);
|
||||
@ -300,6 +299,12 @@ public class RepoDetailActivity extends BaseActivity implements BottomSheetRepoF
|
||||
chooseBranch();
|
||||
return true;
|
||||
|
||||
case R.id.branchCommits:
|
||||
Intent intent = new Intent(ctx, CommitsActivity.class);
|
||||
intent.putExtra("branchName", tinyDB.getString("repoBranch"));
|
||||
ctx.startActivity(intent);
|
||||
return true;
|
||||
|
||||
default:
|
||||
return super.onOptionsItemSelected(item);
|
||||
|
||||
@ -397,6 +402,14 @@ public class RepoDetailActivity extends BaseActivity implements BottomSheetRepoF
|
||||
}
|
||||
break;
|
||||
|
||||
case "repoSettings":
|
||||
startActivity(new Intent(RepoDetailActivity.this, RepositorySettingsActivity.class));
|
||||
break;
|
||||
|
||||
case "newPullRequest":
|
||||
startActivity(new Intent(RepoDetailActivity.this, CreatePullRequestActivity.class));
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -490,20 +503,17 @@ public class RepoDetailActivity extends BaseActivity implements BottomSheetRepoF
|
||||
fragment = new PullRequestsFragment();
|
||||
break;
|
||||
|
||||
case 4: // Branches
|
||||
return BranchesFragment.newInstance(repositoryOwner, repositoryName);
|
||||
|
||||
case 5: // Releases
|
||||
case 4: // Releases
|
||||
return ReleasesFragment.newInstance(repositoryOwner, repositoryName);
|
||||
|
||||
case 6: // Milestones
|
||||
case 5: // Milestones
|
||||
fragment = new MilestonesFragment();
|
||||
break;
|
||||
|
||||
case 7: // Labels
|
||||
case 6: // Labels
|
||||
return LabelsFragment.newInstance(repositoryOwner, repositoryName);
|
||||
|
||||
case 8: // Collaborators
|
||||
case 7: // Collaborators
|
||||
return CollaboratorsFragment.newInstance(repositoryOwner, repositoryName);
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,435 @@
|
||||
package org.mian.gitnex.activities;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import androidx.annotation.NonNull;
|
||||
import com.google.gson.JsonElement;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.clients.RetrofitClient;
|
||||
import org.mian.gitnex.database.api.RepositoriesApi;
|
||||
import org.mian.gitnex.databinding.ActivityRepositorySettingsBinding;
|
||||
import org.mian.gitnex.databinding.CustomRepositoryDeleteDialogBinding;
|
||||
import org.mian.gitnex.databinding.CustomRepositoryEditPropertiesDialogBinding;
|
||||
import org.mian.gitnex.databinding.CustomRepositoryTransferDialogBinding;
|
||||
import org.mian.gitnex.helpers.TinyDB;
|
||||
import org.mian.gitnex.helpers.Toasty;
|
||||
import org.mian.gitnex.helpers.Version;
|
||||
import org.mian.gitnex.models.RepositoryTransfer;
|
||||
import org.mian.gitnex.models.UserRepositories;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
|
||||
/**
|
||||
* Author M M Arif
|
||||
*/
|
||||
|
||||
public class RepositorySettingsActivity extends BaseActivity {
|
||||
|
||||
private ActivityRepositorySettingsBinding viewBinding;
|
||||
private CustomRepositoryEditPropertiesDialogBinding propBinding;
|
||||
private CustomRepositoryDeleteDialogBinding deleteRepoBinding;
|
||||
private CustomRepositoryTransferDialogBinding transferRepoBinding;
|
||||
private Dialog dialogProp;
|
||||
private Dialog dialogDeleteRepository;
|
||||
private Dialog dialogTransferRepository;
|
||||
private View.OnClickListener onClickListener;
|
||||
private Context ctx = this;
|
||||
private Context appCtx;
|
||||
private TinyDB tinyDb;
|
||||
|
||||
private String instanceUrl;
|
||||
private String loginUid;
|
||||
private String instanceToken;
|
||||
|
||||
private String repositoryOwner;
|
||||
private String repositoryName;
|
||||
|
||||
@Override
|
||||
protected int getLayoutResourceId(){
|
||||
return R.layout.activity_repository_settings;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
appCtx = getApplicationContext();
|
||||
tinyDb = new TinyDB(appCtx);
|
||||
|
||||
viewBinding = ActivityRepositorySettingsBinding.inflate(getLayoutInflater());
|
||||
View view = viewBinding.getRoot();
|
||||
setContentView(view);
|
||||
|
||||
instanceUrl = tinyDb.getString("instanceUrl");
|
||||
loginUid = tinyDb.getString("loginUid");
|
||||
String repoFullName = tinyDb.getString("repoFullName");
|
||||
String[] parts = repoFullName.split("/");
|
||||
repositoryOwner = parts[0];
|
||||
repositoryName = parts[1];
|
||||
instanceToken = "token " + tinyDb.getString(loginUid + "-token");
|
||||
|
||||
ImageView closeActivity = findViewById(R.id.close);
|
||||
|
||||
initCloseListener();
|
||||
closeActivity.setOnClickListener(onClickListener);
|
||||
|
||||
// require gitea 1.12 or higher
|
||||
if(new Version(tinyDb.getString("giteaVersion")).higherOrEqual("1.12.0")) {
|
||||
|
||||
viewBinding.transferOwnerFrame.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
viewBinding.editProperties.setOnClickListener(editProperties -> {
|
||||
showRepositoryProperties();
|
||||
});
|
||||
|
||||
viewBinding.deleteRepository.setOnClickListener(deleteRepository -> {
|
||||
showDeleteRepository();
|
||||
});
|
||||
|
||||
viewBinding.transferOwnerFrame.setOnClickListener(transferRepositoryOwnership -> {
|
||||
showTransferRepository();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void showTransferRepository() {
|
||||
|
||||
dialogTransferRepository = new Dialog(ctx, R.style.ThemeOverlay_MaterialComponents_Dialog_Alert);
|
||||
|
||||
if (dialogTransferRepository.getWindow() != null) {
|
||||
|
||||
dialogTransferRepository.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
}
|
||||
|
||||
transferRepoBinding = CustomRepositoryTransferDialogBinding.inflate(LayoutInflater.from(ctx));
|
||||
|
||||
View view = transferRepoBinding.getRoot();
|
||||
dialogTransferRepository.setContentView(view);
|
||||
|
||||
transferRepoBinding.cancel.setOnClickListener(editProperties -> {
|
||||
dialogTransferRepository.dismiss();
|
||||
});
|
||||
|
||||
transferRepoBinding.transfer.setOnClickListener(deleteRepo -> {
|
||||
|
||||
String newOwner = String.valueOf(transferRepoBinding.ownerNameForTransfer.getText());
|
||||
String repoName = String.valueOf(transferRepoBinding.repoNameForTransfer.getText());
|
||||
|
||||
if(!repositoryName.equals(repoName)) {
|
||||
|
||||
Toasty.error(ctx, getString(R.string.repoSettingsDeleteError));
|
||||
}
|
||||
else if(newOwner.matches("")) {
|
||||
|
||||
Toasty.error(ctx, getString(R.string.repoTransferOwnerError));
|
||||
}
|
||||
else {
|
||||
|
||||
transferRepository(newOwner);
|
||||
}
|
||||
});
|
||||
|
||||
dialogTransferRepository.show();
|
||||
}
|
||||
|
||||
private void transferRepository(String newOwner) {
|
||||
|
||||
RepositoryTransfer repositoryTransfer = new RepositoryTransfer(newOwner);
|
||||
|
||||
Call<JsonElement> transferCall = RetrofitClient
|
||||
.getInstance(instanceUrl, ctx)
|
||||
.getApiInterface()
|
||||
.transferRepository(instanceToken, repositoryOwner, repositoryName, repositoryTransfer);
|
||||
|
||||
transferCall.enqueue(new Callback<JsonElement>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(@NonNull Call<JsonElement> call, @NonNull retrofit2.Response<JsonElement> response) {
|
||||
|
||||
transferRepoBinding.transfer.setVisibility(View.GONE);
|
||||
transferRepoBinding.processingRequest.setVisibility(View.VISIBLE);
|
||||
|
||||
if (response.code() == 202) {
|
||||
|
||||
dialogTransferRepository.dismiss();
|
||||
Toasty.success(ctx, getString(R.string.repoTransferSuccess));
|
||||
|
||||
finish();
|
||||
RepositoriesApi.deleteRepository((int) tinyDb.getLong("repositoryId", 0));
|
||||
Intent intent = new Intent(RepositorySettingsActivity.this, MainActivity.class);
|
||||
RepositorySettingsActivity.this.startActivity(intent);
|
||||
}
|
||||
else if (response.code() == 404) {
|
||||
|
||||
transferRepoBinding.transfer.setVisibility(View.VISIBLE);
|
||||
transferRepoBinding.processingRequest.setVisibility(View.GONE);
|
||||
Toasty.error(ctx, getString(R.string.repoTransferError));
|
||||
}
|
||||
else {
|
||||
|
||||
transferRepoBinding.transfer.setVisibility(View.VISIBLE);
|
||||
transferRepoBinding.processingRequest.setVisibility(View.GONE);
|
||||
Toasty.error(ctx, getString(R.string.genericError));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(@NonNull Call<JsonElement> call, @NonNull Throwable t) {
|
||||
|
||||
transferRepoBinding.transfer.setVisibility(View.VISIBLE);
|
||||
transferRepoBinding.processingRequest.setVisibility(View.GONE);
|
||||
Toasty.error(ctx, getString(R.string.genericServerResponseError));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void showDeleteRepository() {
|
||||
|
||||
dialogDeleteRepository = new Dialog(ctx, R.style.ThemeOverlay_MaterialComponents_Dialog_Alert);
|
||||
|
||||
if (dialogDeleteRepository.getWindow() != null) {
|
||||
dialogDeleteRepository.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
}
|
||||
|
||||
deleteRepoBinding = CustomRepositoryDeleteDialogBinding.inflate(LayoutInflater.from(ctx));
|
||||
|
||||
View view = deleteRepoBinding.getRoot();
|
||||
dialogDeleteRepository.setContentView(view);
|
||||
|
||||
deleteRepoBinding.cancel.setOnClickListener(editProperties -> {
|
||||
dialogDeleteRepository.dismiss();
|
||||
});
|
||||
|
||||
deleteRepoBinding.delete.setOnClickListener(deleteRepo -> {
|
||||
|
||||
if(!repositoryName.equals(String.valueOf(deleteRepoBinding.repoNameForDeletion.getText()))) {
|
||||
|
||||
Toasty.error(ctx, getString(R.string.repoSettingsDeleteError));
|
||||
}
|
||||
else {
|
||||
|
||||
deleteRepository();
|
||||
}
|
||||
});
|
||||
|
||||
dialogDeleteRepository.show();
|
||||
}
|
||||
|
||||
private void deleteRepository() {
|
||||
|
||||
Call<JsonElement> deleteCall = RetrofitClient
|
||||
.getInstance(instanceUrl, ctx)
|
||||
.getApiInterface()
|
||||
.deleteRepository(instanceToken, repositoryOwner, repositoryName);
|
||||
|
||||
deleteCall.enqueue(new Callback<JsonElement>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(@NonNull Call<JsonElement> call, @NonNull retrofit2.Response<JsonElement> response) {
|
||||
|
||||
deleteRepoBinding.delete.setVisibility(View.GONE);
|
||||
deleteRepoBinding.processingRequest.setVisibility(View.VISIBLE);
|
||||
|
||||
if (response.code() == 204) {
|
||||
|
||||
dialogDeleteRepository.dismiss();
|
||||
Toasty.success(ctx, getString(R.string.repoDeletionSuccess));
|
||||
|
||||
finish();
|
||||
RepositoriesApi.deleteRepository((int) tinyDb.getLong("repositoryId", 0));
|
||||
Intent intent = new Intent(RepositorySettingsActivity.this, MainActivity.class);
|
||||
RepositorySettingsActivity.this.startActivity(intent);
|
||||
}
|
||||
else {
|
||||
|
||||
deleteRepoBinding.delete.setVisibility(View.VISIBLE);
|
||||
deleteRepoBinding.processingRequest.setVisibility(View.GONE);
|
||||
Toasty.error(ctx, getString(R.string.genericError));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(@NonNull Call<JsonElement> call, @NonNull Throwable t) {
|
||||
|
||||
deleteRepoBinding.delete.setVisibility(View.VISIBLE);
|
||||
deleteRepoBinding.processingRequest.setVisibility(View.GONE);
|
||||
Toasty.error(ctx, getString(R.string.genericServerResponseError));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void showRepositoryProperties() {
|
||||
|
||||
dialogProp = new Dialog(ctx, R.style.ThemeOverlay_MaterialComponents_Dialog_Alert);
|
||||
|
||||
if (dialogProp.getWindow() != null) {
|
||||
dialogProp.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
}
|
||||
|
||||
propBinding = CustomRepositoryEditPropertiesDialogBinding.inflate(LayoutInflater.from(ctx));
|
||||
|
||||
View view = propBinding.getRoot();
|
||||
dialogProp.setContentView(view);
|
||||
|
||||
propBinding.cancel.setOnClickListener(editProperties -> {
|
||||
dialogProp.dismiss();
|
||||
});
|
||||
|
||||
Call<UserRepositories> call = RetrofitClient
|
||||
.getInstance(instanceUrl, ctx)
|
||||
.getApiInterface()
|
||||
.getUserRepository(instanceToken, repositoryOwner, repositoryName);
|
||||
|
||||
call.enqueue(new Callback<UserRepositories>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(@NonNull Call<UserRepositories> call, @NonNull retrofit2.Response<UserRepositories> response) {
|
||||
|
||||
UserRepositories repoInfo = response.body();
|
||||
|
||||
propBinding.progressBar.setVisibility(View.GONE);
|
||||
propBinding.mainView.setVisibility(View.VISIBLE);
|
||||
|
||||
if (response.code() == 200) {
|
||||
|
||||
assert repoInfo != null;
|
||||
propBinding.repoName.setText(repoInfo.getName());
|
||||
propBinding.repoWebsite.setText(repoInfo.getWebsite());
|
||||
propBinding.repoDescription.setText(repoInfo.getDescription());
|
||||
propBinding.repoPrivate.setChecked(repoInfo.getPrivateFlag());
|
||||
propBinding.repoAsTemplate.setChecked(repoInfo.isTemplate());
|
||||
|
||||
propBinding.repoEnableIssues.setChecked(repoInfo.getHas_issues());
|
||||
|
||||
propBinding.repoEnableIssues.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
||||
|
||||
if (isChecked) {
|
||||
propBinding.repoEnableTimer.setVisibility(View.VISIBLE);
|
||||
}
|
||||
else {
|
||||
propBinding.repoEnableTimer.setVisibility(View.GONE);
|
||||
}
|
||||
});
|
||||
|
||||
if(repoInfo.getInternal_tracker() != null) {
|
||||
propBinding.repoEnableTimer.setChecked(repoInfo.getInternal_tracker().isEnable_time_tracker());
|
||||
}
|
||||
else {
|
||||
propBinding.repoEnableTimer.setVisibility(View.GONE);
|
||||
}
|
||||
propBinding.repoEnableWiki.setChecked(repoInfo.isHas_wiki());
|
||||
propBinding.repoEnablePr.setChecked(repoInfo.isHas_pull_requests());
|
||||
propBinding.repoEnableMerge.setChecked(repoInfo.isAllow_merge_commits());
|
||||
propBinding.repoEnableRebase.setChecked(repoInfo.isAllow_rebase());
|
||||
propBinding.repoEnableSquash.setChecked(repoInfo.isAllow_squash_merge());
|
||||
propBinding.repoEnableForceMerge.setChecked(repoInfo.isAllow_rebase_explicit());
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
Toasty.error(ctx, getString(R.string.genericError));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(@NonNull Call<UserRepositories> call, @NonNull Throwable t) {
|
||||
|
||||
Toasty.error(ctx, getString(R.string.genericServerResponseError));
|
||||
}
|
||||
});
|
||||
|
||||
propBinding.save.setOnClickListener(saveProperties -> saveRepositoryProperties(String.valueOf(propBinding.repoName.getText()),
|
||||
String.valueOf(propBinding.repoWebsite.getText()),
|
||||
String.valueOf(propBinding.repoDescription.getText()),
|
||||
propBinding.repoPrivate.isChecked(), propBinding.repoAsTemplate.isChecked(),
|
||||
propBinding.repoEnableIssues.isChecked(), propBinding.repoEnableWiki.isChecked(),
|
||||
propBinding.repoEnablePr.isChecked(), propBinding.repoEnableTimer.isChecked(),
|
||||
propBinding.repoEnableMerge.isChecked(), propBinding.repoEnableRebase.isChecked(),
|
||||
propBinding.repoEnableSquash.isChecked(), propBinding.repoEnableForceMerge.isChecked()));
|
||||
|
||||
dialogProp.show();
|
||||
|
||||
}
|
||||
|
||||
private void saveRepositoryProperties(String repoName, String repoWebsite, String repoDescription,
|
||||
boolean repoPrivate, boolean repoAsTemplate, boolean repoEnableIssues, boolean repoEnableWiki,
|
||||
boolean repoEnablePr, boolean repoEnableTimer, boolean repoEnableMerge, boolean repoEnableRebase,
|
||||
boolean repoEnableSquash, boolean repoEnableForceMerge) {
|
||||
|
||||
UserRepositories.internalTimeTrackerObject repoPropsTimeTracker = new UserRepositories.internalTimeTrackerObject(repoEnableTimer);
|
||||
|
||||
UserRepositories repoProps;
|
||||
if(!repoEnableIssues) {
|
||||
repoProps = new UserRepositories(repoName, repoWebsite, repoDescription, repoPrivate, repoAsTemplate, repoEnableIssues, repoEnableWiki, repoEnablePr, repoEnableMerge,
|
||||
repoEnableRebase, repoEnableSquash, repoEnableForceMerge);
|
||||
}
|
||||
else {
|
||||
repoProps = new UserRepositories(repoName, repoWebsite, repoDescription, repoPrivate, repoAsTemplate, repoEnableIssues, repoEnableWiki, repoEnablePr, repoPropsTimeTracker, repoEnableMerge,
|
||||
repoEnableRebase, repoEnableSquash, repoEnableForceMerge);
|
||||
}
|
||||
|
||||
Call<UserRepositories> propsCall = RetrofitClient
|
||||
.getInstance(instanceUrl, ctx)
|
||||
.getApiInterface()
|
||||
.updateRepositoryProperties(instanceToken, repositoryOwner, repositoryName, repoProps);
|
||||
|
||||
propsCall.enqueue(new Callback<UserRepositories>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(@NonNull Call<UserRepositories> call, @NonNull retrofit2.Response<UserRepositories> response) {
|
||||
|
||||
propBinding.save.setVisibility(View.GONE);
|
||||
propBinding.processingRequest.setVisibility(View.VISIBLE);
|
||||
|
||||
if (response.code() == 200) {
|
||||
|
||||
tinyDb.putBoolean("hasIssues", repoEnableIssues);
|
||||
tinyDb.putBoolean("hasPullRequests", repoEnablePr);
|
||||
|
||||
dialogProp.dismiss();
|
||||
Toasty.success(ctx, getString(R.string.repoPropertiesSaveSuccess));
|
||||
|
||||
if(!repositoryName.equals(repoName)) {
|
||||
|
||||
finish();
|
||||
RepositoriesApi.updateRepositoryOwnerAndName(repositoryOwner, repoName, (int) tinyDb.getLong("repositoryId", 0));
|
||||
Intent intent = new Intent(RepositorySettingsActivity.this, MainActivity.class);
|
||||
RepositorySettingsActivity.this.startActivity(intent);
|
||||
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
propBinding.save.setVisibility(View.VISIBLE);
|
||||
propBinding.processingRequest.setVisibility(View.GONE);
|
||||
Toasty.error(ctx, getString(R.string.genericError));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(@NonNull Call<UserRepositories> call, @NonNull Throwable t) {
|
||||
|
||||
propBinding.save.setVisibility(View.VISIBLE);
|
||||
propBinding.processingRequest.setVisibility(View.GONE);
|
||||
Toasty.error(ctx, getString(R.string.genericServerResponseError));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initCloseListener() {
|
||||
onClickListener = view -> finish();
|
||||
}
|
||||
|
||||
}
|
@ -22,8 +22,8 @@ public class SettingsTranslationActivity extends BaseActivity {
|
||||
private Context appCtx;
|
||||
private View.OnClickListener onClickListener;
|
||||
|
||||
private static String[] langList = {"English", "Arabic", "Chinese", "Finnish", "French", "German", "Italian", "Latvian", "Persian", "Polish", "Portuguese/Brazilian", "Russian", "Serbian", "Spanish", "Turkish",
|
||||
"Ukrainian"};
|
||||
private static String[] langList = {"English", "Arabic", "Chinese", "Czech", "Finnish", "French", "German", "Italian", "Latvian", "Persian",
|
||||
"Polish", "Portuguese/Brazilian", "Russian", "Serbian", "Spanish", "Turkish", "Ukrainian"};
|
||||
private static int langSelectedChoice = 0;
|
||||
|
||||
@Override
|
||||
@ -95,6 +95,9 @@ public class SettingsTranslationActivity extends BaseActivity {
|
||||
case "Chinese":
|
||||
tinyDb.putString("locale", "zh");
|
||||
break;
|
||||
case "Czech":
|
||||
tinyDb.putString("locale", "cs");
|
||||
break;
|
||||
case "Finnish":
|
||||
tinyDb.putString("locale", "fi");
|
||||
break;
|
||||
@ -157,6 +160,7 @@ public class SettingsTranslationActivity extends BaseActivity {
|
||||
}
|
||||
|
||||
private void initCloseListener() {
|
||||
|
||||
onClickListener = view -> finish();
|
||||
}
|
||||
|
||||
|
@ -1,90 +0,0 @@
|
||||
package org.mian.gitnex.adapters;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.activities.CommitsActivity;
|
||||
import org.mian.gitnex.helpers.TinyDB;
|
||||
import org.mian.gitnex.models.Branches;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Author M M Arif
|
||||
*/
|
||||
|
||||
public class BranchesAdapter extends RecyclerView.Adapter<BranchesAdapter.BranchesViewHolder> {
|
||||
|
||||
private List<Branches> branchesList;
|
||||
private Context mCtx;
|
||||
|
||||
static class BranchesViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
private TextView branchNameTv;
|
||||
private TextView branchCommitAuthor;
|
||||
|
||||
private BranchesViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
|
||||
branchNameTv = itemView.findViewById(R.id.branchName);
|
||||
branchCommitAuthor = itemView.findViewById(R.id.branchCommitAuthor);
|
||||
Button branchCommitHash = itemView.findViewById(R.id.branchCommitHash);
|
||||
|
||||
branchCommitHash.setOnClickListener(new View.OnClickListener() {
|
||||
public void onClick(View v) {
|
||||
|
||||
Intent intent = new Intent(v.getContext(), CommitsActivity.class);
|
||||
intent.putExtra("branchName", String.valueOf(branchNameTv.getText()));
|
||||
Objects.requireNonNull(v.getContext()).startActivity(intent);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public BranchesAdapter(Context mCtx, List<Branches> branchesMain) {
|
||||
this.mCtx = mCtx;
|
||||
this.branchesList = branchesMain;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public BranchesAdapter.BranchesViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_branches, parent, false);
|
||||
return new BranchesAdapter.BranchesViewHolder(v);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull BranchesAdapter.BranchesViewHolder holder, int position) {
|
||||
|
||||
final TinyDB tinyDb = new TinyDB(mCtx);
|
||||
final String instanceUrl = tinyDb.getString("instanceUrl");
|
||||
|
||||
Branches currentItem = branchesList.get(position);
|
||||
holder.branchNameTv.setText(currentItem.getName());
|
||||
|
||||
if(currentItem.getCommit().getAuthor().getName() != null || !currentItem.getCommit().getAuthor().getName().equals("")) {
|
||||
holder.branchCommitAuthor.setText(mCtx.getResources().getString(R.string.commitAuthor, currentItem.getCommit().getAuthor().getName()));
|
||||
}
|
||||
else {
|
||||
holder.branchCommitAuthor.setText(mCtx.getResources().getString(R.string.commitAuthor, currentItem.getCommit().getAuthor().getUsername()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return branchesList.size();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -286,7 +286,7 @@ public class ExploreRepositoriesAdapter extends RecyclerView.Adapter<ExploreRepo
|
||||
holder.repoDescription.setVisibility(View.VISIBLE);
|
||||
holder.repoDescription.setText(currentItem.getDescription());
|
||||
}
|
||||
holder.fullName.setText(currentItem.getFullname());
|
||||
holder.fullName.setText(currentItem.getFullName());
|
||||
if(currentItem.getPrivateFlag()) {
|
||||
holder.repoPrivatePublic.setImageResource(R.drawable.ic_lock);
|
||||
holder.repoType.setText(R.string.strPrivate);
|
||||
@ -318,4 +318,9 @@ public class ExploreRepositoriesAdapter extends RecyclerView.Adapter<ExploreRepo
|
||||
return searchedReposList.size();
|
||||
}
|
||||
|
||||
public void notifyDataChanged() {
|
||||
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,95 @@
|
||||
package org.mian.gitnex.adapters;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.CheckBox;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.models.Labels;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Author M M Arif
|
||||
*/
|
||||
|
||||
public class LabelsListAdapter extends RecyclerView.Adapter<LabelsListAdapter.LabelsViewHolder> {
|
||||
|
||||
private List<Labels> labels;
|
||||
private ArrayList<String> labelsStrings = new ArrayList<>();
|
||||
private ArrayList<Integer> labelsIds = new ArrayList<>();
|
||||
|
||||
private LabelsListAdapterListener labelsListener;
|
||||
|
||||
public interface LabelsListAdapterListener {
|
||||
|
||||
void labelsStringData(ArrayList<String> data);
|
||||
void labelsIdsData(ArrayList<Integer> data);
|
||||
}
|
||||
|
||||
public LabelsListAdapter(List<Labels> labelsMain, LabelsListAdapterListener labelsListener) {
|
||||
|
||||
this.labels = labelsMain;
|
||||
this.labelsListener = labelsListener;
|
||||
}
|
||||
|
||||
static class LabelsViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
private CheckBox labelSelection;
|
||||
|
||||
private LabelsViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
|
||||
labelSelection = itemView.findViewById(R.id.labelSelection);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public LabelsListAdapter.LabelsViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
|
||||
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.custom_labels_list, parent, false);
|
||||
return new LabelsListAdapter.LabelsViewHolder(v);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull LabelsListAdapter.LabelsViewHolder holder, int position) {
|
||||
|
||||
Labels currentItem = labels.get(position);
|
||||
|
||||
holder.labelSelection.setText(currentItem.getName());
|
||||
|
||||
for(int i = 0; i < labelsIds.size(); i++) {
|
||||
|
||||
if(labelsStrings.contains(currentItem.getName())) {
|
||||
|
||||
holder.labelSelection.setChecked(true);
|
||||
}
|
||||
}
|
||||
|
||||
holder.labelSelection.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
||||
|
||||
if(isChecked) {
|
||||
|
||||
labelsStrings.add(currentItem.getName());
|
||||
labelsIds.add(currentItem.getId());
|
||||
}
|
||||
else {
|
||||
|
||||
labelsStrings.remove(currentItem.getName());
|
||||
labelsIds.remove(Integer.valueOf(currentItem.getId()));
|
||||
}
|
||||
|
||||
labelsListener.labelsStringData(labelsStrings);
|
||||
labelsListener.labelsIdsData(labelsIds);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return labels.size();
|
||||
}
|
||||
}
|
@ -291,7 +291,7 @@ public class MyReposListAdapter extends RecyclerView.Adapter<MyReposListAdapter.
|
||||
holder.repoDescription.setVisibility(View.VISIBLE);
|
||||
holder.repoDescription.setText(currentItem.getDescription());
|
||||
}
|
||||
holder.repoFullName.setText(currentItem.getFullname());
|
||||
holder.repoFullName.setText(currentItem.getFullName());
|
||||
if(currentItem.getPrivateFlag()) {
|
||||
holder.repoPrivatePublic.setImageResource(R.drawable.ic_lock);
|
||||
holder.repoType.setText(R.string.strPrivate);
|
||||
@ -344,7 +344,7 @@ public class MyReposListAdapter extends RecyclerView.Adapter<MyReposListAdapter.
|
||||
String filterPattern = constraint.toString().toLowerCase().trim();
|
||||
|
||||
for(UserRepositories item : reposListFull) {
|
||||
if(item.getFullname().toLowerCase().contains(filterPattern) || item.getDescription().toLowerCase().contains(filterPattern)) {
|
||||
if(item.getFullName().toLowerCase().contains(filterPattern) || item.getDescription().toLowerCase().contains(filterPattern)) {
|
||||
filteredList.add(item);
|
||||
}
|
||||
}
|
||||
|
@ -85,7 +85,7 @@ public class NotificationsAdapter extends RecyclerView.Adapter<NotificationsAdap
|
||||
.getString(R.string.hash) + url.substring(url.lastIndexOf("/") + 1) + "</font>";
|
||||
|
||||
holder.subject.setText(Html.fromHtml(subjectId + " " + notificationThread.getSubject().getTitle()));
|
||||
holder.repository.setText(notificationThread.getRepository().getFullname());
|
||||
holder.repository.setText(notificationThread.getRepository().getFullName());
|
||||
|
||||
if(notificationThread.isPinned()) {
|
||||
holder.pinned.setVisibility(View.VISIBLE);
|
||||
@ -120,7 +120,7 @@ public class NotificationsAdapter extends RecyclerView.Adapter<NotificationsAdap
|
||||
|
||||
onNotificationClickedListener.onNotificationClicked(notificationThread);
|
||||
|
||||
String[] parts = notificationThread.getRepository().getFullname().split("/");
|
||||
String[] parts = notificationThread.getRepository().getFullName().split("/");
|
||||
final String repoOwner = parts[0];
|
||||
final String repoName = parts[1];
|
||||
|
||||
|
@ -175,7 +175,7 @@ public class RepoForksAdapter extends RecyclerView.Adapter<RecyclerView.ViewHold
|
||||
repoDescription.setVisibility(View.VISIBLE);
|
||||
repoDescription.setText(forksModel.getDescription());
|
||||
}
|
||||
fullName.setText(forksModel.getFullname());
|
||||
fullName.setText(forksModel.getFullName());
|
||||
|
||||
if(forksModel.getPrivateFlag()) {
|
||||
repoPrivatePublic.setImageResource(R.drawable.ic_lock);
|
||||
|
@ -292,7 +292,7 @@ public class ReposListAdapter extends RecyclerView.Adapter<ReposListAdapter.Repo
|
||||
holder.repoDescription.setVisibility(View.VISIBLE);
|
||||
holder.repoDescription.setText(currentItem.getDescription());
|
||||
}
|
||||
holder.fullName.setText(currentItem.getFullname());
|
||||
holder.fullName.setText(currentItem.getFullName());
|
||||
if(currentItem.getPrivateFlag()) {
|
||||
holder.repoPrivatePublic.setImageResource(R.drawable.ic_lock);
|
||||
holder.repoType.setText(R.string.strPrivate);
|
||||
@ -344,7 +344,7 @@ public class ReposListAdapter extends RecyclerView.Adapter<ReposListAdapter.Repo
|
||||
String filterPattern = constraint.toString().toLowerCase().trim();
|
||||
|
||||
for(UserRepositories item : reposListFull) {
|
||||
if(item.getFullname().toLowerCase().contains(filterPattern) || item.getDescription().toLowerCase().contains(filterPattern)) {
|
||||
if(item.getFullName().toLowerCase().contains(filterPattern) || item.getDescription().toLowerCase().contains(filterPattern)) {
|
||||
filteredList.add(item);
|
||||
}
|
||||
}
|
||||
|
@ -292,7 +292,7 @@ public class RepositoriesByOrgAdapter extends RecyclerView.Adapter<RepositoriesB
|
||||
holder.repoDescription.setVisibility(View.VISIBLE);
|
||||
holder.repoDescription.setText(currentItem.getDescription());
|
||||
}
|
||||
holder.fullName.setText(currentItem.getFullname());
|
||||
holder.fullName.setText(currentItem.getFullName());
|
||||
if(currentItem.getPrivateFlag()) {
|
||||
holder.repoPrivatePublic.setImageResource(R.drawable.ic_lock);
|
||||
holder.repoType.setText(R.string.strPrivate);
|
||||
@ -340,7 +340,7 @@ public class RepositoriesByOrgAdapter extends RecyclerView.Adapter<RepositoriesB
|
||||
String filterPattern = constraint.toString().toLowerCase().trim();
|
||||
|
||||
for (UserRepositories item : reposListFull) {
|
||||
if (item.getFullname().toLowerCase().contains(filterPattern) || item.getDescription().toLowerCase().contains(filterPattern)) {
|
||||
if (item.getFullName().toLowerCase().contains(filterPattern) || item.getDescription().toLowerCase().contains(filterPattern)) {
|
||||
filteredList.add(item);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,172 @@
|
||||
package org.mian.gitnex.adapters;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.text.Html;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.activities.IssueDetailActivity;
|
||||
import org.mian.gitnex.clients.PicassoService;
|
||||
import org.mian.gitnex.database.api.RepositoriesApi;
|
||||
import org.mian.gitnex.database.models.Repository;
|
||||
import org.mian.gitnex.helpers.ClickListener;
|
||||
import org.mian.gitnex.helpers.RoundedTransformation;
|
||||
import org.mian.gitnex.helpers.TimeHelper;
|
||||
import org.mian.gitnex.helpers.TinyDB;
|
||||
import org.mian.gitnex.models.Issues;
|
||||
import org.ocpsoft.prettytime.PrettyTime;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* Author M M Arif
|
||||
*/
|
||||
|
||||
public class SearchIssuesAdapter extends RecyclerView.Adapter<SearchIssuesAdapter.SearchViewHolder> {
|
||||
|
||||
private List<Issues> searchedList;
|
||||
private Context mCtx;
|
||||
private TinyDB tinyDb;
|
||||
|
||||
public SearchIssuesAdapter(List<Issues> dataList, Context mCtx) {
|
||||
|
||||
this.mCtx = mCtx;
|
||||
this.searchedList = dataList;
|
||||
this.tinyDb = new TinyDB(mCtx);
|
||||
}
|
||||
|
||||
class SearchViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
private TextView issueNumber;
|
||||
private ImageView issueAssigneeAvatar;
|
||||
private TextView issueTitle;
|
||||
private TextView issueCreatedTime;
|
||||
private TextView issueCommentsCount;
|
||||
private TextView repoFullName;
|
||||
|
||||
private SearchViewHolder(View itemView) {
|
||||
|
||||
super(itemView);
|
||||
|
||||
issueNumber = itemView.findViewById(R.id.issueNumber);
|
||||
issueAssigneeAvatar = itemView.findViewById(R.id.assigneeAvatar);
|
||||
issueTitle = itemView.findViewById(R.id.issueTitle);
|
||||
issueCommentsCount = itemView.findViewById(R.id.issueCommentsCount);
|
||||
issueCreatedTime = itemView.findViewById(R.id.issueCreatedTime);
|
||||
repoFullName = itemView.findViewById(R.id.repoFullName);
|
||||
|
||||
issueTitle.setOnClickListener(v -> {
|
||||
|
||||
Context context = v.getContext();
|
||||
|
||||
Intent intent = new Intent(context, IssueDetailActivity.class);
|
||||
intent.putExtra("issueNumber", issueNumber.getText());
|
||||
|
||||
tinyDb.putString("issueNumber", issueNumber.getText().toString());
|
||||
tinyDb.putString("issueType", "Issue");
|
||||
|
||||
tinyDb.putString("repoFullName", repoFullName.getText().toString());
|
||||
|
||||
String[] parts = repoFullName.getText().toString().split("/");
|
||||
final String repoOwner = parts[0];
|
||||
final String repoName = parts[1];
|
||||
|
||||
int currentActiveAccountId = tinyDb.getInt("currentActiveAccountId");
|
||||
RepositoriesApi repositoryData = new RepositoriesApi(context);
|
||||
|
||||
Integer count = repositoryData.checkRepository(currentActiveAccountId, repoOwner, repoName);
|
||||
|
||||
if(count == 0) {
|
||||
|
||||
long id = repositoryData.insertRepository(currentActiveAccountId, repoOwner, repoName);
|
||||
tinyDb.putLong("repositoryId", id);
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
Repository data = repositoryData.getRepository(currentActiveAccountId, repoOwner, repoName);
|
||||
tinyDb.putLong("repositoryId", data.getRepositoryId());
|
||||
|
||||
}
|
||||
|
||||
context.startActivity(intent);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public SearchIssuesAdapter.SearchViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
|
||||
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_issues, parent, false);
|
||||
return new SearchIssuesAdapter.SearchViewHolder(v);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull final SearchIssuesAdapter.SearchViewHolder holder, int position) {
|
||||
|
||||
Issues currentItem = searchedList.get(position);
|
||||
|
||||
String locale = tinyDb.getString("locale");
|
||||
String timeFormat = tinyDb.getString("dateFormat");
|
||||
|
||||
if(!currentItem.getUser().getFull_name().equals("")) {
|
||||
holder.issueAssigneeAvatar.setOnClickListener(new ClickListener(mCtx.getResources().getString(R.string.issueCreator) + currentItem.getUser().getFull_name(), mCtx));
|
||||
}
|
||||
else {
|
||||
holder.issueAssigneeAvatar.setOnClickListener(new ClickListener(mCtx.getResources().getString(R.string.issueCreator) + currentItem.getUser().getLogin(), mCtx));
|
||||
}
|
||||
|
||||
PicassoService
|
||||
.getInstance(mCtx).get().load(currentItem.getUser().getAvatar_url()).placeholder(R.drawable.loader_animated).transform(new RoundedTransformation(8, 0)).resize(120, 120).centerCrop().into(holder.issueAssigneeAvatar);
|
||||
|
||||
String issueNumber_ = "<font color='" + mCtx.getResources().getColor(R.color.lightGray) + "'>" + currentItem.getRepository().getFull_name() + mCtx.getResources().getString(R.string.hash) + currentItem.getNumber() + "</font>";
|
||||
holder.issueTitle.setText(Html.fromHtml(issueNumber_ + " " + currentItem.getTitle()));
|
||||
|
||||
holder.issueNumber.setText(String.valueOf(currentItem.getNumber()));
|
||||
holder.issueCommentsCount.setText(String.valueOf(currentItem.getComments()));
|
||||
holder.repoFullName.setText(currentItem.getRepository().getFull_name());
|
||||
|
||||
switch(timeFormat) {
|
||||
case "pretty": {
|
||||
PrettyTime prettyTime = new PrettyTime(new Locale(locale));
|
||||
String createdTime = prettyTime.format(currentItem.getCreated_at());
|
||||
holder.issueCreatedTime.setText(createdTime);
|
||||
holder.issueCreatedTime.setOnClickListener(new ClickListener(TimeHelper.customDateFormatForToastDateFormat(currentItem.getCreated_at()), mCtx));
|
||||
break;
|
||||
}
|
||||
case "normal": {
|
||||
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd '" + mCtx.getResources().getString(R.string.timeAtText) + "' HH:mm", new Locale(locale));
|
||||
String createdTime = formatter.format(currentItem.getCreated_at());
|
||||
holder.issueCreatedTime.setText(createdTime);
|
||||
break;
|
||||
}
|
||||
case "normal1": {
|
||||
DateFormat formatter = new SimpleDateFormat("dd-MM-yyyy '" + mCtx.getResources().getString(R.string.timeAtText) + "' HH:mm", new Locale(locale));
|
||||
String createdTime = formatter.format(currentItem.getCreated_at());
|
||||
holder.issueCreatedTime.setText(createdTime);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
|
||||
return searchedList.size();
|
||||
}
|
||||
|
||||
public void notifyDataChanged() {
|
||||
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
@ -295,7 +295,7 @@ public class StarredReposListAdapter extends RecyclerView.Adapter<StarredReposLi
|
||||
holder.repoDescription.setVisibility(View.VISIBLE);
|
||||
holder.repoDescription.setText(currentItem.getDescription());
|
||||
}
|
||||
holder.fullName.setText(currentItem.getFullname());
|
||||
holder.fullName.setText(currentItem.getFullName());
|
||||
if(currentItem.getPrivateFlag()) {
|
||||
holder.repoPrivatePublic.setImageResource(R.drawable.ic_lock);
|
||||
holder.repoType.setText(R.string.strPrivate);
|
||||
@ -342,7 +342,7 @@ public class StarredReposListAdapter extends RecyclerView.Adapter<StarredReposLi
|
||||
String filterPattern = constraint.toString().toLowerCase().trim();
|
||||
|
||||
for (UserRepositories item : reposListFull) {
|
||||
if (item.getFullname().toLowerCase().contains(filterPattern) || item.getDescription().toLowerCase().contains(filterPattern)) {
|
||||
if (item.getFullName().toLowerCase().contains(filterPattern) || item.getDescription().toLowerCase().contains(filterPattern)) {
|
||||
filteredList.add(item);
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,5 @@
|
||||
package org.mian.gitnex.adapters;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@ -25,32 +24,33 @@ import io.mikael.urlbuilder.UrlBuilder;
|
||||
public class UserAccountsListDialogAdapter extends ArrayAdapter<UserAccount> {
|
||||
|
||||
private final Context mCtx;
|
||||
private final List<UserAccount> userAccountsList;
|
||||
private final TinyDB tinyDB;
|
||||
private final List<UserAccount> userAccounts;
|
||||
|
||||
public UserAccountsListDialogAdapter(@NonNull Context mCtx, int resource, @NonNull List<UserAccount> objects) {
|
||||
public UserAccountsListDialogAdapter(@NonNull Context mCtx, int resource, @NonNull List<UserAccount> userAccounts) {
|
||||
|
||||
super(mCtx, resource, objects);
|
||||
userAccountsList = objects;
|
||||
super(mCtx, resource, userAccounts);
|
||||
|
||||
tinyDB = new TinyDB(mCtx);
|
||||
this.userAccounts = userAccounts;
|
||||
this.mCtx = mCtx;
|
||||
|
||||
}
|
||||
|
||||
@SuppressLint("ViewHolder")
|
||||
@NonNull
|
||||
@Override
|
||||
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
|
||||
|
||||
LayoutInflater inflater = (LayoutInflater) mCtx.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
assert inflater != null;
|
||||
View rowView = inflater.inflate(R.layout.custom_user_accounts_list, parent, false);
|
||||
if(convertView == null) {
|
||||
convertView = LayoutInflater.from(mCtx).inflate(R.layout.custom_user_accounts_list, parent, false);
|
||||
}
|
||||
|
||||
TinyDB tinyDB = new TinyDB(mCtx);
|
||||
ImageView profileImage = convertView.findViewById(R.id.profileImage);
|
||||
TextView userName = convertView.findViewById(R.id.userName);
|
||||
TextView accountUrl = convertView.findViewById(R.id.accountUrl);
|
||||
ImageView activeAccount = convertView.findViewById(R.id.activeAccount);
|
||||
|
||||
ImageView profileImage = rowView.findViewById(R.id.profileImage);
|
||||
TextView userName = rowView.findViewById(R.id.userName);
|
||||
TextView accountUrl = rowView.findViewById(R.id.accountUrl);
|
||||
ImageView activeAccount = rowView.findViewById(R.id.activeAccount);
|
||||
|
||||
UserAccount currentItem = userAccountsList.get(position);
|
||||
UserAccount currentItem = userAccounts.get(position);
|
||||
|
||||
String url = UrlBuilder.fromString(currentItem.getInstanceUrl())
|
||||
.withPath("/")
|
||||
@ -62,11 +62,15 @@ public class UserAccountsListDialogAdapter extends ArrayAdapter<UserAccount> {
|
||||
if(tinyDB.getInt("currentActiveAccountId") == currentItem.getAccountId()) {
|
||||
activeAccount.setVisibility(View.VISIBLE);
|
||||
}
|
||||
else {
|
||||
activeAccount.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
PicassoService
|
||||
.getInstance(mCtx).get().load(url + "img/favicon.png").placeholder(R.drawable.loader_animated).transform(new RoundedTransformation(8, 0)).resize(120, 120).centerCrop().into(profileImage);
|
||||
|
||||
return rowView;
|
||||
return convertView;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -127,6 +127,11 @@ public class RepositoriesApi {
|
||||
return repository;
|
||||
}
|
||||
|
||||
public static void updateRepositoryOwnerAndName(String repositoryOwner, String repositoryName, int repositoryId) {
|
||||
|
||||
new Thread(() -> repositoriesDao.updateRepositoryOwnerAndName(repositoryOwner, repositoryName, repositoryId)).start();
|
||||
}
|
||||
|
||||
public static void deleteRepositoriesByAccount(final int repoAccountId) {
|
||||
|
||||
new Thread(() -> repositoriesDao.deleteRepositoriesByAccount(repoAccountId)).start();
|
||||
|
@ -6,14 +6,13 @@ import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.activities.MainActivity;
|
||||
import org.mian.gitnex.databinding.FragmentAboutBinding;
|
||||
import org.mian.gitnex.helpers.AppUtil;
|
||||
import org.mian.gitnex.helpers.TinyDB;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Author M M Arif
|
||||
@ -21,30 +20,19 @@ import java.util.Objects;
|
||||
|
||||
public class AboutFragment extends Fragment {
|
||||
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
|
||||
View v = inflater.inflate(R.layout.fragment_about, container, false);
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
|
||||
FragmentAboutBinding viewBinding = FragmentAboutBinding.inflate(inflater, container, false);
|
||||
TinyDB tinyDb = new TinyDB(getContext());
|
||||
|
||||
final TextView appVerBuild;
|
||||
final TextView donationLink;
|
||||
final TextView donationLinkPatreon;
|
||||
final TextView translateLink;
|
||||
final TextView appWebsite;
|
||||
final TextView appRepo;
|
||||
viewBinding.appVersion.setText(AppUtil.getAppVersion(requireContext()));
|
||||
viewBinding.userServerVersion.setText(tinyDb.getString("giteaVersion"));
|
||||
viewBinding.appBuild.setText(String.valueOf(AppUtil.getAppBuildNo(requireContext())));
|
||||
|
||||
appVerBuild = v.findViewById(R.id.appVerBuild);
|
||||
TextView viewTextGiteaVersion = v.findViewById(R.id.giteaVersion);
|
||||
donationLink = v.findViewById(R.id.donationLink);
|
||||
donationLinkPatreon = v.findViewById(R.id.donationLinkPatreon);
|
||||
translateLink = v.findViewById(R.id.translateLink);
|
||||
appWebsite = v.findViewById(R.id.appWebsite);
|
||||
appRepo = v.findViewById(R.id.appRepo);
|
||||
((MainActivity) requireActivity()).setActionBarTitle(getResources().getString(R.string.pageTitleAbout));
|
||||
|
||||
appVerBuild.setText(getString(R.string.appVerBuild, AppUtil.getAppVersion(Objects.requireNonNull(getContext())), AppUtil.getAppBuildNo(getContext())));
|
||||
|
||||
donationLink.setOnClickListener(v1 -> {
|
||||
viewBinding.donationLinkLiberapay.setOnClickListener(v1 -> {
|
||||
|
||||
Intent intent = new Intent();
|
||||
intent.setAction(Intent.ACTION_VIEW);
|
||||
@ -53,7 +41,7 @@ public class AboutFragment extends Fragment {
|
||||
startActivity(intent);
|
||||
});
|
||||
|
||||
donationLinkPatreon.setOnClickListener(v12 -> {
|
||||
viewBinding.donationLinkPatreon.setOnClickListener(v12 -> {
|
||||
|
||||
Intent intent = new Intent();
|
||||
intent.setAction(Intent.ACTION_VIEW);
|
||||
@ -62,7 +50,7 @@ public class AboutFragment extends Fragment {
|
||||
startActivity(intent);
|
||||
});
|
||||
|
||||
translateLink.setOnClickListener(v13 -> {
|
||||
viewBinding.translateLink.setOnClickListener(v13 -> {
|
||||
|
||||
Intent intent = new Intent();
|
||||
intent.setAction(Intent.ACTION_VIEW);
|
||||
@ -71,7 +59,7 @@ public class AboutFragment extends Fragment {
|
||||
startActivity(intent);
|
||||
});
|
||||
|
||||
appWebsite.setOnClickListener(v14 -> {
|
||||
viewBinding.appWebsite.setOnClickListener(v14 -> {
|
||||
|
||||
Intent intent = new Intent();
|
||||
intent.setAction(Intent.ACTION_VIEW);
|
||||
@ -80,19 +68,15 @@ public class AboutFragment extends Fragment {
|
||||
startActivity(intent);
|
||||
});
|
||||
|
||||
appRepo.setOnClickListener(v15 -> {
|
||||
if(AppUtil.isPro(requireContext())) {
|
||||
|
||||
Intent intent = new Intent();
|
||||
intent.setAction(Intent.ACTION_VIEW);
|
||||
intent.addCategory(Intent.CATEGORY_BROWSABLE);
|
||||
intent.setData(Uri.parse(getResources().getString(R.string.appRepoLink)));
|
||||
startActivity(intent);
|
||||
});
|
||||
viewBinding.supportHeader.setVisibility(View.GONE);
|
||||
viewBinding.dividerSupport.setVisibility(View.GONE);
|
||||
viewBinding.donationLinkLiberapay.setVisibility(View.GONE);
|
||||
viewBinding.donationLinkPatreon.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
String commit = getResources().getString(R.string.commitPage) + tinyDb.getString("giteaVersion");
|
||||
viewTextGiteaVersion.setText(commit);
|
||||
|
||||
return v;
|
||||
return viewBinding.getRoot();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -41,6 +41,9 @@ public class BottomSheetRepoFragment extends BottomSheetDialogFragment {
|
||||
TextView unWatchRepository = v.findViewById(R.id.unWatchRepository);
|
||||
TextView shareRepository = v.findViewById(R.id.shareRepository);
|
||||
TextView copyRepoUrl = v.findViewById(R.id.copyRepoUrl);
|
||||
View repoSettingsDivider = v.findViewById(R.id.repoSettingsDivider);
|
||||
TextView repoSettings = v.findViewById(R.id.repoSettings);
|
||||
TextView createPullRequest = v.findViewById(R.id.createPullRequest);
|
||||
|
||||
createLabel.setOnClickListener(v112 -> {
|
||||
|
||||
@ -49,6 +52,7 @@ public class BottomSheetRepoFragment extends BottomSheetDialogFragment {
|
||||
});
|
||||
|
||||
if(tinyDb.getBoolean("hasIssues")) {
|
||||
|
||||
createIssue.setVisibility(View.VISIBLE);
|
||||
createIssue.setOnClickListener(v12 -> {
|
||||
|
||||
@ -57,9 +61,24 @@ public class BottomSheetRepoFragment extends BottomSheetDialogFragment {
|
||||
});
|
||||
}
|
||||
else {
|
||||
|
||||
createIssue.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if(tinyDb.getBoolean("hasPullRequests")) {
|
||||
|
||||
createPullRequest.setVisibility(View.VISIBLE);
|
||||
createPullRequest.setOnClickListener(vPr -> {
|
||||
|
||||
bmListener.onButtonClicked("newPullRequest");
|
||||
dismiss();
|
||||
});
|
||||
}
|
||||
else {
|
||||
|
||||
createPullRequest.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
createMilestone.setOnClickListener(v13 -> {
|
||||
|
||||
bmListener.onButtonClicked("newMilestone");
|
||||
@ -67,13 +86,24 @@ public class BottomSheetRepoFragment extends BottomSheetDialogFragment {
|
||||
});
|
||||
|
||||
if (tinyDb.getBoolean("isRepoAdmin")) {
|
||||
|
||||
repoSettings.setOnClickListener(repoSettingsView -> {
|
||||
|
||||
bmListener.onButtonClicked("repoSettings");
|
||||
dismiss();
|
||||
});
|
||||
|
||||
addCollaborator.setOnClickListener(v1 -> {
|
||||
|
||||
bmListener.onButtonClicked("addCollaborator");
|
||||
dismiss();
|
||||
});
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
|
||||
addCollaborator.setVisibility(View.GONE);
|
||||
repoSettingsDivider.setVisibility(View.GONE);
|
||||
repoSettings.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
createRelease.setOnClickListener(v14 -> {
|
||||
|
@ -1,149 +0,0 @@
|
||||
package org.mian.gitnex.fragments;
|
||||
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.Observer;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.adapters.BranchesAdapter;
|
||||
import org.mian.gitnex.helpers.Authorization;
|
||||
import org.mian.gitnex.helpers.TinyDB;
|
||||
import org.mian.gitnex.models.Branches;
|
||||
import org.mian.gitnex.viewmodels.BranchesViewModel;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Author M M Arif
|
||||
*/
|
||||
|
||||
public class BranchesFragment extends Fragment {
|
||||
|
||||
private ProgressBar mProgressBar;
|
||||
private BranchesAdapter adapter;
|
||||
private RecyclerView mRecyclerView;
|
||||
private TextView noDataBranches;
|
||||
private static String repoNameF = "param2";
|
||||
private static String repoOwnerF = "param1";
|
||||
|
||||
private String repoName;
|
||||
private String repoOwner;
|
||||
|
||||
private OnFragmentInteractionListener mListener;
|
||||
|
||||
public BranchesFragment() {
|
||||
}
|
||||
|
||||
public static BranchesFragment newInstance(String param1, String param2) {
|
||||
BranchesFragment fragment = new BranchesFragment();
|
||||
Bundle args = new Bundle();
|
||||
args.putString(repoOwnerF, param1);
|
||||
args.putString(repoNameF, param2);
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
if (getArguments() != null) {
|
||||
repoName = getArguments().getString(repoNameF);
|
||||
repoOwner = getArguments().getString(repoOwnerF);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
View v = inflater.inflate(R.layout.fragment_branches, container, false);
|
||||
|
||||
TinyDB tinyDb = new TinyDB(getContext());
|
||||
final String instanceUrl = tinyDb.getString("instanceUrl");
|
||||
final String loginUid = tinyDb.getString("loginUid");
|
||||
final String instanceToken = "token " + tinyDb.getString(loginUid + "-token");
|
||||
final String locale = tinyDb.getString("locale");
|
||||
final String timeFormat = tinyDb.getString("dateFormat");
|
||||
noDataBranches = v.findViewById(R.id.noDataBranches);
|
||||
|
||||
final SwipeRefreshLayout swipeRefresh = v.findViewById(R.id.pullToRefresh);
|
||||
|
||||
mRecyclerView = v.findViewById(R.id.recyclerView);
|
||||
mRecyclerView.setHasFixedSize(true);
|
||||
mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
|
||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(mRecyclerView.getContext(),
|
||||
DividerItemDecoration.VERTICAL);
|
||||
mRecyclerView.addItemDecoration(dividerItemDecoration);
|
||||
|
||||
mProgressBar = v.findViewById(R.id.progress_bar);
|
||||
|
||||
swipeRefresh.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
|
||||
@Override
|
||||
public void onRefresh() {
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
swipeRefresh.setRefreshing(false);
|
||||
BranchesViewModel.loadBranchesList(instanceUrl, instanceToken, repoOwner, repoName, getContext());
|
||||
}
|
||||
}, 50);
|
||||
}
|
||||
});
|
||||
|
||||
fetchDataAsync(instanceUrl, Authorization.returnAuthentication(getContext(), loginUid, instanceToken), repoOwner, repoName);
|
||||
|
||||
return v;
|
||||
}
|
||||
|
||||
public void onButtonPressed(Uri uri) {
|
||||
if (mListener != null) {
|
||||
mListener.onFragmentInteraction(uri);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDetach() {
|
||||
super.onDetach();
|
||||
mListener = null;
|
||||
}
|
||||
|
||||
public interface OnFragmentInteractionListener {
|
||||
void onFragmentInteraction(Uri uri);
|
||||
}
|
||||
|
||||
private void fetchDataAsync(String instanceUrl, String instanceToken, String owner, String repo) {
|
||||
|
||||
BranchesViewModel branchesModel = new ViewModelProvider(this).get(BranchesViewModel.class);
|
||||
|
||||
branchesModel.getBranchesList(instanceUrl, instanceToken, owner, repo, getContext()).observe(getViewLifecycleOwner(), new Observer<List<Branches>>() {
|
||||
@Override
|
||||
public void onChanged(@Nullable List<Branches> branchesListMain) {
|
||||
adapter = new BranchesAdapter(getContext(), branchesListMain);
|
||||
if(adapter.getItemCount() > 0) {
|
||||
mRecyclerView.setAdapter(adapter);
|
||||
noDataBranches.setVisibility(View.GONE);
|
||||
}
|
||||
else {
|
||||
adapter.notifyDataSetChanged();
|
||||
mRecyclerView.setAdapter(adapter);
|
||||
noDataBranches.setVisibility(View.VISIBLE);
|
||||
}
|
||||
mProgressBar.setVisibility(View.GONE);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
129
app/src/main/java/org/mian/gitnex/fragments/ExploreFragment.java
Normal file
@ -0,0 +1,129 @@
|
||||
package org.mian.gitnex.fragments;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Typeface;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
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.FragmentPagerAdapter;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.activities.MainActivity;
|
||||
import org.mian.gitnex.helpers.TinyDB;
|
||||
|
||||
/**
|
||||
* Author M M Arif
|
||||
*/
|
||||
|
||||
public class ExploreFragment extends Fragment {
|
||||
|
||||
private Context ctx;
|
||||
private TinyDB tinyDB;
|
||||
|
||||
private int tabsCount;
|
||||
public ViewPager mViewPager;
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
|
||||
View v = inflater.inflate(R.layout.fragment_explore, container,false);
|
||||
ctx = getContext();
|
||||
tinyDB = new TinyDB(ctx);
|
||||
|
||||
((MainActivity) requireActivity()).setActionBarTitle(getResources().getString(R.string.navExplore));
|
||||
|
||||
TabLayout tabLayout = v.findViewById(R.id.tabsExplore);
|
||||
|
||||
ViewGroup viewGroup = (ViewGroup) tabLayout.getChildAt(0);
|
||||
tabsCount = viewGroup.getChildCount();
|
||||
|
||||
Typeface myTypeface;
|
||||
|
||||
switch(tinyDB.getInt("customFontId", -1)) {
|
||||
|
||||
case 0:
|
||||
myTypeface = Typeface.createFromAsset(ctx.getAssets(), "fonts/roboto.ttf");
|
||||
break;
|
||||
|
||||
case 2:
|
||||
myTypeface = Typeface.createFromAsset(ctx.getAssets(), "fonts/sourcecodeproregular.ttf");
|
||||
break;
|
||||
|
||||
default:
|
||||
myTypeface = Typeface.createFromAsset(ctx.getAssets(), "fonts/manroperegular.ttf");
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
for(int j = 0; j < tabsCount; j++) {
|
||||
|
||||
ViewGroup vgTab = (ViewGroup) viewGroup.getChildAt(j);
|
||||
int tabChildCount = vgTab.getChildCount();
|
||||
|
||||
for(int i = 0; i < tabChildCount; i++) {
|
||||
|
||||
View tabViewChild = vgTab.getChildAt(i);
|
||||
|
||||
if(tabViewChild instanceof TextView) {
|
||||
((TextView) tabViewChild).setTypeface(myTypeface);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mViewPager = v.findViewById(R.id.containerExplore);
|
||||
|
||||
mViewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout));
|
||||
tabLayout.addOnTabSelectedListener(new TabLayout.ViewPagerOnTabSelectedListener(mViewPager));
|
||||
|
||||
SectionsPagerAdapter mSectionsPagerAdapter = new SectionsPagerAdapter(getChildFragmentManager());
|
||||
mViewPager.setAdapter(mSectionsPagerAdapter);
|
||||
|
||||
return v;
|
||||
}
|
||||
|
||||
public class SectionsPagerAdapter extends FragmentPagerAdapter {
|
||||
|
||||
SectionsPagerAdapter(FragmentManager fm) {
|
||||
|
||||
super(fm, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Fragment getItem(int position) {
|
||||
|
||||
Fragment fragment = null;
|
||||
|
||||
switch(position) {
|
||||
|
||||
case 0: // Repositories
|
||||
fragment = new ExploreRepositoriesFragment();
|
||||
break;
|
||||
|
||||
case 1: // Issues
|
||||
fragment = new SearchIssuesFragment();
|
||||
break;
|
||||
}
|
||||
|
||||
assert fragment != null;
|
||||
return fragment;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
|
||||
return tabsCount;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -1,27 +1,37 @@
|
||||
package org.mian.gitnex.fragments;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.adapters.ExploreRepositoriesAdapter;
|
||||
import org.mian.gitnex.clients.RetrofitClient;
|
||||
import org.mian.gitnex.databinding.CustomExploreRepositoriesDialogBinding;
|
||||
import org.mian.gitnex.databinding.FragmentExploreRepoBinding;
|
||||
import org.mian.gitnex.helpers.AppUtil;
|
||||
import org.mian.gitnex.helpers.Authorization;
|
||||
import org.mian.gitnex.helpers.InfiniteScrollListener;
|
||||
import org.mian.gitnex.helpers.StaticGlobalVariables;
|
||||
import org.mian.gitnex.helpers.TinyDB;
|
||||
import org.mian.gitnex.helpers.Version;
|
||||
import org.mian.gitnex.models.ExploreRepositories;
|
||||
import org.mian.gitnex.models.UserRepositories;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import retrofit2.Call;
|
||||
@ -29,189 +39,300 @@ import retrofit2.Callback;
|
||||
import retrofit2.Response;
|
||||
|
||||
/**
|
||||
* Template Author Author M M Arif
|
||||
* Template Author M M Arif
|
||||
* Author 6543
|
||||
*/
|
||||
|
||||
public class ExploreRepositoriesFragment extends Fragment {
|
||||
|
||||
private static String repoNameF = "param2";
|
||||
private static String repoOwnerF = "param1";
|
||||
private ProgressBar mProgressBar;
|
||||
private RecyclerView mRecyclerView;
|
||||
private TextView noData;
|
||||
private TextView searchKeyword;
|
||||
private Boolean repoTypeInclude = true;
|
||||
private FragmentExploreRepoBinding viewBinding;
|
||||
private Context ctx;
|
||||
private TinyDB tinyDb;
|
||||
|
||||
private int pageCurrentIndex = 1;
|
||||
private boolean repoTypeInclude = true;
|
||||
private String sort = "updated";
|
||||
private String order = "desc";
|
||||
private int limit = 50;
|
||||
private int limit = 10;
|
||||
private List<UserRepositories> dataList;
|
||||
private ExploreRepositoriesAdapter adapter;
|
||||
|
||||
private OnFragmentInteractionListener mListener;
|
||||
private String instanceUrl;
|
||||
private String loginUid;
|
||||
private String instanceToken;
|
||||
|
||||
public ExploreRepositoriesFragment() {
|
||||
|
||||
}
|
||||
|
||||
public static ExploreRepositoriesFragment newInstance(String param1, String param2) {
|
||||
|
||||
ExploreRepositoriesFragment fragment = new ExploreRepositoriesFragment();
|
||||
Bundle args = new Bundle();
|
||||
args.putString(repoOwnerF, param1);
|
||||
args.putString(repoNameF, param2);
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
if(getArguments() != null) {
|
||||
String repoName = getArguments().getString(repoNameF);
|
||||
String repoOwner = getArguments().getString(repoOwnerF);
|
||||
}
|
||||
}
|
||||
private Dialog dialogFilterOptions;
|
||||
private CustomExploreRepositoriesDialogBinding filterBinding;
|
||||
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
|
||||
final View v = inflater.inflate(R.layout.fragment_explore_repo, container, false);
|
||||
//setHasOptionsMenu(true);
|
||||
viewBinding = FragmentExploreRepoBinding.inflate(inflater, container, false);
|
||||
setHasOptionsMenu(true);
|
||||
|
||||
TinyDB tinyDb = new TinyDB(getContext());
|
||||
final String instanceUrl = tinyDb.getString("instanceUrl");
|
||||
final String loginUid = tinyDb.getString("loginUid");
|
||||
final String instanceToken = "token " + tinyDb.getString(loginUid + "-token");
|
||||
ctx = getContext();
|
||||
tinyDb = new TinyDB(getContext());
|
||||
|
||||
searchKeyword = v.findViewById(R.id.searchKeyword);
|
||||
noData = v.findViewById(R.id.noData);
|
||||
mProgressBar = v.findViewById(R.id.progress_bar);
|
||||
mRecyclerView = v.findViewById(R.id.recyclerViewReposSearch);
|
||||
instanceUrl = tinyDb.getString("instanceUrl");
|
||||
loginUid = tinyDb.getString("loginUid");
|
||||
instanceToken = "token " + tinyDb.getString(loginUid + "-token");
|
||||
|
||||
mProgressBar.setVisibility(View.VISIBLE);
|
||||
dataList = new ArrayList<>();
|
||||
adapter = new ExploreRepositoriesAdapter(dataList, ctx);
|
||||
|
||||
searchKeyword.setOnEditorActionListener((v1, actionId, event) -> {
|
||||
tinyDb.putBoolean("exploreRepoIncludeTopic", false);
|
||||
tinyDb.putBoolean("exploreRepoIncludeDescription", false);
|
||||
tinyDb.putBoolean("exploreRepoIncludeTemplate", false);
|
||||
tinyDb.putBoolean("exploreRepoOnlyArchived", false);
|
||||
|
||||
// if gitea is 1.12 or higher use the new limit
|
||||
if(new Version(tinyDb.getString("giteaVersion")).higherOrEqual("1.12.0")) {
|
||||
limit = StaticGlobalVariables.resultLimitNewGiteaInstances;
|
||||
}
|
||||
|
||||
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(ctx);
|
||||
|
||||
viewBinding.recyclerViewReposSearch.setHasFixedSize(true);
|
||||
viewBinding.recyclerViewReposSearch.setLayoutManager(linearLayoutManager);
|
||||
viewBinding.recyclerViewReposSearch.setAdapter(adapter);
|
||||
|
||||
viewBinding.searchKeyword.setOnEditorActionListener((v1, actionId, event) -> {
|
||||
|
||||
if(actionId == EditorInfo.IME_ACTION_SEND) {
|
||||
if(!searchKeyword.getText().toString().equals("")) {
|
||||
mProgressBar.setVisibility(View.VISIBLE);
|
||||
mRecyclerView.setVisibility(View.GONE);
|
||||
loadSearchReposList(instanceUrl, instanceToken, loginUid, searchKeyword.getText().toString(), repoTypeInclude, sort, order, getContext(), limit);
|
||||
|
||||
if(!Objects.requireNonNull(viewBinding.searchKeyword.getText()).toString().equals("")) {
|
||||
|
||||
InputMethodManager imm = (InputMethodManager) requireActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
imm.hideSoftInputFromWindow(viewBinding.searchKeyword.getWindowToken(), 0);
|
||||
|
||||
// if gitea is 1.12 or higher use the new limit
|
||||
if(new Version(tinyDb.getString("giteaVersion")).higherOrEqual("1.12.0")) {
|
||||
limit = StaticGlobalVariables.resultLimitNewGiteaInstances;
|
||||
}
|
||||
else {
|
||||
limit = 10;
|
||||
}
|
||||
|
||||
pageCurrentIndex = 1;
|
||||
viewBinding.progressBar.setVisibility(View.VISIBLE);
|
||||
loadData(false, viewBinding.searchKeyword.getText().toString(), tinyDb.getBoolean("exploreRepoIncludeTopic"), tinyDb.getBoolean("exploreRepoIncludeDescription"), tinyDb.getBoolean("exploreRepoIncludeTemplate"), tinyDb.getBoolean("exploreRepoOnlyArchived"));
|
||||
}
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
int limitDefault = 25;
|
||||
loadDefaultList(instanceUrl, instanceToken, loginUid, repoTypeInclude, sort, order, getContext(), limitDefault);
|
||||
|
||||
return v;
|
||||
|
||||
}
|
||||
|
||||
private void loadDefaultList(String instanceUrl, String instanceToken, String loginUid, Boolean repoTypeInclude, String sort, String order, final Context context, int limit) {
|
||||
|
||||
Call<ExploreRepositories> call = RetrofitClient.getInstance(instanceUrl, getContext()).getApiInterface().queryRepos(Authorization.returnAuthentication(getContext(), loginUid, instanceToken), null, repoTypeInclude, sort, order, limit);
|
||||
|
||||
call.enqueue(new Callback<ExploreRepositories>() {
|
||||
viewBinding.recyclerViewReposSearch.addOnScrollListener(new InfiniteScrollListener(pageCurrentIndex, linearLayoutManager) {
|
||||
|
||||
@Override
|
||||
public void onResponse(@NonNull Call<ExploreRepositories> call, @NonNull Response<ExploreRepositories> response) {
|
||||
|
||||
if(response.isSuccessful()) {
|
||||
assert response.body() != null;
|
||||
getReposList(response.body().getSearchedData(), context);
|
||||
}
|
||||
else {
|
||||
Log.i("onResponse", String.valueOf(response.code()));
|
||||
}
|
||||
public void onScrolledToEnd(int firstVisibleItemPosition) {
|
||||
|
||||
pageCurrentIndex++;
|
||||
loadData(true, Objects.requireNonNull(viewBinding.searchKeyword.getText()).toString(), tinyDb.getBoolean("exploreRepoIncludeTopic"), tinyDb.getBoolean("exploreRepoIncludeDescription"), tinyDb.getBoolean("exploreRepoIncludeTemplate"), tinyDb.getBoolean("exploreRepoOnlyArchived"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(@NonNull Call<ExploreRepositories> call, @NonNull Throwable t) {
|
||||
|
||||
Log.i("onFailure", Objects.requireNonNull(t.getMessage()));
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
viewBinding.pullToRefresh.setOnRefreshListener(() -> {
|
||||
|
||||
private void loadSearchReposList(String instanceUrl, String instanceToken, String loginUid, String searchKeyword, Boolean repoTypeInclude, String sort, String order, final Context context, int limit) {
|
||||
|
||||
Call<ExploreRepositories> call = RetrofitClient.getInstance(instanceUrl, getContext()).getApiInterface().queryRepos(Authorization.returnAuthentication(getContext(), loginUid, instanceToken), searchKeyword, repoTypeInclude, sort, order, limit);
|
||||
|
||||
call.enqueue(new Callback<ExploreRepositories>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(@NonNull Call<ExploreRepositories> call, @NonNull Response<ExploreRepositories> response) {
|
||||
|
||||
if(response.isSuccessful()) {
|
||||
assert response.body() != null;
|
||||
getReposList(response.body().getSearchedData(), context);
|
||||
}
|
||||
else {
|
||||
Log.i("onResponse", String.valueOf(response.code()));
|
||||
}
|
||||
pageCurrentIndex = 1;
|
||||
|
||||
// if gitea is 1.12 or higher use the new limit
|
||||
if(new Version(tinyDb.getString("giteaVersion")).higherOrEqual("1.12.0")) {
|
||||
limit = StaticGlobalVariables.resultLimitNewGiteaInstances;
|
||||
}
|
||||
else {
|
||||
limit = 10;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(@NonNull Call<ExploreRepositories> call, @NonNull Throwable t) {
|
||||
|
||||
Log.i("onFailure", Objects.requireNonNull(t.getMessage()));
|
||||
}
|
||||
|
||||
loadData(false, Objects.requireNonNull(viewBinding.searchKeyword.getText()).toString(), tinyDb.getBoolean("exploreRepoIncludeTopic"), tinyDb.getBoolean("exploreRepoIncludeDescription"), tinyDb.getBoolean("exploreRepoIncludeTemplate"), tinyDb.getBoolean("exploreRepoOnlyArchived"));
|
||||
});
|
||||
|
||||
loadData(false, "", tinyDb.getBoolean("exploreRepoIncludeTopic"), tinyDb.getBoolean("exploreRepoIncludeDescription"), tinyDb.getBoolean("exploreRepoIncludeTemplate"), tinyDb.getBoolean("exploreRepoOnlyArchived"));
|
||||
|
||||
return viewBinding.getRoot();
|
||||
|
||||
}
|
||||
|
||||
private void getReposList(List<UserRepositories> dataList, Context context) {
|
||||
private void loadData(boolean append, String searchKeyword, boolean exploreRepoIncludeTopic, boolean exploreRepoIncludeDescription, boolean exploreRepoIncludeTemplate, boolean exploreRepoOnlyArchived) {
|
||||
|
||||
ExploreRepositoriesAdapter adapter = new ExploreRepositoriesAdapter(dataList, context);
|
||||
viewBinding.noData.setVisibility(View.GONE);
|
||||
|
||||
mRecyclerView.setVisibility(View.VISIBLE);
|
||||
int apiCallDefaultLimit = 10;
|
||||
// if gitea is 1.12 or higher use the new limit
|
||||
if(new Version(tinyDb.getString("giteaVersion")).higherOrEqual("1.12.0")) {
|
||||
apiCallDefaultLimit = StaticGlobalVariables.resultLimitNewGiteaInstances;
|
||||
}
|
||||
|
||||
mRecyclerView.setHasFixedSize(true);
|
||||
mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(mRecyclerView.getContext(), DividerItemDecoration.VERTICAL);
|
||||
mRecyclerView.addItemDecoration(dividerItemDecoration);
|
||||
if(apiCallDefaultLimit > limit) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(adapter.getItemCount() > 0) {
|
||||
|
||||
mRecyclerView.setAdapter(adapter);
|
||||
noData.setVisibility(View.GONE);
|
||||
mProgressBar.setVisibility(View.GONE);
|
||||
if(pageCurrentIndex == 1 || !append) {
|
||||
|
||||
dataList.clear();
|
||||
adapter.notifyDataSetChanged();
|
||||
viewBinding.pullToRefresh.setRefreshing(false);
|
||||
viewBinding.progressBar.setVisibility(View.VISIBLE);
|
||||
}
|
||||
else {
|
||||
|
||||
noData.setVisibility(View.VISIBLE);
|
||||
mProgressBar.setVisibility(View.GONE);
|
||||
|
||||
viewBinding.loadingMoreView.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
Call<ExploreRepositories> call = RetrofitClient.getInstance(instanceUrl, getContext()).getApiInterface().queryRepos(Authorization.returnAuthentication(getContext(), loginUid, instanceToken), searchKeyword, repoTypeInclude, sort, order, exploreRepoIncludeTopic, exploreRepoIncludeDescription, exploreRepoIncludeTemplate, exploreRepoOnlyArchived, limit, pageCurrentIndex);
|
||||
|
||||
call.enqueue(new Callback<ExploreRepositories>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(@NonNull Call<ExploreRepositories> call, @NonNull Response<ExploreRepositories> response) {
|
||||
|
||||
if(response.code() == 200) {
|
||||
|
||||
assert response.body() != null;
|
||||
|
||||
limit = response.body().getSearchedData().size();
|
||||
|
||||
if(!append) {
|
||||
|
||||
dataList.clear();
|
||||
}
|
||||
|
||||
dataList.addAll(response.body().getSearchedData());
|
||||
adapter.notifyDataSetChanged();
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
dataList.clear();
|
||||
adapter.notifyDataChanged();
|
||||
viewBinding.noData.setVisibility(View.VISIBLE);
|
||||
|
||||
}
|
||||
|
||||
onCleanup();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(@NonNull Call<ExploreRepositories> call, @NonNull Throwable t) {
|
||||
|
||||
Log.e("onFailure", Objects.requireNonNull(t.getMessage()));
|
||||
onCleanup();
|
||||
|
||||
}
|
||||
|
||||
private void onCleanup() {
|
||||
|
||||
AppUtil.setMultiVisibility(View.GONE, viewBinding.loadingMoreView, viewBinding.progressBar);
|
||||
|
||||
if(dataList.isEmpty()) {
|
||||
|
||||
viewBinding.noData.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) {
|
||||
|
||||
menu.clear();
|
||||
inflater.inflate(R.menu.filter_menu, menu);
|
||||
super.onCreateOptionsMenu(menu, inflater);
|
||||
|
||||
MenuItem filter = menu.findItem(R.id.filter);
|
||||
|
||||
filter.setOnMenuItemClickListener(filter_ -> {
|
||||
|
||||
showFilterOptions();
|
||||
return false;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void onButtonPressed(Uri uri) {
|
||||
private void showFilterOptions() {
|
||||
|
||||
if(mListener != null) {
|
||||
mListener.onFragmentInteraction(uri);
|
||||
dialogFilterOptions = new Dialog(ctx, R.style.ThemeOverlay_MaterialComponents_Dialog_Alert);
|
||||
|
||||
if (dialogFilterOptions.getWindow() != null) {
|
||||
|
||||
dialogFilterOptions.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
}
|
||||
|
||||
filterBinding = CustomExploreRepositoriesDialogBinding.inflate(LayoutInflater.from(ctx));
|
||||
|
||||
View view = filterBinding.getRoot();
|
||||
dialogFilterOptions.setContentView(view);
|
||||
|
||||
filterBinding.includeTopic.setOnClickListener(includeTopic -> {
|
||||
|
||||
if(filterBinding.includeTopic.isChecked()) {
|
||||
|
||||
tinyDb.putBoolean("exploreRepoIncludeTopic", true);
|
||||
}
|
||||
else {
|
||||
|
||||
tinyDb.putBoolean("exploreRepoIncludeTopic", false);
|
||||
}
|
||||
});
|
||||
|
||||
filterBinding.includeDesc.setOnClickListener(includeDesc -> {
|
||||
|
||||
if(filterBinding.includeDesc.isChecked()) {
|
||||
|
||||
tinyDb.putBoolean("exploreRepoIncludeDescription", true);
|
||||
}
|
||||
else {
|
||||
|
||||
tinyDb.putBoolean("exploreRepoIncludeDescription", false);
|
||||
}
|
||||
});
|
||||
|
||||
filterBinding.includeTemplate.setOnClickListener(includeTemplate -> {
|
||||
|
||||
if(filterBinding.includeTemplate.isChecked()) {
|
||||
|
||||
tinyDb.putBoolean("exploreRepoIncludeTemplate", true);
|
||||
}
|
||||
else {
|
||||
|
||||
tinyDb.putBoolean("exploreRepoIncludeTemplate", false);
|
||||
}
|
||||
});
|
||||
|
||||
filterBinding.onlyArchived.setOnClickListener(onlyArchived -> {
|
||||
|
||||
if(filterBinding.onlyArchived.isChecked()) {
|
||||
|
||||
tinyDb.putBoolean("exploreRepoOnlyArchived", true);
|
||||
}
|
||||
else {
|
||||
|
||||
tinyDb.putBoolean("exploreRepoOnlyArchived", false);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
filterBinding.includeTopic.setChecked(tinyDb.getBoolean("exploreRepoIncludeTopic"));
|
||||
filterBinding.includeDesc.setChecked(tinyDb.getBoolean("exploreRepoIncludeDescription"));
|
||||
filterBinding.includeTemplate.setChecked(tinyDb.getBoolean("exploreRepoIncludeTemplate"));
|
||||
filterBinding.onlyArchived.setChecked(tinyDb.getBoolean("exploreRepoOnlyArchived"));
|
||||
|
||||
filterBinding.cancel.setOnClickListener(editProperties -> {
|
||||
dialogFilterOptions.dismiss();
|
||||
});
|
||||
|
||||
dialogFilterOptions.show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDetach() {
|
||||
|
||||
super.onDetach();
|
||||
mListener = null;
|
||||
}
|
||||
|
||||
public interface OnFragmentInteractionListener {
|
||||
|
||||
void onFragmentInteraction(Uri uri);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -30,7 +30,6 @@ import org.mian.gitnex.helpers.TinyDB;
|
||||
import org.mian.gitnex.viewmodels.FilesViewModel;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Objects;
|
||||
import moe.feng.common.view.breadcrumbs.BreadcrumbsView;
|
||||
import moe.feng.common.view.breadcrumbs.DefaultBreadcrumbsCallback;
|
||||
import moe.feng.common.view.breadcrumbs.model.BreadcrumbItem;
|
||||
@ -111,7 +110,7 @@ public class FilesFragment extends Fragment implements FilesAdapter.FilesAdapter
|
||||
mBreadcrumbsView = v.findViewById(R.id.breadcrumbs_view);
|
||||
mBreadcrumbsView.setItems(new ArrayList<>(Collections.singletonList(BreadcrumbItem.createSimpleItem(getResources().getString(R.string.filesBreadcrumbRoot) + getResources().getString(R.string.colonDivider) + ref))));
|
||||
|
||||
((RepoDetailActivity) Objects.requireNonNull(getActivity())).setFragmentRefreshListenerFiles(repoBranch -> {
|
||||
((RepoDetailActivity) requireActivity()).setFragmentRefreshListenerFiles(repoBranch -> {
|
||||
|
||||
fileStructure.setText("");
|
||||
ref = repoBranch;
|
||||
@ -198,7 +197,7 @@ public class FilesFragment extends Fragment implements FilesAdapter.FilesAdapter
|
||||
intent.putExtra("singleFileName", fileName);
|
||||
}
|
||||
|
||||
Objects.requireNonNull(getContext()).startActivity(intent);
|
||||
requireContext().startActivity(intent);
|
||||
}
|
||||
|
||||
private void fetchDataAsync(String instanceUrl, String instanceToken, String owner, String repo, String ref) {
|
||||
@ -263,6 +262,7 @@ public class FilesFragment extends Fragment implements FilesAdapter.FilesAdapter
|
||||
@Override
|
||||
public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) {
|
||||
|
||||
menu.clear();
|
||||
inflater.inflate(R.menu.search_menu, menu);
|
||||
inflater.inflate(R.menu.files_switch_branches_menu, menu);
|
||||
super.onCreateOptionsMenu(menu, inflater);
|
||||
|
@ -32,7 +32,6 @@ import org.mian.gitnex.interfaces.ApiInterface;
|
||||
import org.mian.gitnex.models.Issues;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
import retrofit2.Response;
|
||||
@ -112,7 +111,7 @@ public class IssuesFragment extends Fragment {
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(context));
|
||||
recyclerView.setAdapter(adapter);
|
||||
|
||||
((RepoDetailActivity) Objects.requireNonNull(getActivity())).setFragmentRefreshListener(issueState -> {
|
||||
((RepoDetailActivity) requireActivity()).setFragmentRefreshListener(issueState -> {
|
||||
|
||||
if(issueState.equals("closed")) {
|
||||
menu.getItem(1).setIcon(R.drawable.ic_filter_closed);
|
||||
|
@ -27,7 +27,6 @@ import org.mian.gitnex.interfaces.ApiInterface;
|
||||
import org.mian.gitnex.models.Milestones;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
import retrofit2.Response;
|
||||
@ -104,7 +103,7 @@ public class MilestonesFragment extends Fragment {
|
||||
|
||||
}, 50));
|
||||
|
||||
((RepoDetailActivity) Objects.requireNonNull(getActivity())).setFragmentRefreshListenerMilestone(milestoneState -> {
|
||||
((RepoDetailActivity) requireActivity()).setFragmentRefreshListenerMilestone(milestoneState -> {
|
||||
|
||||
if(milestoneState.equals("closed")) {
|
||||
menu.getItem(1).setIcon(R.drawable.ic_filter_closed);
|
||||
|
@ -36,7 +36,6 @@ import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
import retrofit2.Response;
|
||||
@ -79,7 +78,7 @@ public class NotificationsFragment extends Fragment implements NotificationsAdap
|
||||
View v = inflater.inflate(R.layout.fragment_notifications, container, false);
|
||||
setHasOptionsMenu(true);
|
||||
|
||||
activity = Objects.requireNonNull(getActivity());
|
||||
activity = requireActivity();
|
||||
context = getContext();
|
||||
tinyDB = new TinyDB(context);
|
||||
|
||||
@ -337,7 +336,7 @@ public class NotificationsFragment extends Fragment implements NotificationsAdap
|
||||
|
||||
tinyDB.putString("issueNumber", issueUrl.substring(issueUrl.lastIndexOf("/") + 1));
|
||||
tinyDB.putString("issueType", notificationThread.getSubject().getType());
|
||||
tinyDB.putString("repoFullName", notificationThread.getRepository().getFullname());
|
||||
tinyDB.putString("repoFullName", notificationThread.getRepository().getFullName());
|
||||
|
||||
startActivity(intent);
|
||||
|
||||
|
@ -16,12 +16,10 @@ import android.widget.LinearLayout;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.activities.RepoDetailActivity;
|
||||
import org.mian.gitnex.activities.RepoForksActivity;
|
||||
import org.mian.gitnex.activities.RepoStargazersActivity;
|
||||
import org.mian.gitnex.activities.RepoWatchersActivity;
|
||||
import org.mian.gitnex.clients.RetrofitClient;
|
||||
@ -36,7 +34,6 @@ import org.mian.gitnex.models.UserRepositories;
|
||||
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.Markwon;
|
||||
import io.noties.markwon.core.CorePlugin;
|
||||
@ -45,7 +42,6 @@ import io.noties.markwon.ext.strikethrough.StrikethroughPlugin;
|
||||
import io.noties.markwon.ext.tables.TablePlugin;
|
||||
import io.noties.markwon.ext.tasklist.TaskListPlugin;
|
||||
import io.noties.markwon.html.HtmlPlugin;
|
||||
import io.noties.markwon.image.AsyncDrawable;
|
||||
import io.noties.markwon.image.DefaultMediaDecoder;
|
||||
import io.noties.markwon.image.ImageItem;
|
||||
import io.noties.markwon.image.ImagesPlugin;
|
||||
@ -165,17 +161,9 @@ public class RepoInfoFragment extends Fragment {
|
||||
toggleExpandViewMeta();
|
||||
}
|
||||
|
||||
fileContentsFrameHeader.setOnClickListener(new View.OnClickListener() {
|
||||
public void onClick(View v) {
|
||||
toggleExpandView();
|
||||
}
|
||||
});
|
||||
fileContentsFrameHeader.setOnClickListener(v1 -> toggleExpandView());
|
||||
|
||||
repoMetaFrameHeader.setOnClickListener(new View.OnClickListener() {
|
||||
public void onClick(View v) {
|
||||
toggleExpandViewMeta();
|
||||
}
|
||||
});
|
||||
repoMetaFrameHeader.setOnClickListener(v12 -> toggleExpandViewMeta());
|
||||
|
||||
repoMetaStarsFrame.setOnClickListener(metaStars -> {
|
||||
|
||||
@ -184,13 +172,6 @@ public class RepoInfoFragment extends Fragment {
|
||||
ctx.startActivity(intent);
|
||||
});
|
||||
|
||||
repoMetaForksFrame.setOnClickListener(metaForks -> {
|
||||
|
||||
Intent intent = new Intent(ctx, RepoForksActivity.class);
|
||||
intent.putExtra("repoFullNameForForks", repoOwner + "/" + repoName);
|
||||
ctx.startActivity(intent);
|
||||
});
|
||||
|
||||
repoMetaWatchersFrame.setOnClickListener(metaWatchers -> {
|
||||
|
||||
Intent intent = new Intent(ctx, RepoWatchersActivity.class);
|
||||
@ -370,6 +351,13 @@ public class RepoInfoFragment extends Fragment {
|
||||
tinyDb.putBoolean("hasIssues", true);
|
||||
}
|
||||
|
||||
if(repoInfo.isHas_pull_requests()) {
|
||||
tinyDb.putBoolean("hasPullRequests", repoInfo.isHas_pull_requests());
|
||||
}
|
||||
else {
|
||||
tinyDb.putBoolean("hasPullRequests", false);
|
||||
}
|
||||
|
||||
tinyDb.putString("repoHtmlUrl", repoInfo.getHtml_url());
|
||||
|
||||
mProgressBar.setVisibility(View.GONE);
|
||||
@ -412,46 +400,37 @@ public class RepoInfoFragment extends Fragment {
|
||||
|
||||
if (response.code() == 200) {
|
||||
|
||||
final Markwon markwon = Markwon.builder(Objects.requireNonNull(getContext()))
|
||||
final Markwon markwon = Markwon.builder(requireContext())
|
||||
.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) {
|
||||
.usePlugin(ImagesPlugin.create(plugin -> {
|
||||
plugin.addSchemeHandler(new SchemeHandler() {
|
||||
@NonNull
|
||||
@Override
|
||||
public ImageItem handle(@NonNull String raw, @NonNull Uri uri) {
|
||||
|
||||
final int resourceId = getContext().getResources().getIdentifier(
|
||||
raw.substring("drawable://".length()),
|
||||
"drawable",
|
||||
getContext().getPackageName());
|
||||
final int resourceId = requireContext().getResources().getIdentifier(
|
||||
raw.substring("drawable://".length()),
|
||||
"drawable",
|
||||
requireContext().getPackageName());
|
||||
|
||||
final Drawable drawable = getContext().getDrawable(resourceId);
|
||||
final Drawable drawable = requireContext().getDrawable(resourceId);
|
||||
|
||||
assert drawable != null;
|
||||
return ImageItem.withResult(drawable);
|
||||
}
|
||||
assert drawable != null;
|
||||
return ImageItem.withResult(drawable);
|
||||
}
|
||||
|
||||
@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());
|
||||
}
|
||||
@NonNull
|
||||
@Override
|
||||
public Collection<String> supportedSchemes() {
|
||||
return Collections.singleton("drawable");
|
||||
}
|
||||
});
|
||||
plugin.placeholderProvider(drawable -> null);
|
||||
plugin.addMediaDecoder(GifMediaDecoder.create(false));
|
||||
plugin.addMediaDecoder(SvgMediaDecoder.create(requireContext().getResources()));
|
||||
plugin.addMediaDecoder(SvgMediaDecoder.create());
|
||||
plugin.defaultMediaDecoder(DefaultMediaDecoder.create(requireContext().getResources()));
|
||||
plugin.defaultMediaDecoder(DefaultMediaDecoder.create());
|
||||
}))
|
||||
.usePlugin(new AbstractMarkwonPlugin() {
|
||||
@Override
|
||||
@ -462,8 +441,8 @@ public class RepoInfoFragment extends Fragment {
|
||||
.linkColor(getResources().getColor(R.color.lightBlue));
|
||||
}
|
||||
})
|
||||
.usePlugin(TablePlugin.create(getContext()))
|
||||
.usePlugin(TaskListPlugin.create(getContext()))
|
||||
.usePlugin(TablePlugin.create(requireContext()))
|
||||
.usePlugin(TaskListPlugin.create(requireContext()))
|
||||
.usePlugin(HtmlPlugin.create())
|
||||
.usePlugin(StrikethroughPlugin.create())
|
||||
.usePlugin(LinkifyPlugin.create())
|
||||
|
@ -0,0 +1,190 @@
|
||||
package org.mian.gitnex.fragments;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import org.mian.gitnex.adapters.SearchIssuesAdapter;
|
||||
import org.mian.gitnex.clients.RetrofitClient;
|
||||
import org.mian.gitnex.databinding.FragmentSearchIssuesBinding;
|
||||
import org.mian.gitnex.helpers.AppUtil;
|
||||
import org.mian.gitnex.helpers.Authorization;
|
||||
import org.mian.gitnex.helpers.InfiniteScrollListener;
|
||||
import org.mian.gitnex.helpers.TinyDB;
|
||||
import org.mian.gitnex.models.Issues;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
import retrofit2.Response;
|
||||
|
||||
/**
|
||||
* Author M M Arif
|
||||
*/
|
||||
|
||||
public class SearchIssuesFragment extends Fragment {
|
||||
|
||||
private Context ctx;
|
||||
private TinyDB tinyDb;
|
||||
private FragmentSearchIssuesBinding viewBinding;
|
||||
private SearchIssuesAdapter adapter;
|
||||
private List<Issues> dataList;
|
||||
|
||||
private String instanceUrl;
|
||||
private String loginUid;
|
||||
private String instanceToken;
|
||||
|
||||
private int apiCallCurrentValue = 10;
|
||||
private int pageCurrentIndex = 1;
|
||||
private String type = "issues";
|
||||
private String state = "open";
|
||||
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
|
||||
viewBinding = FragmentSearchIssuesBinding.inflate(inflater, container, false);
|
||||
setHasOptionsMenu(true);
|
||||
|
||||
ctx = getContext();
|
||||
tinyDb = new TinyDB(getContext());
|
||||
|
||||
instanceUrl = tinyDb.getString("instanceUrl");
|
||||
loginUid = tinyDb.getString("loginUid");
|
||||
instanceToken = "token " + tinyDb.getString(loginUid + "-token");
|
||||
|
||||
dataList = new ArrayList<>();
|
||||
adapter = new SearchIssuesAdapter(dataList, ctx);
|
||||
|
||||
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(ctx);
|
||||
|
||||
viewBinding.recyclerViewSearchIssues.setHasFixedSize(true);
|
||||
viewBinding.recyclerViewSearchIssues.setLayoutManager(linearLayoutManager);
|
||||
viewBinding.recyclerViewSearchIssues.setAdapter(adapter);
|
||||
|
||||
viewBinding.searchKeyword.setOnEditorActionListener((v1, actionId, event) -> {
|
||||
|
||||
if(actionId == EditorInfo.IME_ACTION_SEND) {
|
||||
|
||||
if(!Objects.requireNonNull(viewBinding.searchKeyword.getText()).toString().equals("")) {
|
||||
|
||||
InputMethodManager imm = (InputMethodManager) requireActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
imm.hideSoftInputFromWindow(viewBinding.searchKeyword.getWindowToken(), 0);
|
||||
|
||||
pageCurrentIndex = 1;
|
||||
apiCallCurrentValue = 10;
|
||||
viewBinding.progressBar.setVisibility(View.VISIBLE);
|
||||
loadData(false, viewBinding.searchKeyword.getText().toString());
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
viewBinding.recyclerViewSearchIssues.addOnScrollListener(new InfiniteScrollListener(pageCurrentIndex, linearLayoutManager) {
|
||||
|
||||
@Override
|
||||
public void onScrolledToEnd(int firstVisibleItemPosition) {
|
||||
|
||||
pageCurrentIndex++;
|
||||
loadData(true, Objects.requireNonNull(viewBinding.searchKeyword.getText()).toString());
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
viewBinding.pullToRefresh.setOnRefreshListener(() -> {
|
||||
|
||||
pageCurrentIndex = 1;
|
||||
apiCallCurrentValue = 10;
|
||||
loadData(false, Objects.requireNonNull(viewBinding.searchKeyword.getText()).toString());
|
||||
|
||||
});
|
||||
|
||||
loadData(false, "");
|
||||
|
||||
return viewBinding.getRoot();
|
||||
}
|
||||
|
||||
private void loadData(boolean append, String searchKeyword) {
|
||||
|
||||
viewBinding.noData.setVisibility(View.GONE);
|
||||
|
||||
int apiCallDefaultLimit = 10;
|
||||
if(apiCallDefaultLimit > apiCallCurrentValue) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(pageCurrentIndex == 1 || !append) {
|
||||
|
||||
dataList.clear();
|
||||
adapter.notifyDataSetChanged();
|
||||
viewBinding.pullToRefresh.setRefreshing(false);
|
||||
viewBinding.progressBar.setVisibility(View.VISIBLE);
|
||||
}
|
||||
else {
|
||||
|
||||
viewBinding.loadingMoreView.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
Call<List<Issues>> call = RetrofitClient.getInstance(instanceUrl, getContext()).getApiInterface().queryIssues(
|
||||
Authorization.returnAuthentication(getContext(), loginUid, instanceToken), searchKeyword, type, state, pageCurrentIndex);
|
||||
|
||||
call.enqueue(new Callback<List<Issues>>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(@NonNull Call<List<Issues>> call, @NonNull Response<List<Issues>> response) {
|
||||
|
||||
if(response.code() == 200) {
|
||||
|
||||
assert response.body() != null;
|
||||
apiCallCurrentValue = response.body().size();
|
||||
|
||||
if(!append) {
|
||||
|
||||
dataList.clear();
|
||||
}
|
||||
|
||||
dataList.addAll(response.body());
|
||||
adapter.notifyDataSetChanged();
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
dataList.clear();
|
||||
adapter.notifyDataChanged();
|
||||
viewBinding.noData.setVisibility(View.VISIBLE);
|
||||
|
||||
}
|
||||
|
||||
onCleanup();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(@NonNull Call<List<Issues>> call, @NonNull Throwable t) {
|
||||
|
||||
Log.e("onFailure", Objects.requireNonNull(t.getMessage()));
|
||||
onCleanup();
|
||||
|
||||
}
|
||||
|
||||
private void onCleanup() {
|
||||
|
||||
AppUtil.setMultiVisibility(View.GONE, viewBinding.loadingMoreView, viewBinding.progressBar);
|
||||
|
||||
if(dataList.isEmpty()) {
|
||||
|
||||
viewBinding.noData.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
@ -1,6 +1,8 @@
|
||||
package org.mian.gitnex.fragments;
|
||||
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@ -17,7 +19,6 @@ import org.mian.gitnex.activities.SettingsReportsActivity;
|
||||
import org.mian.gitnex.activities.SettingsSecurityActivity;
|
||||
import org.mian.gitnex.activities.SettingsTranslationActivity;
|
||||
import org.mian.gitnex.helpers.TinyDB;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Author M M Arif
|
||||
@ -37,6 +38,8 @@ public class SettingsFragment extends Fragment {
|
||||
LinearLayout securityFrame = v.findViewById(R.id.securityFrame);
|
||||
LinearLayout languagesFrame = v.findViewById(R.id.languagesFrame);
|
||||
LinearLayout reportsFrame = v.findViewById(R.id.reportsFrame);
|
||||
LinearLayout rateAppFrame = v.findViewById(R.id.rateAppFrame);
|
||||
LinearLayout aboutAppFrame = v.findViewById(R.id.aboutAppFrame);
|
||||
|
||||
appearanceFrame.setOnClickListener(v1 -> startActivity(new Intent(getContext(), SettingsAppearanceActivity.class)));
|
||||
|
||||
@ -50,10 +53,24 @@ public class SettingsFragment extends Fragment {
|
||||
|
||||
reportsFrame.setOnClickListener(v1 -> startActivity(new Intent(getContext(), SettingsReportsActivity.class)));
|
||||
|
||||
rateAppFrame.setOnClickListener(aboutApp -> rateThisApp());
|
||||
|
||||
aboutAppFrame.setOnClickListener(aboutApp -> requireActivity().getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new AboutFragment()).commit());
|
||||
|
||||
return v;
|
||||
|
||||
}
|
||||
|
||||
public void rateThisApp() {
|
||||
|
||||
try {
|
||||
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + requireActivity().getPackageName())));
|
||||
}
|
||||
catch(ActivityNotFoundException e) {
|
||||
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + requireActivity().getPackageName())));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
|
||||
@ -62,8 +79,8 @@ public class SettingsFragment extends Fragment {
|
||||
TinyDB tinyDb = new TinyDB(getContext());
|
||||
|
||||
if(tinyDb.getBoolean("refreshParent")) {
|
||||
Objects.requireNonNull(getActivity()).recreate();
|
||||
getActivity().overridePendingTransition(0, 0);
|
||||
requireActivity().recreate();
|
||||
requireActivity().overridePendingTransition(0, 0);
|
||||
tinyDb.putBoolean("refreshParent", false);
|
||||
}
|
||||
|
||||
|
@ -76,6 +76,10 @@ public class AppUtil {
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isPro(Context context) {
|
||||
return context.getPackageName().equals("org.mian.gitnex.pro");
|
||||
}
|
||||
|
||||
public int charactersLength(String str) {
|
||||
|
||||
return str.length();
|
||||
|
@ -3,7 +3,6 @@ package org.mian.gitnex.helpers;
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
import org.mian.gitnex.R;
|
||||
@ -18,17 +17,16 @@ public class ClickListener implements View.OnClickListener {
|
||||
private Context mCtx;
|
||||
|
||||
public ClickListener(String infoText, Context mCtx) {
|
||||
|
||||
this.infoText = infoText;
|
||||
this.mCtx = mCtx;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v)
|
||||
{
|
||||
public void onClick(View v) {
|
||||
|
||||
LayoutInflater inflater1 = LayoutInflater.from(mCtx);
|
||||
View layout = inflater1.inflate(R.layout.custom_toast_success,
|
||||
(ViewGroup) v.findViewById(R.id.custom_toast_container));
|
||||
View layout = inflater1.inflate(R.layout.custom_toast_info, v.findViewById(R.id.custom_toast_container));
|
||||
|
||||
TextView text = layout.findViewById(R.id.toastText);
|
||||
text.setText(infoText);
|
||||
|
@ -24,6 +24,21 @@ public class Version {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* valid return true if string is a valid version
|
||||
*
|
||||
* @param value
|
||||
* @return
|
||||
*/
|
||||
public static boolean valid(String value) {
|
||||
|
||||
if(value == null) {
|
||||
return false;
|
||||
}
|
||||
final Pattern pattern_valid = Pattern.compile("^[v,V]?(\\d+)+(\\.(\\d+))*([_,\\-,+][\\w,\\d,_,\\-,+]*)?$");
|
||||
return pattern_valid.matcher(value).find();
|
||||
}
|
||||
|
||||
/**
|
||||
* init parse and store values for other functions of an Version instance
|
||||
* it use the raw variable as base
|
||||
@ -32,10 +47,9 @@ public class Version {
|
||||
*/
|
||||
private void init() {
|
||||
|
||||
final Pattern pattern_valid = Pattern.compile("^[v,V]?(\\d+)+(\\.(\\d+))*([_,\\-,+][\\w,\\d,_,\\-,+]*)?$");
|
||||
final Pattern pattern_number_dot_number = Pattern.compile("^\\d+(\\.(\\d)+)*");
|
||||
|
||||
if(!pattern_valid.matcher(raw).find()) {
|
||||
if(!valid(raw)) {
|
||||
throw new IllegalArgumentException("Invalid version format");
|
||||
}
|
||||
|
||||
|
@ -7,6 +7,7 @@ import org.mian.gitnex.models.Collaborators;
|
||||
import org.mian.gitnex.models.Commits;
|
||||
import org.mian.gitnex.models.CreateIssue;
|
||||
import org.mian.gitnex.models.CreateLabel;
|
||||
import org.mian.gitnex.models.CreatePullRequest;
|
||||
import org.mian.gitnex.models.DeleteFile;
|
||||
import org.mian.gitnex.models.EditFile;
|
||||
import org.mian.gitnex.models.Emails;
|
||||
@ -19,6 +20,7 @@ import org.mian.gitnex.models.Labels;
|
||||
import org.mian.gitnex.models.MergePullRequest;
|
||||
import org.mian.gitnex.models.Milestones;
|
||||
import org.mian.gitnex.models.NewFile;
|
||||
import org.mian.gitnex.models.NotificationCount;
|
||||
import org.mian.gitnex.models.NotificationThread;
|
||||
import org.mian.gitnex.models.OrgOwner;
|
||||
import org.mian.gitnex.models.Organization;
|
||||
@ -26,6 +28,7 @@ import org.mian.gitnex.models.OrganizationRepository;
|
||||
import org.mian.gitnex.models.Permission;
|
||||
import org.mian.gitnex.models.PullRequests;
|
||||
import org.mian.gitnex.models.Releases;
|
||||
import org.mian.gitnex.models.RepositoryTransfer;
|
||||
import org.mian.gitnex.models.Teams;
|
||||
import org.mian.gitnex.models.UpdateIssueAssignees;
|
||||
import org.mian.gitnex.models.UpdateIssueState;
|
||||
@ -92,7 +95,7 @@ public interface ApiInterface {
|
||||
Call<ResponseBody> markNotificationThreadsAsRead(@Header("Authorization") String token, @Query("last_read_at") String last_read_at, @Query("all") Boolean all, @Query("status-types") String[] statusTypes, @Query("to-status") String toStatus);
|
||||
|
||||
@GET("notifications/new") // Check if unread notifications exist
|
||||
Call<JsonElement> checkUnreadNotifications(@Header("Authorization") String token);
|
||||
Call<NotificationCount> checkUnreadNotifications(@Header("Authorization") String token);
|
||||
|
||||
@GET("notifications/threads/{id}") // Get notification thread by ID
|
||||
Call<NotificationThread> getNotificationThread(@Header("Authorization") String token, @Path("id") Integer id);
|
||||
@ -127,6 +130,15 @@ public interface ApiInterface {
|
||||
@GET("repos/{owner}/{repo}") // get repo information
|
||||
Call<UserRepositories> getUserRepository(@Header("Authorization") String token, @Path("owner") String ownerName, @Path("repo") String repoName);
|
||||
|
||||
@PATCH("repos/{owner}/{repo}") // patch/update repository properties
|
||||
Call<UserRepositories> updateRepositoryProperties(@Header("Authorization") String token, @Path("owner") String ownerName, @Path("repo") String repoName, @Body UserRepositories jsonStr);
|
||||
|
||||
@DELETE("repos/{owner}/{repo}") // delete repository
|
||||
Call<JsonElement> deleteRepository(@Header("Authorization") String token, @Path("owner") String ownerName, @Path("repo") String repoName);
|
||||
|
||||
@POST("repos/{owner}/{repo}/transfer") // transfer repository
|
||||
Call<JsonElement> transferRepository(@Header("Authorization") String token, @Path("owner") String ownerName, @Path("repo") String repoName, @Body RepositoryTransfer jsonStr);
|
||||
|
||||
@GET("repos/{owner}/{repo}/issues") // get issues by repo
|
||||
Call<List<Issues>> getIssues(@Header("Authorization") String token, @Path("owner") String owner, @Path("repo") String repo, @Query("page") int page, @Query("limit") int limit, @Query("type") String requestType, @Query("state") String issueState);
|
||||
|
||||
@ -254,7 +266,10 @@ public interface ApiInterface {
|
||||
Call<List<UserInfo>> getRepoWatchers(@Header("Authorization") String token, @Path("owner") String ownerName, @Path("repo") String repoName);
|
||||
|
||||
@GET("repos/search") // get all the repos which match the query string
|
||||
Call<ExploreRepositories> queryRepos(@Header("Authorization") String token, @Query("q") String searchKeyword, @Query("private") Boolean repoTypeInclude, @Query("sort") String sort, @Query("order") String order, @Query("limit") int limit);
|
||||
Call<ExploreRepositories> queryRepos(@Header("Authorization") String token, @Query("q") String searchKeyword, @Query("private") Boolean repoTypeInclude, @Query("sort") String sort, @Query("order") String order, @Query("topic") boolean topic, @Query("includeDesc") boolean includeDesc, @Query("template") boolean template, @Query("archived") boolean archived, @Query("limit") int limit, @Query("page") int page);
|
||||
|
||||
@GET("repos/issues/search") // get all the issues which match the query string
|
||||
Call<List<Issues>> queryIssues(@Header("Authorization") String token, @Query("q") String searchKeyword, @Query("type") String type, @Query("state") String state, @Query("page") int page);
|
||||
|
||||
@POST("repos/{owner}/{repo}/contents/{file}") // create new file
|
||||
Call<JsonElement> createNewFile(@Header("Authorization") String token, @Path("owner") String ownerName, @Path("repo") String repoName, @Path("file") String fileName, @Body NewFile jsonStr);
|
||||
@ -310,6 +325,9 @@ public interface ApiInterface {
|
||||
@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);
|
||||
|
||||
@POST("repos/{owner}/{repo}/pulls") // create a pull request
|
||||
Call<ResponseBody> createPullRequest(@Header("Authorization") String token, @Path("owner") String ownerName, @Path("repo") String repoName, @Body CreatePullRequest jsonStr);
|
||||
|
||||
@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, @Query("limit") int limit);
|
||||
|
||||
|
@ -0,0 +1,36 @@
|
||||
package org.mian.gitnex.models;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* Author M M Arif
|
||||
*/
|
||||
|
||||
public class CreatePullRequest {
|
||||
|
||||
private String title;
|
||||
private String body;
|
||||
private String assignee;
|
||||
private String base;
|
||||
private String head;
|
||||
private int milestone;
|
||||
private String due_date;
|
||||
private String message;
|
||||
|
||||
private ArrayList<String> assignees;
|
||||
private ArrayList<Integer> labels;
|
||||
|
||||
public CreatePullRequest(String title, String body, String assignee, String base, String head, int milestone, String due_date, ArrayList<String> assignees, ArrayList<Integer> labels) {
|
||||
|
||||
this.title = title;
|
||||
this.body = body;
|
||||
this.assignee = assignee;
|
||||
this.base = base; // merge into branch
|
||||
this.head = head; // pull from branch
|
||||
this.milestone = milestone;
|
||||
this.due_date = due_date;
|
||||
this.assignees = assignees;
|
||||
this.labels = labels;
|
||||
}
|
||||
|
||||
}
|
@ -27,6 +27,7 @@ public class Issues {
|
||||
private pullRequestObject pull_request;
|
||||
private milestoneObject milestone;
|
||||
private List<assigneesObject> assignees;
|
||||
private repositoryObject repository;
|
||||
|
||||
public Issues(String body) {
|
||||
this.body = body;
|
||||
@ -193,6 +194,35 @@ public class Issues {
|
||||
}
|
||||
}
|
||||
|
||||
public static class repositoryObject {
|
||||
|
||||
private int id;
|
||||
private String full_name;
|
||||
private String name;
|
||||
private String owner;
|
||||
|
||||
public int getId() {
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getFull_name() {
|
||||
|
||||
return full_name;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getOwner() {
|
||||
|
||||
return owner;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
@ -267,4 +297,9 @@ public class Issues {
|
||||
this.html_url = html_url;
|
||||
}
|
||||
|
||||
public repositoryObject getRepository() {
|
||||
|
||||
return repository;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -21,6 +21,11 @@ public class Labels {
|
||||
this.labels = labels;
|
||||
}
|
||||
|
||||
public Labels(int id, String name) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
@ -0,0 +1,19 @@
|
||||
package org.mian.gitnex.models;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
/**
|
||||
* Author M M Arif
|
||||
*/
|
||||
|
||||
public class NotificationCount {
|
||||
|
||||
@SerializedName("new")
|
||||
private int counter;
|
||||
|
||||
public int getCounter() {
|
||||
|
||||
return counter;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package org.mian.gitnex.models;
|
||||
|
||||
/**
|
||||
* Author M M Arif
|
||||
*/
|
||||
|
||||
public class RepositoryTransfer {
|
||||
|
||||
private String new_owner;
|
||||
|
||||
public RepositoryTransfer(String new_owner) {
|
||||
|
||||
this.new_owner = new_owner;
|
||||
}
|
||||
|
||||
public String getNew_owner() {
|
||||
|
||||
return new_owner;
|
||||
}
|
||||
}
|
@ -32,12 +32,134 @@ public class UserRepositories {
|
||||
private Boolean has_issues;
|
||||
private String avatar_url;
|
||||
private boolean archived;
|
||||
private boolean allow_merge_commits;
|
||||
private boolean allow_rebase;
|
||||
private boolean allow_rebase_explicit;
|
||||
private boolean allow_squash_merge;
|
||||
private boolean has_pull_requests;
|
||||
private boolean has_wiki;
|
||||
private boolean ignore_whitespace_conflicts;
|
||||
private boolean template;
|
||||
|
||||
private permissionsObject permissions;
|
||||
private externalIssueTrackerObject external_tracker;
|
||||
private externalWikiObject external_wiki;
|
||||
private internalTimeTrackerObject internal_tracker;
|
||||
|
||||
public UserRepositories(String body) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
private permissionsObject permissions;
|
||||
public UserRepositories(String name, String website, String description,
|
||||
boolean repoPrivate, boolean repoAsTemplate, boolean repoEnableIssues,
|
||||
boolean repoEnableWiki, boolean repoEnablePr,
|
||||
boolean repoEnableMerge, boolean repoEnableRebase, boolean repoEnableSquash, boolean repoEnableForceMerge) {
|
||||
|
||||
this.name = name;
|
||||
this.website = website;
|
||||
this.description = description;
|
||||
this.privateFlag = repoPrivate;
|
||||
this.template = repoAsTemplate;
|
||||
this.has_issues = repoEnableIssues;
|
||||
this.has_wiki = repoEnableWiki;
|
||||
this.has_pull_requests = repoEnablePr;
|
||||
this.allow_merge_commits = repoEnableMerge;
|
||||
this.allow_rebase = repoEnableRebase;
|
||||
this.allow_squash_merge = repoEnableSquash;
|
||||
this.allow_rebase_explicit = repoEnableForceMerge;
|
||||
}
|
||||
|
||||
public UserRepositories(String name, String website, String description,
|
||||
boolean repoPrivate, boolean repoAsTemplate, boolean repoEnableIssues,
|
||||
boolean repoEnableWiki, boolean repoEnablePr, internalTimeTrackerObject repoEnableTimer,
|
||||
boolean repoEnableMerge, boolean repoEnableRebase, boolean repoEnableSquash, boolean repoEnableForceMerge) {
|
||||
|
||||
this.name = name;
|
||||
this.website = website;
|
||||
this.description = description;
|
||||
this.privateFlag = repoPrivate;
|
||||
this.template = repoAsTemplate;
|
||||
this.has_issues = repoEnableIssues;
|
||||
this.has_wiki = repoEnableWiki;
|
||||
this.has_pull_requests = repoEnablePr;
|
||||
this.internal_tracker = repoEnableTimer;
|
||||
this.allow_merge_commits = repoEnableMerge;
|
||||
this.allow_rebase = repoEnableRebase;
|
||||
this.allow_squash_merge = repoEnableSquash;
|
||||
this.allow_rebase_explicit = repoEnableForceMerge;
|
||||
}
|
||||
|
||||
public static class internalTimeTrackerObject {
|
||||
|
||||
private boolean allow_only_contributors_to_track_time;
|
||||
private boolean enable_issue_dependencies;
|
||||
private boolean enable_time_tracker;
|
||||
|
||||
public internalTimeTrackerObject(boolean enable_time_tracker) {
|
||||
|
||||
this.enable_time_tracker = enable_time_tracker;
|
||||
}
|
||||
|
||||
public boolean isAllow_only_contributors_to_track_time() {
|
||||
|
||||
return allow_only_contributors_to_track_time;
|
||||
}
|
||||
|
||||
public boolean isEnable_issue_dependencies() {
|
||||
|
||||
return enable_issue_dependencies;
|
||||
}
|
||||
|
||||
public boolean isEnable_time_tracker() {
|
||||
|
||||
return enable_time_tracker;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class externalWikiObject {
|
||||
|
||||
private String external_wiki_url;
|
||||
|
||||
public externalWikiObject(String external_wiki_url) {
|
||||
|
||||
this.external_wiki_url = external_wiki_url;
|
||||
}
|
||||
|
||||
public String getExternal_wiki_url() {
|
||||
|
||||
return external_wiki_url;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class externalIssueTrackerObject {
|
||||
|
||||
private String external_tracker_format;
|
||||
private String external_tracker_style;
|
||||
private String external_tracker_url;
|
||||
|
||||
public externalIssueTrackerObject(String external_tracker_url) {
|
||||
|
||||
this.external_tracker_url = external_tracker_url;
|
||||
}
|
||||
|
||||
public String getExternal_tracker_format() {
|
||||
|
||||
return external_tracker_format;
|
||||
}
|
||||
|
||||
public String getExternal_tracker_style() {
|
||||
|
||||
return external_tracker_style;
|
||||
}
|
||||
|
||||
public String getExternal_tracker_url() {
|
||||
|
||||
return external_tracker_url;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class permissionsObject {
|
||||
|
||||
@ -72,7 +194,7 @@ public class UserRepositories {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getFullname() {
|
||||
public String getFullName() {
|
||||
|
||||
return full_name;
|
||||
}
|
||||
@ -192,4 +314,64 @@ public class UserRepositories {
|
||||
return archived;
|
||||
}
|
||||
|
||||
public String getFull_name() {
|
||||
|
||||
return full_name;
|
||||
}
|
||||
|
||||
public boolean isAllow_merge_commits() {
|
||||
|
||||
return allow_merge_commits;
|
||||
}
|
||||
|
||||
public boolean isAllow_rebase() {
|
||||
|
||||
return allow_rebase;
|
||||
}
|
||||
|
||||
public boolean isAllow_rebase_explicit() {
|
||||
|
||||
return allow_rebase_explicit;
|
||||
}
|
||||
|
||||
public boolean isAllow_squash_merge() {
|
||||
|
||||
return allow_squash_merge;
|
||||
}
|
||||
|
||||
public boolean isHas_pull_requests() {
|
||||
|
||||
return has_pull_requests;
|
||||
}
|
||||
|
||||
public boolean isHas_wiki() {
|
||||
|
||||
return has_wiki;
|
||||
}
|
||||
|
||||
public boolean isIgnore_whitespace_conflicts() {
|
||||
|
||||
return ignore_whitespace_conflicts;
|
||||
}
|
||||
|
||||
public boolean isTemplate() {
|
||||
|
||||
return template;
|
||||
}
|
||||
|
||||
public externalIssueTrackerObject getExternal_tracker() {
|
||||
|
||||
return external_tracker;
|
||||
}
|
||||
|
||||
public externalWikiObject getExternal_wiki() {
|
||||
|
||||
return external_wiki;
|
||||
}
|
||||
|
||||
public internalTimeTrackerObject getInternal_tracker() {
|
||||
|
||||
return internal_tracker;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,46 +1,78 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="135.47"
|
||||
android:viewportHeight="135.47">
|
||||
<path
|
||||
android:pathData="M68.02,66.305m-94.784,-6.397a94.999,94.999 48.861,1 1,189.567 12.793a94.999,94.999 48.861,1 1,-189.567 -12.793"
|
||||
android:strokeWidth="1.40255427"
|
||||
android:fillColor="#39404a"/>
|
||||
<path
|
||||
android:pathData="M31.738,45.193a9.139,9.151 63.873,1 0,12.769 -13.108a9.139,9.151 63.873,1 0,-12.769 13.108z"
|
||||
android:strokeWidth="0.99999666"
|
||||
android:fillColor="#609926"/>
|
||||
<path
|
||||
android:pathData="M31.875,115.115a9.139,9.151 63.873,1 0,12.769 -13.108a9.139,9.151 63.873,1 0,-12.769 13.108z"
|
||||
android:strokeWidth="0.99999666"
|
||||
android:fillColor="#609926"/>
|
||||
<path
|
||||
android:pathData="M61.361,80.42a9.139,9.151 63.873,1 0,12.769 -13.108a9.139,9.151 63.873,1 0,-12.769 13.108z"
|
||||
android:strokeWidth="0.99999666"
|
||||
android:fillColor="#609926"/>
|
||||
<path
|
||||
android:pathData="M34.37,18.911l7.038,0.003l-0.096,85.655l-7.038,-0.003z"
|
||||
android:fillColor="#609926"/>
|
||||
<path
|
||||
android:pathData="m37.878,38.707c31.743,0.128 29.614,-4.427 29.723,36.496"
|
||||
android:strokeWidth="8.72550011"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#609926"/>
|
||||
<path
|
||||
android:pathData="m97.323,109.027c-31.743,-0.128 -29.614,4.427 -29.723,-36.496"
|
||||
android:strokeWidth="8.72550011"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#609926"/>
|
||||
<path
|
||||
android:pathData="M90.959,45.193a9.139,9.151 63.873,1 0,12.769 -13.108a9.139,9.151 63.873,1 0,-12.769 13.108z"
|
||||
android:strokeWidth="0.99999666"
|
||||
android:fillColor="#609926"/>
|
||||
<path
|
||||
android:pathData="M90.955,115.117a9.139,9.151 63.873,1 0,12.769 -13.108a9.139,9.151 63.873,1 0,-12.769 13.108z"
|
||||
android:strokeWidth="0.99999666"
|
||||
android:fillColor="#609926"/>
|
||||
<path
|
||||
android:pathData="M93.872,35.636l7.038,0.002l-0.096,68.927l-7.038,-0.002z"
|
||||
android:fillColor="#609926"/>
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<group android:scaleX="0"
|
||||
android:scaleY="0"
|
||||
android:translateX="54"
|
||||
android:translateY="54">
|
||||
<path android:fillColor="#3DDC84"
|
||||
android:pathData="M0,0h108v108h-108z"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M9,0L9,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,0L19,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M29,0L29,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M39,0L39,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M49,0L49,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M59,0L59,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M69,0L69,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M79,0L79,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M89,0L89,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M99,0L99,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,9L108,9"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,19L108,19"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,29L108,29"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,39L108,39"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,49L108,49"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,59L108,59"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,69L108,69"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,79L108,79"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,89L108,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,99L108,99"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,29L89,29"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,39L89,39"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,49L89,49"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,59L89,59"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,69L89,69"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,79L89,79"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M29,19L29,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M39,19L39,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M49,19L49,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M59,19L59,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M69,19L69,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M79,19L79,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
</group>
|
||||
</vector>
|
||||
|
27
app/src/main/res/drawable/ic_commit.xml
Normal file
@ -0,0 +1,27 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M12,12m-4,0a4,4 0,1 1,8 0a4,4 0,1 1,-8 0"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="?attr/iconsColor"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M1.05,12L7,12"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="?attr/iconsColor"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M17.01,12L22.96,12"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="?attr/iconsColor"
|
||||
android:strokeLineCap="round"/>
|
||||
</vector>
|
20
app/src/main/res/drawable/ic_issue_closed_red.xml
Normal file
@ -0,0 +1,20 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M22,11.08V12a10,10 0,1 1,-5.93 -9.14"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="@color/iconIssuePrClosedColor"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M22,4l-10,10.01l-3,-3"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="@color/iconIssuePrClosedColor"
|
||||
android:strokeLineCap="round"/>
|
||||
</vector>
|
12
app/src/main/res/drawable/ic_migrate.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="?attr/iconsColor"
|
||||
android:pathData="M4.75,0A2.75,2.75 0,0 0,2 2.75v16.5A2.75,2.75 0,0 0,4.75 22h11a0.75,0.75 0,0 0,0 -1.5h-11c-0.69,0 -1.25,-0.56 -1.25,-1.25V18A1.5,1.5 0,0 1,5 16.5h7.25a0.75,0.75 0,0 0,0 -1.5H5c-0.546,0 -1.059,0.146 -1.5,0.401V2.75c0,-0.69 0.56,-1.25 1.25,-1.25H18.5v7a0.75,0.75 0,0 0,1.5 0V0.75a0.75,0.75 0,0 0,-0.75 -0.75H4.75z"/>
|
||||
<path
|
||||
android:fillColor="?attr/iconsColor"
|
||||
android:pathData="M20,13.903l2.202,2.359a0.75,0.75 0,0 0,1.096 -1.024l-3.5,-3.75a0.75,0.75 0,0 0,-1.096 0l-3.5,3.75a0.75,0.75 0,1 0,1.096 1.024l2.202,-2.36v9.348a0.75,0.75 0,0 0,1.5 0v-9.347z"/>
|
||||
</vector>
|
34
app/src/main/res/drawable/ic_pull_request_closed.xml
Normal file
@ -0,0 +1,34 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M18,18m-3,0a3,3 0,1 1,6 0a3,3 0,1 1,-6 0"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="@color/iconIssuePrClosedColor"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M6,6m-3,0a3,3 0,1 1,6 0a3,3 0,1 1,-6 0"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="@color/iconIssuePrClosedColor"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M13,6h3a2,2 0,0 1,2 2v7"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="@color/iconIssuePrClosedColor"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M6,9L6,21"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="@color/iconIssuePrClosedColor"
|
||||
android:strokeLineCap="round"/>
|
||||
</vector>
|
34
app/src/main/res/drawable/ic_pull_request_merged.xml
Normal file
@ -0,0 +1,34 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M18,18m-3,0a3,3 0,1 1,6 0a3,3 0,1 1,-6 0"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="@color/iconPrMergedColor"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M6,6m-3,0a3,3 0,1 1,6 0a3,3 0,1 1,-6 0"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="@color/iconPrMergedColor"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M13,6h3a2,2 0,0 1,2 2v7"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="@color/iconPrMergedColor"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M6,9L6,21"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="@color/iconPrMergedColor"
|
||||
android:strokeLineCap="round"/>
|
||||
</vector>
|
@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle" >
|
||||
<solid android:color="?attr/primaryBackgroundColor"/>
|
||||
<corners android:radius="8dp"/>
|
||||
|
||||
</shape>
|
||||
|
@ -55,65 +55,91 @@
|
||||
android:padding="16dp"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="wrap_content"
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/protocolSpinnerLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:background="@drawable/shape_dropdown">
|
||||
app:boxBackgroundColor="?attr/inputBackgroundColor"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
app:hintTextColor="?attr/hintColor"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:hint="@string/protocol"
|
||||
app:endIconTint="?attr/iconsColor"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox.ExposedDropdownMenu">
|
||||
|
||||
<Spinner
|
||||
<AutoCompleteTextView
|
||||
android:id="@+id/protocolSpinner"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="44dp"
|
||||
android:padding="10dp"
|
||||
android:spinnerMode="dropdown" />
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="none"
|
||||
android:textColor="?attr/inputTextColor"
|
||||
android:labelFor="@+id/protocolSpinner"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</RelativeLayout>
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/instanceUrl"
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/instanceUrlLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:background="@drawable/shape_inputs"
|
||||
android:drawableStart="@drawable/ic_link"
|
||||
android:drawablePadding="10dp"
|
||||
android:hint="@string/instanceUrl"
|
||||
android:inputType="textUri"
|
||||
android:padding="10dp"
|
||||
android:textColor="?attr/inputTextColor"
|
||||
android:textColorHighlight="?attr/hintColor"
|
||||
app:boxBackgroundColor="?attr/inputBackgroundColor"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
android:textSize="14sp"
|
||||
android:autofillHints="@string/instanceUrl" />
|
||||
app:hintTextColor="?attr/hintColor"
|
||||
app:boxStrokeErrorColor="@color/darkRed"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:startIconDrawable="@drawable/ic_link"
|
||||
app:startIconTint="?attr/iconsColor"
|
||||
app:endIconMode="clear_text"
|
||||
app:endIconTint="?attr/iconsColor"
|
||||
android:hint="@string/instanceUrl">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/loginToken"
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/instanceUrl"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?attr/inputTextColor"
|
||||
android:textColorHighlight="?attr/hintColor"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
android:maxLines="1"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/loginTokenLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:background="@drawable/shape_inputs"
|
||||
android:drawableStart="@drawable/ic_lock"
|
||||
android:drawablePadding="10dp"
|
||||
android:hint="@string/copyToken"
|
||||
android:inputType="text"
|
||||
android:padding="10dp"
|
||||
android:textColor="?attr/inputTextColor"
|
||||
android:textColorHighlight="?attr/hintColor"
|
||||
app:boxBackgroundColor="?attr/inputBackgroundColor"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
android:textSize="14sp"
|
||||
android:visibility="visible"
|
||||
android:autofillHints="@string/copyToken" />
|
||||
app:hintTextColor="?attr/hintColor"
|
||||
app:boxStrokeErrorColor="@color/darkRed"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:startIconDrawable="@drawable/ic_lock"
|
||||
app:startIconTint="?attr/iconsColor"
|
||||
app:endIconMode="clear_text"
|
||||
app:endIconTint="?attr/iconsColor"
|
||||
android:hint="@string/copyToken">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/loginToken"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?attr/inputTextColor"
|
||||
android:textColorHighlight="?attr/hintColor"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
android:maxLines="1"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/addNewAccount"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:text="@string/addNewAccountText"
|
||||
android:textColor="@color/btnTextColor"
|
||||
|
246
app/src/main/res/layout/activity_create_pr.xml
Normal file
@ -0,0 +1,246 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:background="?attr/primaryBackgroundColor">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/appbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="@style/Widget.AppCompat.SearchView">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/primaryBackgroundColor">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/close"
|
||||
android:layout_width="@dimen/close_button_size"
|
||||
android:layout_height="@dimen/close_button_size"
|
||||
android:layout_marginRight="15dp"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:gravity="center_vertical"
|
||||
android:contentDescription="@string/close"
|
||||
android:src="@drawable/ic_arrow_back" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/toolbarTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="@string/pageTitleNewPullRequest"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:maxLines="1"
|
||||
android:textSize="20sp" />
|
||||
|
||||
</com.google.android.material.appbar.MaterialToolbar>
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="16dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/prTitleLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:boxBackgroundColor="?attr/inputBackgroundColor"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
app:hintTextColor="?attr/hintColor"
|
||||
app:boxStrokeErrorColor="@color/darkRed"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:endIconMode="clear_text"
|
||||
app:endIconTint="?attr/iconsColor"
|
||||
app:counterEnabled="true"
|
||||
app:counterMaxLength="255"
|
||||
app:counterTextColor="?attr/inputTextColor"
|
||||
android:hint="@string/newIssueTitle">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/prTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?attr/inputTextColor"
|
||||
android:textColorHighlight="?attr/hintColor"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/prBodyLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:boxBackgroundColor="?attr/inputBackgroundColor"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
app:hintTextColor="?attr/hintColor"
|
||||
app:boxStrokeErrorColor="@color/darkRed"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:endIconMode="clear_text"
|
||||
app:endIconTint="?attr/iconsColor"
|
||||
android:hint="@string/newIssueDescriptionTitle">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/prBody"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="140dp"
|
||||
android:textColor="?attr/inputTextColor"
|
||||
android:textColorHighlight="?attr/hintColor"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/mergeIntoBranchSpinnerLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:boxBackgroundColor="?attr/inputBackgroundColor"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
app:hintTextColor="?attr/hintColor"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:hint="@string/mergeIntoBranch"
|
||||
app:endIconTint="?attr/iconsColor"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox.ExposedDropdownMenu">
|
||||
|
||||
<AutoCompleteTextView
|
||||
android:id="@+id/mergeIntoBranchSpinner"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="none"
|
||||
android:textColor="?attr/inputTextColor"
|
||||
android:labelFor="@+id/mergeIntoBranchSpinner"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/pullFromBranchSpinnerLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:boxBackgroundColor="?attr/inputBackgroundColor"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
app:hintTextColor="?attr/hintColor"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:hint="@string/pullFromBranch"
|
||||
app:endIconTint="?attr/iconsColor"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox.ExposedDropdownMenu">
|
||||
|
||||
<AutoCompleteTextView
|
||||
android:id="@+id/pullFromBranchSpinner"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="none"
|
||||
android:textColor="?attr/inputTextColor"
|
||||
android:labelFor="@+id/pullFromBranchSpinner"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/milestonesSpinnerLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:boxBackgroundColor="?attr/inputBackgroundColor"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
app:hintTextColor="?attr/hintColor"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:hint="@string/newIssueMilestoneTitle"
|
||||
app:endIconTint="?attr/iconsColor"
|
||||
android:visibility="gone"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox.ExposedDropdownMenu">
|
||||
|
||||
<AutoCompleteTextView
|
||||
android:id="@+id/milestonesSpinner"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="none"
|
||||
android:textColor="?attr/inputTextColor"
|
||||
android:labelFor="@+id/milestonesSpinner"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/prLabelsLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:boxBackgroundColor="?attr/inputBackgroundColor"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
app:hintTextColor="?attr/hintColor"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:hint="@string/newIssueLabelsTitle">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/prLabels"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?attr/inputTextColor"
|
||||
android:textColorHighlight="?attr/hintColor"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
android:focusable="false"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/prDueDateLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:boxBackgroundColor="?attr/inputBackgroundColor"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
app:hintTextColor="?attr/hintColor"
|
||||
app:boxStrokeErrorColor="@color/darkRed"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:endIconMode="clear_text"
|
||||
app:endIconTint="?attr/iconsColor"
|
||||
android:hint="@string/newIssueDueDateTitle">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/prDueDate"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?attr/inputTextColor"
|
||||
android:textColorHighlight="?attr/hintColor"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
android:maxLines="1"
|
||||
android:focusable="false"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/createPr"
|
||||
android:gravity="center"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="60dp"
|
||||
android:text="@string/newCreateButtonCopy"
|
||||
android:textColor="@color/btnTextColor" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
||||
</LinearLayout>
|
@ -19,6 +19,16 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/primaryBackgroundColor">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/issuePrState"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_issue"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:visibility="gone"
|
||||
android:contentDescription="@string/generalImgContentText" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
<LinearLayout android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:background="?attr/primaryBackgroundColor">
|
||||
@ -50,27 +50,30 @@
|
||||
android:padding="16dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/userEmailLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/profileEmailTitle"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/userEmail"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:padding="10dp"
|
||||
android:textSize="14sp"
|
||||
tools:ignore="Autofill"
|
||||
android:inputType="textEmailAddress"
|
||||
android:labelFor="@+id/userEmail"
|
||||
android:background="@drawable/shape_inputs"
|
||||
android:textColor="?attr/inputTextColor"
|
||||
app:boxBackgroundColor="?attr/inputBackgroundColor"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
android:textColorHighlight="?attr/primaryTextColor"/>
|
||||
app:hintTextColor="?attr/hintColor"
|
||||
app:boxStrokeErrorColor="@color/darkRed"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:endIconMode="clear_text"
|
||||
app:endIconTint="?attr/iconsColor"
|
||||
android:hint="@string/profileEmailTitle">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/userEmail"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?attr/inputTextColor"
|
||||
android:textColorHighlight="?attr/hintColor"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/addEmailButton"
|
||||
|
@ -68,12 +68,6 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/tabPullRequests" />
|
||||
|
||||
<com.google.android.material.tabs.TabItem
|
||||
android:id="@+id/tabItem5_branches"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/tab_text_branches" />
|
||||
|
||||
<com.google.android.material.tabs.TabItem
|
||||
android:id="@+id/tabItem6_releases"
|
||||
android:layout_width="wrap_content"
|
||||
|
149
app/src/main/res/layout/activity_repository_settings.xml
Normal file
@ -0,0 +1,149 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:background="?attr/primaryBackgroundColor">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/appbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="@style/Widget.AppCompat.SearchView">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/primaryBackgroundColor">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/close"
|
||||
android:layout_width="@dimen/close_button_size"
|
||||
android:layout_height="@dimen/close_button_size"
|
||||
android:layout_marginRight="15dp"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:gravity="center_vertical"
|
||||
android:contentDescription="@string/close"
|
||||
android:src="@drawable/ic_arrow_back" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/toolbarTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="@string/repoSettingsTitle"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:maxLines="1"
|
||||
android:textSize="20sp" />
|
||||
|
||||
</com.google.android.material.appbar.MaterialToolbar>
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<ScrollView android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/editProperties"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="@string/repoSettingsEditProperties"
|
||||
android:drawableStart="@drawable/ic_edit"
|
||||
android:drawablePadding="32dp"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
android:padding="16dp" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="?attr/dividerColor" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/transferOwnerFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/transferRepositoryOwnership"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="@string/repoSettingsTransferOwnership"
|
||||
android:drawableStart="@drawable/ic_arrow_up"
|
||||
android:drawablePadding="32dp"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="16dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/transferRepositoryOwnershipHint"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="@string/repoSettingsTransferOwnershipHint"
|
||||
android:textColor="?attr/hintColor"
|
||||
android:textSize="12sp"
|
||||
android:paddingBottom="16dp"
|
||||
android:paddingStart="72dp"
|
||||
android:paddingEnd="16dp" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="?attr/dividerColor" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="16dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/deleteRepository"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="@string/repoSettingsDelete"
|
||||
android:drawableStart="@drawable/ic_delete"
|
||||
android:drawablePadding="32dp"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="16dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/deleteRepositoryHint"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="@string/repoSettingsDeleteHint"
|
||||
android:textColor="?attr/hintColor"
|
||||
android:textSize="12sp"
|
||||
android:paddingStart="72dp"
|
||||
android:paddingEnd="16dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
||||
</LinearLayout>
|
||||
|
21
app/src/main/res/layout/badge_notification.xml
Normal file
@ -0,0 +1,21 @@
|
||||
<?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="match_parent"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/counterBadgeNotification"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:maxLength="4"
|
||||
android:ellipsize="marquee"
|
||||
android:background="@drawable/shape_badge_background"
|
||||
android:paddingStart="5dp"
|
||||
android:paddingEnd="5dp"
|
||||
android:textColor="@color/colorWhite"
|
||||
android:textSize="12sp" />
|
||||
|
||||
</LinearLayout>
|
@ -41,6 +41,18 @@
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/createPullRequest"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:drawableStart="@drawable/ic_pull_request"
|
||||
android:drawablePadding="24dp"
|
||||
android:padding="12dp"
|
||||
android:text="@string/pageTitleNewPullRequest"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/createNewMilestone"
|
||||
android:layout_width="match_parent"
|
||||
@ -189,6 +201,27 @@
|
||||
android:textSize="16sp"
|
||||
android:padding="12dp" />
|
||||
|
||||
<View
|
||||
android:id="@+id/repoSettingsDivider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:layout_marginStart="64dp"
|
||||
android:background="?attr/dividerColor" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/repoSettings"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:drawableStart="@drawable/ic_settings"
|
||||
android:drawablePadding="24dp"
|
||||
android:text="@string/navSettings"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
android:padding="12dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
116
app/src/main/res/layout/custom_explore_repositories_dialog.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:background="@drawable/shape_custom_dialog"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/dialogFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="16dp"
|
||||
android:id="@+id/titleFrame"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold"
|
||||
android:drawableStart="@drawable/ic_filter"
|
||||
android:drawablePadding="16dp"
|
||||
android:text="@string/exploreFilterDialogTitle"
|
||||
android:layout_marginBottom="4dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:id="@+id/dividerTitle"
|
||||
android:background="?attr/dividerColor" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="100"
|
||||
android:layout_margin="12dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/includeTopic"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:checked="false"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:text="@string/exploreFilterIncludeTopic"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/includeDesc"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:checked="false"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:text="@string/exploreFilterIncludeDesc"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/includeTemplate"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:checked="false"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:text="@string/exploreFilterIncludeTemplateRepos"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/onlyArchived"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:checked="false"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:text="@string/exploreFilterIncludeArchive"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:id="@+id/divider"
|
||||
android:background="?attr/dividerColor" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:orientation="horizontal" >
|
||||
|
||||
<Button
|
||||
android:id="@+id/cancel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="60dp"
|
||||
style="?android:attr/button"
|
||||
android:layout_alignParentStart="true"
|
||||
android:text="@string/close"
|
||||
android:textColor="@color/colorWhite"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
19
app/src/main/res/layout/custom_labels_list.xml
Normal file
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/layoutFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/labelSelection"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:checked="false"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
101
app/src/main/res/layout/custom_labels_selection_dialog.xml
Normal file
@ -0,0 +1,101 @@
|
||||
<?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"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="@drawable/shape_custom_dialog"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.google.android.material.progressindicator.ProgressIndicator
|
||||
android:id="@+id/progressBar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Widget.MaterialComponents.ProgressIndicator.Linear.Indeterminate"
|
||||
app:indicatorColor="?attr/progressIndicatorColor" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/dialogFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="16dp"
|
||||
android:id="@+id/TitleFrame"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold"
|
||||
android:drawableStart="@drawable/ic_label"
|
||||
android:drawablePadding="16dp"
|
||||
android:text="@string/newIssueSelectLabelsListTitle" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:id="@+id/dividerTitle"
|
||||
android:background="?attr/dividerColor" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="100"
|
||||
android:layout_margin="12dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/labelsRecyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:id="@+id/divider"
|
||||
android:background="?attr/dividerColor" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<Button
|
||||
android:id="@+id/cancel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="60dp"
|
||||
style="?android:attr/button"
|
||||
android:layout_alignParentStart="true"
|
||||
android:text="@string/close"
|
||||
android:textColor="@color/colorWhite"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
110
app/src/main/res/layout/custom_repository_delete_dialog.xml
Normal file
@ -0,0 +1,110 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="@drawable/shape_custom_dialog"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="16dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold"
|
||||
android:drawableStart="@drawable/ic_delete"
|
||||
android:drawablePadding="16dp"
|
||||
android:text="@string/repoSettingsDelete"
|
||||
android:layout_marginBottom="16dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/description"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
android:text="@string/repoSettingsDeleteDescription"
|
||||
android:layout_marginBottom="16dp" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/repoNameForDeletionLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:boxBackgroundColor="?attr/inputBackgroundColor"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
app:hintTextColor="?attr/hintColor"
|
||||
app:boxStrokeErrorColor="@color/darkRed"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:hint="@string/newRepoTintCopy">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/repoNameForDeletion"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?attr/inputTextColor"
|
||||
android:textColorHighlight="?attr/hintColor"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:id="@+id/divider"
|
||||
android:background="?attr/dividerColor" />
|
||||
|
||||
<com.google.android.material.progressindicator.ProgressIndicator
|
||||
android:id="@+id/processingRequest"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
style="@style/Widget.MaterialComponents.ProgressIndicator.Linear.Indeterminate"
|
||||
app:indicatorColor="?attr/progressIndicatorColor" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:orientation="horizontal" >
|
||||
|
||||
<Button
|
||||
android:id="@+id/cancel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="60dp"
|
||||
style="?android:attr/button"
|
||||
android:layout_alignParentStart="true"
|
||||
android:text="@string/cancelButton"
|
||||
android:textColor="@color/colorWhite"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/delete"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="60dp"
|
||||
style="?android:attr/button"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:text="@string/menuDeleteText"
|
||||
android:backgroundTint="@color/darkRed"
|
||||
android:textColor="@color/colorWhite"
|
||||
android:textSize="16sp"
|
||||
tools:ignore="RelativeOverlap" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -0,0 +1,234 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="@drawable/shape_custom_dialog"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.google.android.material.progressindicator.ProgressIndicator
|
||||
android:id="@+id/progressBar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Widget.MaterialComponents.ProgressIndicator.Linear.Indeterminate"
|
||||
app:indicatorColor="?attr/progressIndicatorColor" />
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:id="@+id/mainView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="16dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/repoNameLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:boxBackgroundColor="?attr/inputBackgroundColor"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
app:hintTextColor="?attr/hintColor"
|
||||
app:boxStrokeErrorColor="@color/darkRed"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:hint="@string/newRepoTintCopy">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/repoName"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?attr/inputTextColor"
|
||||
android:textColorHighlight="?attr/hintColor"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/repoWebsiteLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:boxBackgroundColor="?attr/inputBackgroundColor"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
app:hintTextColor="?attr/hintColor"
|
||||
app:boxStrokeErrorColor="@color/darkRed"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:hint="@string/websiteText">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/repoWebsite"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?attr/inputTextColor"
|
||||
android:textColorHighlight="?attr/hintColor"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/repoDescriptionLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:boxBackgroundColor="?attr/inputBackgroundColor"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
app:hintTextColor="?attr/hintColor"
|
||||
app:boxStrokeErrorColor="@color/darkRed"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:hint="@string/newRepoDescTintCopy">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/repoDescription"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?attr/inputTextColor"
|
||||
android:textColorHighlight="?attr/hintColor"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||
android:id="@+id/repoPrivate"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:checked="true"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:text="@string/newRepoPrivateCopy" />
|
||||
|
||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||
android:id="@+id/repoAsTemplate"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:checked="true"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:text="@string/repoPropertiesTemplate" />
|
||||
|
||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||
android:id="@+id/repoEnableIssues"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:checked="true"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:text="@string/repoPropertiesEnableIssues" />
|
||||
|
||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||
android:id="@+id/repoEnableWiki"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:checked="true"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:text="@string/repoPropertiesEnableWiki" />
|
||||
|
||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||
android:id="@+id/repoEnablePr"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:checked="true"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:text="@string/repoPropertiesEnablePr" />
|
||||
|
||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||
android:id="@+id/repoEnableTimer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:checked="true"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:text="@string/repoPropertiesEnableTimeTracker" />
|
||||
|
||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||
android:id="@+id/repoEnableMerge"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:checked="true"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:text="@string/repoPropertiesEnableMergeCommits" />
|
||||
|
||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||
android:id="@+id/repoEnableRebase"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:checked="true"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:text="@string/repoPropertiesEnableRebase" />
|
||||
|
||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||
android:id="@+id/repoEnableSquash"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:checked="true"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:text="@string/repoPropertiesEnableSquash" />
|
||||
|
||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||
android:id="@+id/repoEnableForceMerge"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:checked="true"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:text="@string/repoPropertiesEnableForceMerge" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:id="@+id/divider"
|
||||
android:background="?attr/dividerColor" />
|
||||
|
||||
<com.google.android.material.progressindicator.ProgressIndicator
|
||||
android:id="@+id/processingRequest"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
style="@style/Widget.MaterialComponents.ProgressIndicator.Linear.Indeterminate"
|
||||
app:indicatorColor="?attr/progressIndicatorColor" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:orientation="horizontal" >
|
||||
|
||||
<Button
|
||||
android:id="@+id/cancel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="60dp"
|
||||
style="?android:attr/button"
|
||||
android:layout_alignParentStart="true"
|
||||
android:text="@string/cancelButton"
|
||||
android:textColor="@color/colorWhite"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/save"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="60dp"
|
||||
style="?android:attr/button"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:text="@string/saveButton"
|
||||
android:textColor="@color/colorWhite"
|
||||
android:textSize="16sp"
|
||||
tools:ignore="RelativeOverlap" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
</LinearLayout>
|
134
app/src/main/res/layout/custom_repository_transfer_dialog.xml
Normal file
@ -0,0 +1,134 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="@drawable/shape_custom_dialog"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="16dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold"
|
||||
android:drawableStart="@drawable/ic_arrow_up"
|
||||
android:drawablePadding="16dp"
|
||||
android:text="@string/repoSettingsTransferOwnership"
|
||||
android:layout_marginBottom="16dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/description"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
android:text="@string/repoSettingsTransferOwnershipDescription"
|
||||
android:layout_marginBottom="16dp" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/repoNameForTransferLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:boxBackgroundColor="?attr/inputBackgroundColor"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
app:hintTextColor="?attr/hintColor"
|
||||
app:boxStrokeErrorColor="@color/darkRed"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:hint="@string/newRepoTintCopy">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/repoNameForTransfer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?attr/inputTextColor"
|
||||
android:textColorHighlight="?attr/hintColor"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/ownerNameForTransferLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:boxBackgroundColor="?attr/inputBackgroundColor"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
app:hintTextColor="?attr/hintColor"
|
||||
app:boxStrokeErrorColor="@color/darkRed"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:hint="@string/repoTransferOwnerText">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/ownerNameForTransfer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?attr/inputTextColor"
|
||||
android:textColorHighlight="?attr/hintColor"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:id="@+id/divider"
|
||||
android:background="?attr/dividerColor" />
|
||||
|
||||
<com.google.android.material.progressindicator.ProgressIndicator
|
||||
android:id="@+id/processingRequest"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
style="@style/Widget.MaterialComponents.ProgressIndicator.Linear.Indeterminate"
|
||||
app:indicatorColor="?attr/progressIndicatorColor" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:orientation="horizontal" >
|
||||
|
||||
<Button
|
||||
android:id="@+id/cancel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="60dp"
|
||||
style="?android:attr/button"
|
||||
android:layout_alignParentStart="true"
|
||||
android:text="@string/cancelButton"
|
||||
android:textColor="@color/colorWhite"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/transfer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="60dp"
|
||||
style="?android:attr/button"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:text="@string/repoTransferText"
|
||||
android:backgroundTint="@color/darkRed"
|
||||
android:textColor="@color/colorWhite"
|
||||
android:textSize="16sp"
|
||||
tools:ignore="RelativeOverlap" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -28,7 +28,7 @@
|
||||
<Button
|
||||
android:id="@+id/manageAccounts"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="60dp"
|
||||
android:layout_margin="16dp"
|
||||
android:paddingStart="4dp"
|
||||
android:paddingEnd="4dp"
|
||||
|
@ -3,7 +3,8 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" >
|
||||
|
||||
<ScrollView android:layout_width="match_parent"
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor">
|
||||
|
||||
@ -23,7 +24,7 @@
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="20dp"
|
||||
android:baselineAligned="false"
|
||||
android:contentDescription="@string/logo"
|
||||
android:contentDescription="@string/app_name"
|
||||
android:src="@mipmap/app_logo" />
|
||||
|
||||
<TextView
|
||||
@ -34,134 +35,200 @@
|
||||
android:textIsSelectable="true"
|
||||
android:layout_marginTop="5dp"
|
||||
android:textSize="24sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:layout_gravity="center_horizontal"/>
|
||||
android:layout_gravity="center_horizontal" />
|
||||
|
||||
<!-- version -->
|
||||
<TextView
|
||||
android:id="@+id/appVerBuild"
|
||||
android:text="@string/appVerBuild"
|
||||
android:layout_width="wrap_content"
|
||||
android:id="@+id/appVersionHeader"
|
||||
android:text="@string/appVersion"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textIsSelectable="true"
|
||||
android:layout_marginTop="40dp"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="?attr/primaryTextColor" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:id="@+id/dividerVersion"
|
||||
android:background="?attr/dividerColor"
|
||||
android:layout_marginTop="5dp"
|
||||
android:textSize="16sp"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:layout_gravity="center_horizontal"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/appDesc"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/appDesc"
|
||||
android:textIsSelectable="true"
|
||||
android:layout_marginTop="25dp"
|
||||
android:textSize="16sp"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:padding="5dp"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:layout_gravity="center_horizontal"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/giteaVersion"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/commitPage"
|
||||
android:layout_marginTop="15dp"
|
||||
android:textSize="16sp"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:padding="5dp"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:autoLink="web" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="15dp"
|
||||
android:orientation="vertical"
|
||||
android:padding="5dp"
|
||||
android:background="?attr/primaryBackgroundColor">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/donationLink"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/supportText"
|
||||
android:textColor="@color/lightBlue"
|
||||
android:textSize="16sp"
|
||||
android:gravity="start"
|
||||
android:autoLink="web"
|
||||
android:visibility="visible"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:textColorLink="@color/lightBlue" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/donationLinkPatreon"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/supportTextPatreon"
|
||||
android:textColor="@color/lightBlue"
|
||||
android:textSize="16sp"
|
||||
android:gravity="start"
|
||||
android:autoLink="web"
|
||||
android:visibility="visible"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:textColorLink="@color/lightBlue" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/translateLink"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:autoLink="web"
|
||||
android:gravity="start"
|
||||
android:text="@string/translateText"
|
||||
android:textColor="@color/lightBlue"
|
||||
android:textColorLink="@color/lightBlue"
|
||||
android:textSize="16sp"
|
||||
android:visibility="visible" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="15dp"
|
||||
android:orientation="vertical"
|
||||
android:padding="5dp"
|
||||
android:background="?attr/primaryBackgroundColor">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/appWebsite"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/appWebsite"
|
||||
android:textColor="@color/lightBlue"
|
||||
android:textSize="16sp"
|
||||
android:gravity="start"
|
||||
android:autoLink="web"
|
||||
android:visibility="visible"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:textColorLink="@color/lightBlue" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/appRepo"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/appRepo"
|
||||
android:textColor="@color/lightBlue"
|
||||
android:textSize="16sp"
|
||||
android:gravity="start"
|
||||
android:autoLink="web"
|
||||
android:visibility="visible"
|
||||
android:textColorLink="@color/lightBlue" />
|
||||
|
||||
</LinearLayout>
|
||||
android:layout_marginBottom="5dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/appVersion"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="25dp" />
|
||||
android:layout_height="wrap_content"
|
||||
android:textIsSelectable="true"
|
||||
android:textSize="14sp"
|
||||
android:textColor="?attr/primaryTextColor" />
|
||||
<!-- version -->
|
||||
|
||||
<!-- build -->
|
||||
<TextView
|
||||
android:id="@+id/appBuildHeader"
|
||||
android:text="@string/appBuild"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="?attr/primaryTextColor" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:id="@+id/dividerBuild"
|
||||
android:background="?attr/dividerColor"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="5dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/appBuild"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textIsSelectable="true"
|
||||
android:textSize="14sp"
|
||||
android:textColor="?attr/primaryTextColor" />
|
||||
<!-- build -->
|
||||
|
||||
<!-- user server version -->
|
||||
<TextView
|
||||
android:id="@+id/userServerVersionHeader"
|
||||
android:text="@string/commitPage"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="?attr/primaryTextColor" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:id="@+id/dividerUserServerVersion"
|
||||
android:background="?attr/dividerColor"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="5dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/userServerVersion"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textIsSelectable="true"
|
||||
android:textSize="14sp"
|
||||
android:textColor="?attr/primaryTextColor" />
|
||||
<!-- user server version -->
|
||||
|
||||
<!-- support -->
|
||||
<TextView
|
||||
android:id="@+id/supportHeader"
|
||||
android:text="@string/supportText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="?attr/primaryTextColor" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:id="@+id/dividerSupport"
|
||||
android:background="?attr/dividerColor"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="5dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/donationLinkLiberapay"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/supportTextLiberapay"
|
||||
android:textColor="@color/lightBlue"
|
||||
android:textSize="14sp"
|
||||
android:autoLink="web"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:textColorLink="@color/lightBlue" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/donationLinkPatreon"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/supportTextPatreon"
|
||||
android:textColor="@color/lightBlue"
|
||||
android:textSize="14sp"
|
||||
android:autoLink="web"
|
||||
android:textColorLink="@color/lightBlue" />
|
||||
<!-- support -->
|
||||
|
||||
<!-- translate -->
|
||||
<TextView
|
||||
android:id="@+id/translateHeader"
|
||||
android:text="@string/translateText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="?attr/primaryTextColor" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:id="@+id/dividerTranslate"
|
||||
android:background="?attr/dividerColor"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="5dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/translateLink"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:autoLink="web"
|
||||
android:gravity="start"
|
||||
android:text="@string/translateWithCrowdin"
|
||||
android:textColor="@color/lightBlue"
|
||||
android:textColorLink="@color/lightBlue"
|
||||
android:textSize="14sp"
|
||||
android:visibility="visible" />
|
||||
<!-- translate -->
|
||||
|
||||
<!-- website -->
|
||||
<TextView
|
||||
android:id="@+id/websiteHeader"
|
||||
android:text="@string/websiteText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="?attr/primaryTextColor" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:id="@+id/dividerWebsite"
|
||||
android:background="?attr/dividerColor"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="5dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/appWebsite"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/appWebsiteLink"
|
||||
android:textColor="@color/lightBlue"
|
||||
android:textSize="14sp"
|
||||
android:autoLink="web"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:textColorLink="@color/lightBlue" />
|
||||
<!-- website -->
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
</RelativeLayout>
|
||||
|
@ -1,50 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
tools:context=".activities.RepoDetailActivity">
|
||||
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
android:id="@+id/pullToRefresh"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:scrollbars="vertical" />
|
||||
|
||||
<GridView
|
||||
android:id="@+id/gridView"
|
||||
android:numColumns="auto_fit"
|
||||
android:gravity="center"
|
||||
android:columnWidth="50dp"
|
||||
android:stretchMode="columnWidth"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent" />
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
||||
<com.google.android.material.progressindicator.ProgressIndicator
|
||||
android:id="@+id/progress_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Widget.MaterialComponents.ProgressIndicator.Linear.Indeterminate"
|
||||
app:indicatorColor="?attr/progressIndicatorColor" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/noDataBranches"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="15dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/noDataBranchesTab"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="20sp"
|
||||
android:visibility="gone" />
|
||||
|
||||
</RelativeLayout>
|
48
app/src/main/res/layout/fragment_explore.xml
Normal file
@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/exploreFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/appbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="@style/Widget.AppCompat.SearchView">
|
||||
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/tabsExplore"
|
||||
app:tabMode="fixed"
|
||||
app:tabTextAppearance="@style/customTabLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
app:tabTextColor="?attr/primaryTextColor"
|
||||
app:tabIndicatorColor="?attr/pagerTabIndicatorColor"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.google.android.material.tabs.TabItem
|
||||
android:id="@+id/tabExploreRepositories"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/pageTitleRepositories" />
|
||||
|
||||
<com.google.android.material.tabs.TabItem
|
||||
android:id="@+id/tabExploreIssues"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/pageTitleIssues" />
|
||||
|
||||
</com.google.android.material.tabs.TabLayout>
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:id="@+id/containerExplore"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
@ -7,30 +7,58 @@
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.google.android.material.progressindicator.ProgressIndicator
|
||||
android:id="@+id/progress_bar"
|
||||
android:id="@+id/loadingMoreView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
style="@style/Widget.MaterialComponents.ProgressIndicator.Linear.Indeterminate"
|
||||
app:indicatorColor="?attr/progressIndicatorColor" />
|
||||
|
||||
<com.google.android.material.progressindicator.ProgressIndicator
|
||||
android:id="@+id/progressBar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Widget.MaterialComponents.ProgressIndicator.Linear.Indeterminate"
|
||||
app:indicatorColor="?attr/progressIndicatorColor" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/searchKeyword"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="10dp"
|
||||
android:textSize="14sp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:inputType="text"
|
||||
android:background="@drawable/shape_inputs"
|
||||
android:textColor="?attr/inputTextColor"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
android:hint="@string/exploreTextBoxHint"
|
||||
android:textColorHighlight="?attr/primaryTextColor"
|
||||
android:imeOptions="actionSend"
|
||||
android:autofillHints="@string/exploreTextBoxHint" />
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp">
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/searchKeywordLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:boxBackgroundColor="?attr/inputBackgroundColor"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
app:hintTextColor="?attr/hintColor"
|
||||
app:boxStrokeErrorColor="@color/darkRed"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:startIconDrawable="@drawable/ic_search"
|
||||
app:startIconTint="?attr/iconsColor"
|
||||
app:endIconMode="clear_text"
|
||||
app:endIconTint="?attr/iconsColor"
|
||||
android:hint="@string/exploreTextBoxHint">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/searchKeyword"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?attr/inputTextColor"
|
||||
android:textColorHighlight="?attr/hintColor"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
android:imeOptions="actionSend"
|
||||
android:inputType="text"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/noData"
|
||||
@ -43,11 +71,18 @@
|
||||
android:textSize="20sp"
|
||||
android:visibility="gone" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerViewReposSearch"
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
android:id="@+id/pullToRefresh"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:scrollbars="vertical" />
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerViewReposSearch"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:scrollbars="vertical" />
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -272,7 +272,7 @@
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:contentDescription="@string/infoTabRepoWebsite"
|
||||
android:contentDescription="@string/websiteText"
|
||||
app:srcCompat="@drawable/ic_link" />
|
||||
|
||||
<LinearLayout
|
||||
|
88
app/src/main/res/layout/fragment_search_issues.xml
Normal file
@ -0,0 +1,88 @@
|
||||
<?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="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.google.android.material.progressindicator.ProgressIndicator
|
||||
android:id="@+id/loadingMoreView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
style="@style/Widget.MaterialComponents.ProgressIndicator.Linear.Indeterminate"
|
||||
app:indicatorColor="?attr/progressIndicatorColor" />
|
||||
|
||||
<com.google.android.material.progressindicator.ProgressIndicator
|
||||
android:id="@+id/progressBar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Widget.MaterialComponents.ProgressIndicator.Linear.Indeterminate"
|
||||
app:indicatorColor="?attr/progressIndicatorColor" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp">
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/searchKeywordLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:boxBackgroundColor="?attr/inputBackgroundColor"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
app:hintTextColor="?attr/hintColor"
|
||||
app:boxStrokeErrorColor="@color/darkRed"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:startIconDrawable="@drawable/ic_search"
|
||||
app:startIconTint="?attr/iconsColor"
|
||||
app:endIconMode="clear_text"
|
||||
app:endIconTint="?attr/iconsColor"
|
||||
android:hint="@string/navSearchIssuesPulls">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/searchKeyword"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?attr/inputTextColor"
|
||||
android:textColorHighlight="?attr/hintColor"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
android:imeOptions="actionSend"
|
||||
android:inputType="text"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/noData"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="15dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/noDataFound"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="20sp"
|
||||
android:visibility="gone" />
|
||||
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
android:id="@+id/pullToRefresh"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerViewSearchIssues"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:scrollbars="vertical" />
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
||||
</LinearLayout>
|
@ -5,7 +5,7 @@
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor">
|
||||
|
||||
<ScrollView
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor">
|
||||
@ -208,8 +208,72 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/rateAppFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginTop="25dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/rateApp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableStart="@drawable/ic_like"
|
||||
android:drawablePadding="24dp"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:text="@string/navRate"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/rateAppHintText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="@string/rateAppHintText"
|
||||
android:paddingStart="60dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="12sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/aboutAppFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginTop="25dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/aboutApp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableStart="@drawable/ic_info"
|
||||
android:drawablePadding="24dp"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:text="@string/navAbout"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/aboutAppHintText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="@string/aboutAppHintText"
|
||||
android:paddingStart="60dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="12sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
</RelativeLayout>
|
||||
|
@ -1,50 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:id="@+id/relativeLayoutMainFrame"
|
||||
android:background="?attr/primaryBackgroundColor">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingBottom="5dp"
|
||||
android:id="@+id/branchesFrame"
|
||||
android:layout_margin="15dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/branchName"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textIsSelectable="true"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/branchCommitAuthor"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textIsSelectable="true"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/branchCommitHash"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="60dp"
|
||||
android:text="@string/viewCommits"
|
||||
android:layout_marginTop="15dp"
|
||||
android:textColor="@color/btnTextColor"
|
||||
android:textSize="14sp"
|
||||
android:minHeight="0dp"
|
||||
android:minWidth="0dp"
|
||||
android:padding="8dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
@ -12,6 +12,12 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="invisible" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/repoFullName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="invisible" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/mainFrame"
|
||||
android:layout_width="match_parent"
|
||||
|
12
app/src/main/res/layout/list_spinner_items.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:padding="16dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
tools:ignore="MissingConstraints"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android" />
|
||||
|
@ -46,7 +46,7 @@
|
||||
android:gravity="end"
|
||||
android:paddingEnd="25dp"
|
||||
android:paddingStart="15dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingTop="6dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
|
@ -1,7 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ImageView
|
||||
android:id="@+id/userAccountAvatar"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:paddingStart="4dp"
|
||||
android:paddingEnd="4dp"
|
||||
android:contentDescription="@string/generalImgContentText"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android" />
|
||||
|
@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu 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"
|
||||
tools:showIn="navigation_view">
|
||||
|
||||
<group android:checkableBehavior="single"
|
||||
@ -26,6 +27,7 @@
|
||||
android:id="@+id/nav_notifications"
|
||||
android:icon="@drawable/ic_notifications"
|
||||
android:title="@string/pageTitleNotifications"
|
||||
app:actionLayout="@layout/badge_notification"
|
||||
android:visible="false" />
|
||||
|
||||
<item android:id="@+id/nav_explore"
|
||||
@ -54,19 +56,6 @@
|
||||
android:icon="@drawable/ic_settings"
|
||||
android:title="@string/navSettings" />
|
||||
|
||||
<item android:id="@+id/nav_about"
|
||||
android:icon="@drawable/ic_info"
|
||||
android:title="@string/navAbout" />
|
||||
|
||||
</group>
|
||||
|
||||
<item android:id="@+id/nav_rate_app"
|
||||
android:icon="@drawable/ic_like"
|
||||
android:title="@string/navRate" />
|
||||
|
||||
<group android:checkableBehavior="single"
|
||||
android:id="@+id/nav_extra">
|
||||
|
||||
<item android:id="@+id/nav_logout"
|
||||
android:icon="@drawable/ic_logout"
|
||||
android:title="@string/navLogout" />
|
||||
|
@ -1,12 +1,39 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<item
|
||||
android:id="@+id/switchBranches"
|
||||
android:icon="@drawable/ic_branch"
|
||||
android:title="@string/strSwitchBranches"
|
||||
android:orderInCategory="0"
|
||||
app:showAsAction="ifRoom" />
|
||||
android:id="@+id/mainRepoMenu"
|
||||
android:icon="@drawable/ic_dotted_menu"
|
||||
android:title="@string/menuTitleText"
|
||||
android:orderInCategory="1"
|
||||
app:showAsAction="always" >
|
||||
|
||||
<menu>
|
||||
|
||||
<item
|
||||
android:id="@+id/repoMenu"
|
||||
android:icon="@drawable/ic_dotted_menu"
|
||||
android:title="@string/menuTitleText"
|
||||
android:orderInCategory="0"
|
||||
app:showAsAction="ifRoom|withText" />
|
||||
|
||||
<item
|
||||
android:id="@+id/switchBranches"
|
||||
android:icon="@drawable/ic_branch"
|
||||
android:title="@string/strSwitchBranches"
|
||||
android:orderInCategory="1"
|
||||
app:showAsAction="ifRoom|withText" />
|
||||
|
||||
<item
|
||||
android:id="@+id/branchCommits"
|
||||
android:icon="@drawable/ic_commit"
|
||||
android:title="@string/commitTitle"
|
||||
android:orderInCategory="2"
|
||||
app:showAsAction="ifRoom|withText" />
|
||||
|
||||
</menu>
|
||||
|
||||
</item>
|
||||
|
||||
</menu>
|
||||
|
@ -9,4 +9,4 @@
|
||||
android:orderInCategory="1"
|
||||
app:showAsAction="ifRoom" />
|
||||
|
||||
</menu>
|
||||
</menu>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/app_logo_background"/>
|
||||
<foreground android:drawable="@drawable/app_logo_foreground"/>
|
||||
<foreground android:drawable="@mipmap/app_logo_foreground"/>
|
||||
</adaptive-icon>
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/app_logo_background"/>
|
||||
<foreground android:drawable="@drawable/app_logo_foreground"/>
|
||||
<foreground android:drawable="@mipmap/app_logo_foreground"/>
|
||||
</adaptive-icon>
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
BIN
app/src/main/res/mipmap-hdpi/app_logo_foreground.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1020 B |
BIN
app/src/main/res/mipmap-mdpi/app_logo_foreground.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 1.9 KiB |