Skip to content
Snippets Groups Projects
Commit b1c6eb36 authored by John Carlson's avatar John Carlson
Browse files

Initial Kotlin setup

parent 5212b54f
No related branches found
No related tags found
No related merge requests found
Pipeline #
Loading
Loading
@@ -13,6 +13,7 @@ repositories {
}
 
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'io.fabric'
 
def versionMajor = 2
Loading
Loading
@@ -54,7 +55,7 @@ android {
shrinkResources true
}
debug {
minifyEnabled false
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
ext.enableCrashlytics = false
}
Loading
Loading
@@ -62,6 +63,9 @@ android {
lintOptions {
abortOnError false
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
}
 
ext.supportLibVersion = '25.1.0'
Loading
Loading
@@ -75,12 +79,8 @@ ext.adapterLayout = '1.1.0'
ext.materialDialogsVersion = '0.9.2.2'
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
testCompile 'org.robolectric:robolectric:3.2.1'
 
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
 
compile "com.android.support:appcompat-v7:$supportLibVersion"
compile "com.android.support:design:$supportLibVersion"
Loading
Loading
@@ -88,35 +88,41 @@ dependencies {
compile "com.android.support:cardview-v7:$supportLibVersion"
compile "com.android.support:palette-v7:$supportLibVersion"
compile "com.android.support:customtabs:$supportLibVersion"
compile "com.squareup.retrofit2:retrofit:$retrofitVersion"
compile 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
compile("com.squareup.retrofit2:converter-simplexml:$retrofitVersion") {
exclude group: 'xpp3', module: 'xpp3'
exclude group: 'stax', module: 'stax-api'
exclude group: 'stax', module: 'stax'
}
compile "com.squareup.retrofit2:converter-scalars:$retrofitVersion"
compile 'com.github.Commit451:OkioProGuardRules:1.11.0.0'
compile 'com.github.Commit451:RetrofitProguardRules:2.1.0.0'
compile 'com.github.aurae.retrofit2:converter-logansquare:1.4.1'
compile "com.bluelinelabs:logansquare:$loganSquareVersion"
annotationProcessor "com.bluelinelabs:logansquare-compiler:$loganSquareVersion"
compile 'com.github.Commit451:LoganSquareProGuardRules:1.3.7.0'
compile "com.squareup.okhttp3:okhttp:$okHttpVersion"
compile "com.squareup.okhttp3:logging-interceptor:$okHttpVersion"
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.github.aurae.retrofit2:converter-logansquare:1.4.1'
compile "com.bluelinelabs:logansquare:$loganSquareVersion"
kapt "com.bluelinelabs:logansquare-compiler:$loganSquareVersion"
compile 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
compile 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.1.0'
compile "com.jakewharton:butterknife:$butterknifeVersion"
kapt "com.jakewharton:butterknife-compiler:$butterknifeVersion"
compile 'com.jakewharton.timber:timber:4.4.0'
compile 'org.greenrobot:eventbus:3.0.0'
compile 'com.github.Commit451:EventBusProGuardRules:3.0.0.0'
compile 'io.reactivex.rxjava2:rxjava:2.0.1'
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
compile 'com.trello.rxlifecycle2:rxlifecycle-components:2.0.1'
compile "com.jakewharton:butterknife:$butterknifeVersion"
annotationProcessor "com.jakewharton:butterknife-compiler:$butterknifeVersion"
compile 'com.jakewharton.timber:timber:4.4.0'
compile 'net.danlew:android.joda:2.9.5.1'
compile "org.parceler:parceler-api:$parcelerVersion"
annotationProcessor "org.parceler:parceler:$parcelerVersion"
kapt "org.parceler:parceler:$parcelerVersion"
compile "com.github.Commit451.Reptar:reptar:$reptarVersion@aar"
compile "com.github.Commit451.Reptar:reptar-retrofit:$reptarVersion@aar"
compile 'com.github.Commit451:bypasses:1.0.4'
Loading
Loading
@@ -132,22 +138,40 @@ dependencies {
compile 'com.github.Commit451:MorphTransitions:2.0.0'
compile 'com.github.Commit451:Alakazam:0.0.1'
compile 'com.github.Commit451:Lift:1.2.0'
compile 'com.github.Commit451:OkioProGuardRules:1.11.0.0'
compile 'com.github.Commit451:RetrofitProguardRules:2.1.0.0'
compile 'com.github.Commit451:LoganSquareProGuardRules:1.3.7.0'
compile 'com.github.Commit451:EventBusProGuardRules:3.0.0.0'
compile 'me.zhanghai.android.materialprogressbar:library:1.3.0'
compile 'com.github.Jawnnypoo:PhysicsLayout:2.1.0'
compile 'com.alexgwyn.recyclerviewsquire:recyclerviewsquire:0.0.6'
compile 'com.github.ivbaranov:materiallettericon:0.2.2'
compile 'com.github.johnkil.android-robototextview:robototextview:2.5.1'
compile 'com.github.alorma:diff-textview:1.3.0'
compile 'com.wdullaer:materialdatetimepicker:3.0.0'
compile 'com.wefika:flowlayout:0.4.1'
compile 'com.github.novoda:simple-chrome-custom-tabs:0.1.4'
compile "com.afollestad.material-dialogs:core:$materialDialogsVersion"
compile "com.afollestad.material-dialogs:commons:$materialDialogsVersion"
compile 'de.hdodenhof:circleimageview:2.1.0'
compile('com.vdurmont:emoji-java:3.1.3') {
exclude group: 'org.json', module: 'json'
}
compile 'com.github.jkwiecien:EasyImage:1.4.1'
compile('com.github.ozodrukh:CircularReveal:2.0.1@aar') {
transitive = true;
}
Loading
Loading
@@ -155,4 +179,11 @@ dependencies {
normalCompile('com.crashlytics.sdk.android:crashlytics:2.6.5@aar') {
transitive = true;
}
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
testCompile 'junit:junit:4.12'
testCompile 'org.robolectric:robolectric:3.2.1'
}
package com.commit451.gitlab.activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.design.widget.Snackbar;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.commit451.gimbal.Gimbal;
import com.commit451.gitlab.App;
import com.commit451.gitlab.BuildConfig;
import com.commit451.gitlab.R;
import com.commit451.gitlab.model.api.Contributor;
import com.commit451.gitlab.navigation.Navigator;
import com.commit451.gitlab.rx.CustomSingleObserver;
import com.commit451.gitlab.util.ImageUtil;
import com.commit451.gitlab.util.IntentUtil;
import com.commit451.gitlab.view.PhysicsFlowLayout;
import com.jawnnypoo.physicslayout.Physics;
import com.jawnnypoo.physicslayout.PhysicsConfig;
import com.wefika.flowlayout.FlowLayout;
import org.jbox2d.common.Vec2;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import de.hdodenhof.circleimageview.CircleImageView;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
import timber.log.Timber;
/**
* Thats what its all about
*/
public class AboutActivity extends BaseActivity {
private static final String REPO_ID = "473568";
public static Intent newIntent(Context context) {
Intent intent = new Intent(context, AboutActivity.class);
return intent;
}
@BindView(R.id.root)
ViewGroup root;
@BindView(R.id.toolbar)
Toolbar toolbar;
@BindView(R.id.contributors)
TextView textContributors;
@BindView(R.id.physics_layout)
PhysicsFlowLayout physicsLayout;
@BindView(R.id.progress)
View progress;
SensorManager sensorManager;
Sensor gravitySensor;
Gimbal gimbal;
@OnClick(R.id.sauce)
void onSauceClick() {
if (getString(R.string.url_gitlab).equals(App.get().getAccount().getServerUrl().toString())) {
Navigator.navigateToProject(AboutActivity.this, REPO_ID);
} else {
IntentUtil.openPage(AboutActivity.this, getString(R.string.source_url));
}
}
private final SensorEventListener sensorEventListener = new SensorEventListener() {
@Override
public void onSensorChanged(SensorEvent event) {
if (event.sensor.getType() == Sensor.TYPE_GRAVITY) {
if (physicsLayout.getPhysics().getWorld() != null) {
gimbal.normalizeGravityEvent(event);
physicsLayout.getPhysics().getWorld().setGravity(new Vec2(-event.values[0], event.values[1]));
}
}
}
@Override
public void onAccuracyChanged(Sensor sensor, int accuracy) {
}
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
gimbal = new Gimbal(this);
gimbal.lock();
setContentView(R.layout.activity_about);
ButterKnife.bind(this);
toolbar.setNavigationIcon(R.drawable.ic_back_24dp);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
toolbar.setTitle(R.string.about);
toolbar.setSubtitle(BuildConfig.VERSION_NAME);
physicsLayout.getPhysics().enableFling();
sensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
gravitySensor = sensorManager.getDefaultSensor(Sensor.TYPE_GRAVITY);
App.get().getGitLab().getContributors(REPO_ID)
.compose(this.<List<Contributor>>bindToLifecycle())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new CustomSingleObserver<List<Contributor>>() {
@Override
public void error(@NonNull Throwable t) {
Timber.e(t);
progress.setVisibility(View.GONE);
Snackbar.make(root, R.string.failed_to_load_contributors, Snackbar.LENGTH_SHORT)
.show();
}
@Override
public void success(@NonNull List<Contributor> contributors) {
progress.setVisibility(View.GONE);
addContributors(Contributor.groupContributors(contributors));
}
});
progress.setVisibility(View.VISIBLE);
}
@Override
protected void onResume() {
super.onResume();
sensorManager.registerListener(sensorEventListener, gravitySensor, SensorManager.SENSOR_DELAY_GAME);
}
@Override
protected void onPause() {
super.onPause();
sensorManager.unregisterListener(sensorEventListener);
}
private void addContributors(List<Contributor> contributors) {
PhysicsConfig config = PhysicsConfig.create();
config.shapeType = PhysicsConfig.SHAPE_TYPE_CIRCLE;
int borderSize = getResources().getDimensionPixelSize(R.dimen.border_size);
int imageSize = getResources().getDimensionPixelSize(R.dimen.circle_size);
for (int i = 0; i < contributors.size(); i++) {
Contributor contributor = contributors.get(i);
CircleImageView imageView = new CircleImageView(this);
FlowLayout.LayoutParams llp = new FlowLayout.LayoutParams(
imageSize,
imageSize);
imageView.setLayoutParams(llp);
imageView.setBorderWidth(borderSize);
imageView.setBorderColor(Color.BLACK);
Physics.setPhysicsConfig(imageView, config);
physicsLayout.addView(imageView);
Uri url = ImageUtil.getAvatarUrl(contributor.getEmail(), imageSize);
App.get().getPicasso()
.load(url)
.into(imageView);
}
physicsLayout.requestLayout();
}
}
package com.commit451.gitlab.activity
import android.content.Context
import android.content.Intent
import android.graphics.Color
import android.hardware.Sensor
import android.hardware.SensorEvent
import android.hardware.SensorEventListener
import android.hardware.SensorManager
import android.os.Bundle
import android.support.design.widget.Snackbar
import android.support.v7.widget.Toolbar
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import butterknife.BindView
import butterknife.ButterKnife
import butterknife.OnClick
import com.commit451.gimbal.Gimbal
import com.commit451.gitlab.App
import com.commit451.gitlab.BuildConfig
import com.commit451.gitlab.R
import com.commit451.gitlab.model.api.Contributor
import com.commit451.gitlab.navigation.Navigator
import com.commit451.gitlab.rx.CustomSingleObserver
import com.commit451.gitlab.util.ImageUtil
import com.commit451.gitlab.util.IntentUtil
import com.commit451.gitlab.view.PhysicsFlowLayout
import com.jawnnypoo.physicslayout.Physics
import com.jawnnypoo.physicslayout.PhysicsConfig
import com.wefika.flowlayout.FlowLayout
import de.hdodenhof.circleimageview.CircleImageView
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
import org.jbox2d.common.Vec2
import timber.log.Timber
/**
* Thats what its all about
*/
class AboutActivity : BaseActivity() {
companion object {
private val REPO_ID = "473568"
fun newIntent(context: Context): Intent {
val intent = Intent(context, AboutActivity::class.java)
return intent
}
}
@BindView(R.id.root)
lateinit var root: ViewGroup
@BindView(R.id.toolbar)
lateinit var toolbar: Toolbar
@BindView(R.id.contributors)
lateinit var textContributors: TextView
@BindView(R.id.physics_layout)
lateinit var physicsLayout: PhysicsFlowLayout
@BindView(R.id.progress)
lateinit var progress: View
lateinit var sensorManager: SensorManager
lateinit var gimbal: Gimbal
var gravitySensor: Sensor? = null
@OnClick(R.id.sauce)
fun onSauceClick() {
if (getString(R.string.url_gitlab) == App.get().account.serverUrl.toString()) {
Navigator.navigateToProject(this@AboutActivity, REPO_ID)
} else {
IntentUtil.openPage(this@AboutActivity, getString(R.string.source_url))
}
}
val sensorEventListener = object : SensorEventListener {
override fun onSensorChanged(event: SensorEvent) {
if (event.sensor.type == Sensor.TYPE_GRAVITY) {
if (physicsLayout.physics.world != null) {
gimbal.normalizeGravityEvent(event)
physicsLayout.physics.world.gravity = Vec2(-event.values[0], event.values[1])
}
}
}
override fun onAccuracyChanged(sensor: Sensor, accuracy: Int) {}
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
gimbal = Gimbal(this)
gimbal.lock()
setContentView(R.layout.activity_about)
ButterKnife.bind(this)
toolbar.setNavigationIcon(R.drawable.ic_back_24dp)
toolbar.setNavigationOnClickListener { onBackPressed() }
toolbar.setTitle(R.string.about)
toolbar.subtitle = BuildConfig.VERSION_NAME
physicsLayout.physics.enableFling()
sensorManager = getSystemService(Context.SENSOR_SERVICE) as SensorManager
gravitySensor = sensorManager.getDefaultSensor(Sensor.TYPE_GRAVITY)
App.get().gitLab.getContributors(REPO_ID)
.compose(this.bindToLifecycle<List<Contributor>>())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(object : CustomSingleObserver<List<Contributor>>() {
override fun error(t: Throwable) {
Timber.e(t)
progress.visibility = View.GONE
Snackbar.make(root, R.string.failed_to_load_contributors, Snackbar.LENGTH_SHORT)
.show()
}
override fun success(contributors: List<Contributor>) {
progress.visibility = View.GONE
addContributors(Contributor.groupContributors(contributors))
}
})
progress.visibility = View.VISIBLE
}
override fun onResume() {
super.onResume()
sensorManager.registerListener(sensorEventListener, gravitySensor, SensorManager.SENSOR_DELAY_GAME)
}
override fun onPause() {
super.onPause()
sensorManager.unregisterListener(sensorEventListener)
}
private fun addContributors(contributors: List<Contributor>) {
val config = PhysicsConfig.create()
config.shapeType = PhysicsConfig.SHAPE_TYPE_CIRCLE
val borderSize = resources.getDimensionPixelSize(R.dimen.border_size)
val imageSize = resources.getDimensionPixelSize(R.dimen.circle_size)
for (i in contributors.indices) {
val contributor = contributors[i]
val imageView = CircleImageView(this)
val llp = FlowLayout.LayoutParams(
imageSize,
imageSize)
imageView.layoutParams = llp
imageView.borderWidth = borderSize
imageView.borderColor = Color.BLACK
Physics.setPhysicsConfig(imageView, config)
physicsLayout.addView(imageView)
val url = ImageUtil.getAvatarUrl(contributor.email, imageSize)
App.get().picasso
.load(url)
.into(imageView)
}
physicsLayout.requestLayout()
}
}
package com.commit451.gitlab.activity;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.widget.Toolbar;
import android.view.View;
import com.commit451.gitlab.App;
import com.commit451.gitlab.R;
import com.commit451.gitlab.data.Prefs;
import com.commit451.gitlab.event.CloseDrawerEvent;
import com.commit451.gitlab.fragment.FeedFragment;
import org.greenrobot.eventbus.Subscribe;
import butterknife.BindView;
import butterknife.ButterKnife;
import timber.log.Timber;
/**
* Displays the current users projects feed
*/
public class ActivityActivity extends BaseActivity {
private static final String TAG_FEED_FRAGMENT = "feed_fragment";
public static Intent newIntent(Context context) {
Intent intent = new Intent(context, ActivityActivity.class);
return intent;
}
@BindView(R.id.drawer_layout)
DrawerLayout drawerLayout;
@BindView(R.id.toolbar)
Toolbar toolbar;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
App.get().getPrefs().setStartingView(Prefs.STARTING_VIEW_ACTIVITY);
setContentView(R.layout.activity_activity);
ButterKnife.bind(this);
App.bus().register(this);
toolbar.setTitle(R.string.nav_activity);
toolbar.setNavigationIcon(R.drawable.ic_menu_24dp);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
drawerLayout.openDrawer(GravityCompat.START);
}
});
FeedFragment feedFragment = (FeedFragment) getSupportFragmentManager().findFragmentByTag(TAG_FEED_FRAGMENT);
if (feedFragment == null) {
Uri feedUri = App.get().getAccount().getServerUrl();
feedUri = feedUri.buildUpon()
.appendPath("dashboard")
.appendPath("projects.atom")
.build();
Timber.d("Showing activity feed for: %s", feedUri.toString());
feedFragment = FeedFragment.newInstance(feedUri);
getSupportFragmentManager().beginTransaction()
.replace(R.id.root_fragment, feedFragment, TAG_FEED_FRAGMENT)
.commit();
}
}
@Override
protected void onDestroy() {
super.onDestroy();
App.bus().unregister(this);
}
@Subscribe
public void onCloseDrawerEvent(CloseDrawerEvent event) {
drawerLayout.closeDrawers();
}
}
package com.commit451.gitlab.activity
import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.support.v4.view.GravityCompat
import android.support.v4.widget.DrawerLayout
import android.support.v7.widget.Toolbar
import butterknife.BindView
import butterknife.ButterKnife
import com.commit451.gitlab.App
import com.commit451.gitlab.R
import com.commit451.gitlab.data.Prefs
import com.commit451.gitlab.event.CloseDrawerEvent
import com.commit451.gitlab.fragment.FeedFragment
import org.greenrobot.eventbus.Subscribe
import timber.log.Timber
/**
* Displays the current users projects feed
*/
class ActivityActivity : BaseActivity() {
companion object {
private val TAG_FEED_FRAGMENT = "feed_fragment"
fun newIntent(context: Context): Intent {
val intent = Intent(context, ActivityActivity::class.java)
return intent
}
}
@BindView(R.id.drawer_layout)
lateinit var drawerLayout: DrawerLayout
@BindView(R.id.toolbar)
lateinit var toolbar: Toolbar
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
App.get().prefs.startingView = Prefs.STARTING_VIEW_ACTIVITY
setContentView(R.layout.activity_activity)
ButterKnife.bind(this)
App.bus().register(this)
toolbar.setTitle(R.string.nav_activity)
toolbar.setNavigationIcon(R.drawable.ic_menu_24dp)
toolbar.setNavigationOnClickListener { drawerLayout.openDrawer(GravityCompat.START) }
var feedFragment: FeedFragment? = supportFragmentManager.findFragmentByTag(TAG_FEED_FRAGMENT) as? FeedFragment
if (feedFragment == null) {
var feedUri = App.get().account.serverUrl
feedUri = feedUri.buildUpon()
.appendPath("dashboard")
.appendPath("projects.atom")
.build()
Timber.d("Showing activity feed for: %s", feedUri.toString())
feedFragment = FeedFragment.newInstance(feedUri)
supportFragmentManager.beginTransaction()
.replace(R.id.root_fragment, feedFragment, TAG_FEED_FRAGMENT)
.commit()
}
}
override fun onDestroy() {
super.onDestroy()
App.bus().unregister(this)
}
@Subscribe
fun onCloseDrawerEvent(event: CloseDrawerEvent) {
drawerLayout.closeDrawers()
}
}
package com.commit451.gitlab.activity;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.design.widget.Snackbar;
import android.support.design.widget.TextInputLayout;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.Toolbar;
import android.text.TextUtils;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.Spinner;
import android.widget.TextView;
import com.commit451.adapterflowlayout.AdapterFlowLayout;
import com.commit451.gitlab.App;
import com.commit451.gitlab.R;
import com.commit451.gitlab.adapter.AddIssueLabelAdapter;
import com.commit451.gitlab.adapter.AssigneeSpinnerAdapter;
import com.commit451.gitlab.adapter.MilestoneSpinnerAdapter;
import com.commit451.gitlab.event.IssueChangedEvent;
import com.commit451.gitlab.event.IssueCreatedEvent;
import com.commit451.gitlab.model.api.Issue;
import com.commit451.gitlab.model.api.Label;
import com.commit451.gitlab.model.api.Member;
import com.commit451.gitlab.model.api.Milestone;
import com.commit451.gitlab.model.api.Project;
import com.commit451.gitlab.navigation.Navigator;
import com.commit451.gitlab.rx.CustomResponseSingleObserver;
import com.commit451.gitlab.rx.CustomSingleObserver;
import com.commit451.teleprinter.Teleprinter;
import org.parceler.Parcels;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import io.reactivex.Single;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
import retrofit2.Response;
import timber.log.Timber;
/**
* Activity to input new issues, but not really a dialog at all wink wink
*/
public class AddIssueActivity extends MorphActivity {
private static final int REQUEST_LABEL = 1;
private static final String KEY_PROJECT = "project";
private static final String KEY_ISSUE = "issue";
public static Intent newIntent(Context context, Project project, Issue issue) {
Intent intent = new Intent(context, AddIssueActivity.class);
intent.putExtra(KEY_PROJECT, Parcels.wrap(project));
if (issue != null) {
intent.putExtra(KEY_ISSUE, Parcels.wrap(issue));
}
return intent;
}
@BindView(R.id.root)
FrameLayout root;
@BindView(R.id.toolbar)
Toolbar toolbar;
@BindView(R.id.title_text_input_layout)
TextInputLayout textInputLayoutTitle;
@BindView(R.id.description)
EditText textDescription;
@BindView(R.id.progress)
View progress;
@BindView(R.id.assignee_progress)
View progressAssignee;
@BindView(R.id.assignee_spinner)
Spinner spinnerAssignee;
@BindView(R.id.milestone_progress)
View progressMilestone;
@BindView(R.id.milestone_spinner)
Spinner spinnerMilestone;
@BindView(R.id.label_label)
TextView textLabel;
@BindView(R.id.labels_progress)
View progressLabels;
@BindView(R.id.root_add_labels)
ViewGroup rootAddLabels;
@BindView(R.id.list_labels)
AdapterFlowLayout listLabels;
AddIssueLabelAdapter adapterLabels;
Teleprinter teleprinter;
Project project;
Issue issue;
HashSet<Member> members;
@OnClick(R.id.text_add_labels)
void onAddLabelClicked() {
Navigator.navigateToAddLabels(this, project, REQUEST_LABEL);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_add_issue);
ButterKnife.bind(this);
morph(root);
teleprinter = new Teleprinter(this);
project = Parcels.unwrap(getIntent().getParcelableExtra(KEY_PROJECT));
issue = Parcels.unwrap(getIntent().getParcelableExtra(KEY_ISSUE));
members = new HashSet<>();
adapterLabels = new AddIssueLabelAdapter(new AddIssueLabelAdapter.Listener() {
@Override
public void onLabelClicked(final Label label) {
new AlertDialog.Builder(AddIssueActivity.this)
.setTitle(R.string.remove)
.setMessage(R.string.are_you_sure_you_want_to_remove)
.setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
adapterLabels.removeLabel(label);
}
})
.setNegativeButton(android.R.string.no, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
})
.show();
}
});
listLabels.setAdapter(adapterLabels);
toolbar.setNavigationIcon(R.drawable.ic_back_24dp);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
toolbar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
switch (item.getItemId()) {
case R.id.action_create:
case R.id.action_edit:
save();
return true;
}
return false;
}
});
if (issue != null) {
bindIssue();
toolbar.inflateMenu(R.menu.menu_edit_milestone);
} else {
toolbar.inflateMenu(R.menu.menu_add_milestone);
}
load();
}
private void load() {
App.get().getGitLab().getMilestones(project.getId(), getString(R.string.milestone_state_value_default))
.compose(this.<Response<List<Milestone>>>bindToLifecycle())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new CustomResponseSingleObserver<List<Milestone>>() {
@Override
public void error(@NonNull Throwable t) {
Timber.e(t);
progressMilestone.setVisibility(View.GONE);
spinnerMilestone.setVisibility(View.GONE);
}
@Override
public void responseSuccess(@NonNull List<Milestone> milestones) {
progressMilestone.setVisibility(View.GONE);
spinnerMilestone.setVisibility(View.VISIBLE);
MilestoneSpinnerAdapter milestoneSpinnerAdapter = new MilestoneSpinnerAdapter(AddIssueActivity.this, milestones);
spinnerMilestone.setAdapter(milestoneSpinnerAdapter);
if (issue != null) {
spinnerMilestone.setSelection(milestoneSpinnerAdapter.getSelectedItemPosition(issue.getMilestone()));
}
}
});
App.get().getGitLab().getProjectMembers(project.getId())
.compose(this.<Response<List<Member>>>bindToLifecycle())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new CustomResponseSingleObserver<List<Member>>() {
@Override
public void error(@NonNull Throwable t) {
Timber.e(t);
spinnerAssignee.setVisibility(View.GONE);
progressAssignee.setVisibility(View.GONE);
}
@Override
public void responseSuccess(@NonNull List<Member> members) {
AddIssueActivity.this.members.addAll(members);
if (project.belongsToGroup()) {
Timber.d("Project belongs to a group, loading those users too");
App.get().getGitLab().getGroupMembers(project.getNamespace().getId())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new CustomResponseSingleObserver<List<Member>>() {
@Override
public void error(@NonNull Throwable t) {
Timber.e(t);
spinnerAssignee.setVisibility(View.GONE);
progressAssignee.setVisibility(View.GONE);
}
@Override
public void responseSuccess(@NonNull List<Member> members) {
AddIssueActivity.this.members.addAll(members);
setAssignees();
}
});
} else {
setAssignees();
}
}
});
App.get().getGitLab().getLabels(project.getId())
.compose(this.<List<Label>>bindToLifecycle())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new CustomSingleObserver<List<Label>>() {
@Override
public void error(@NonNull Throwable t) {
Timber.e(t);
listLabels.setVisibility(View.GONE);
progressLabels.setVisibility(View.GONE);
textLabel.setVisibility(View.GONE);
}
@Override
public void success(@NonNull List<Label> labels) {
progressLabels.setVisibility(View.GONE);
rootAddLabels.setVisibility(View.VISIBLE);
setLabels(labels);
}
});
}
private void showLoading() {
progress.setVisibility(View.VISIBLE);
progress.setAlpha(0.0f);
progress.animate().alpha(1.0f);
}
private void bindIssue() {
if (!TextUtils.isEmpty(issue.getTitle())) {
textInputLayoutTitle.getEditText().setText(issue.getTitle());
}
if (!TextUtils.isEmpty(issue.getDescription())) {
textDescription.setText(issue.getDescription());
}
}
private void setAssignees() {
progressAssignee.setVisibility(View.GONE);
spinnerAssignee.setVisibility(View.VISIBLE);
AssigneeSpinnerAdapter assigneeSpinnerAdapter = new AssigneeSpinnerAdapter(this, new ArrayList<>(members));
spinnerAssignee.setAdapter(assigneeSpinnerAdapter);
if (issue != null) {
spinnerAssignee.setSelection(assigneeSpinnerAdapter.getSelectedItemPosition(issue.getAssignee()));
}
}
private void setLabels(List<Label> projectLabels) {
if (projectLabels != null && !projectLabels.isEmpty() && issue != null && issue.getLabels() != null) {
ArrayList<Label> currentLabels = new ArrayList<>();
for (Label label : projectLabels) {
for (String labelName : issue.getLabels()) {
if (labelName.equals(label.getName())) {
currentLabels.add(label);
}
}
}
if (!currentLabels.isEmpty()) {
adapterLabels.setLabels(currentLabels);
}
}
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
switch (requestCode) {
case REQUEST_LABEL:
if (resultCode == RESULT_OK) {
Label label = Parcels.unwrap(data.getParcelableExtra(AddLabelActivity.KEY_LABEL));
if (adapterLabels.containsLabel(label)) {
Snackbar.make(root, R.string.label_already_added, Snackbar.LENGTH_SHORT)
.show();
} else {
adapterLabels.addLabel(label);
}
}
break;
}
}
@Override
public void onBackPressed() {
new AlertDialog.Builder(this)
.setTitle(R.string.discard)
.setMessage(R.string.are_you_sure_you_want_to_discard)
.setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dismiss();
}
})
.setNegativeButton(android.R.string.no, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
})
.show();
}
private void save() {
if (!TextUtils.isEmpty(textInputLayoutTitle.getEditText().getText())) {
teleprinter.hideKeyboard();
textInputLayoutTitle.setError(null);
showLoading();
Long assigneeId = null;
if (spinnerAssignee.getAdapter() != null) {
//the user did make a selection of some sort. So update it
Member member = (Member) spinnerAssignee.getSelectedItem();
if (member == null) {
//Removes the assignment
assigneeId = 0L;
} else {
assigneeId = member.getId();
}
}
Long milestoneId = null;
if (spinnerMilestone.getAdapter() != null) {
//the user did make a selection of some sort. So update it
Milestone milestone = (Milestone) spinnerMilestone.getSelectedItem();
if (milestone == null) {
//Removes the assignment
milestoneId = 0L;
} else {
milestoneId = milestone.getId();
}
}
String labelsCommaSeperated = adapterLabels.getCommaSeperatedStringOfLabels();
createOrSaveIssue(textInputLayoutTitle.getEditText().getText().toString(),
textDescription.getText().toString(),
assigneeId,
milestoneId,
labelsCommaSeperated);
} else {
textInputLayoutTitle.setError(getString(R.string.required_field));
}
}
private void createOrSaveIssue(String title, String description, @Nullable Long assigneeId,
@Nullable Long milestoneId, @Nullable String labels) {
if (issue == null) {
observeUpdate(App.get().getGitLab().createIssue(
project.getId(),
title,
description,
assigneeId,
milestoneId,
labels));
} else {
observeUpdate(App.get().getGitLab().updateIssue(project.getId(),
issue.getId(),
title,
description,
assigneeId,
milestoneId,
labels));
}
}
private void observeUpdate(Single<Issue> observable) {
observable.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new CustomSingleObserver<Issue>() {
@Override
public void error(@NonNull Throwable t) {
Timber.e(t);
Snackbar.make(root, getString(R.string.failed_to_create_issue), Snackbar.LENGTH_SHORT)
.show();
}
@Override
public void success(@NonNull Issue issue) {
if (AddIssueActivity.this.issue == null) {
App.bus().post(new IssueCreatedEvent(issue));
} else {
App.bus().post(new IssueChangedEvent(issue));
}
dismiss();
}
});
}
}
\ No newline at end of file
package com.commit451.gitlab.activity
import android.app.Activity
import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.os.Parcelable
import android.support.design.widget.Snackbar
import android.support.design.widget.TextInputLayout
import android.support.v7.app.AlertDialog
import android.support.v7.widget.Toolbar
import android.text.TextUtils
import android.view.View
import android.view.ViewGroup
import android.widget.EditText
import android.widget.FrameLayout
import android.widget.Spinner
import android.widget.TextView
import butterknife.BindView
import butterknife.ButterKnife
import butterknife.OnClick
import com.commit451.adapterflowlayout.AdapterFlowLayout
import com.commit451.gitlab.App
import com.commit451.gitlab.R
import com.commit451.gitlab.adapter.AddIssueLabelAdapter
import com.commit451.gitlab.adapter.AssigneeSpinnerAdapter
import com.commit451.gitlab.adapter.MilestoneSpinnerAdapter
import com.commit451.gitlab.event.IssueChangedEvent
import com.commit451.gitlab.event.IssueCreatedEvent
import com.commit451.gitlab.model.api.*
import com.commit451.gitlab.navigation.Navigator
import com.commit451.gitlab.rx.CustomResponseSingleObserver
import com.commit451.gitlab.rx.CustomSingleObserver
import com.commit451.teleprinter.Teleprinter
import io.reactivex.Single
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
import org.parceler.Parcels
import retrofit2.Response
import timber.log.Timber
import java.util.*
/**
* Activity to input new issues, but not really a dialog at all wink wink
*/
class AddIssueActivity : MorphActivity() {
@BindView(R.id.root)
lateinit var root: FrameLayout
@BindView(R.id.toolbar)
lateinit var toolbar: Toolbar
@BindView(R.id.title_text_input_layout)
lateinit var textInputLayoutTitle: TextInputLayout
@BindView(R.id.description)
lateinit var textDescription: EditText
@BindView(R.id.progress)
lateinit var progress: View
@BindView(R.id.assignee_progress)
lateinit var progressAssignee: View
@BindView(R.id.assignee_spinner)
lateinit var spinnerAssignee: Spinner
@BindView(R.id.milestone_progress)
lateinit var progressMilestone: View
@BindView(R.id.milestone_spinner)
lateinit var spinnerMilestone: Spinner
@BindView(R.id.label_label)
lateinit var textLabel: TextView
@BindView(R.id.labels_progress)
lateinit var progressLabels: View
@BindView(R.id.root_add_labels)
lateinit var rootAddLabels: ViewGroup
@BindView(R.id.list_labels)
lateinit var listLabels: AdapterFlowLayout
lateinit var adapterLabels: AddIssueLabelAdapter
lateinit var teleprinter: Teleprinter
lateinit var project: Project
var issue: Issue? = null
lateinit var members: HashSet<Member>
@OnClick(R.id.text_add_labels)
internal fun onAddLabelClicked() {
Navigator.navigateToAddLabels(this, project, REQUEST_LABEL)
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_add_issue)
ButterKnife.bind(this)
morph(root)
teleprinter = Teleprinter(this)
project = Parcels.unwrap<Project>(intent.getParcelableExtra<Parcelable>(KEY_PROJECT))
issue = Parcels.unwrap<Issue>(intent.getParcelableExtra<Parcelable>(KEY_ISSUE))
members = HashSet<Member>()
adapterLabels = AddIssueLabelAdapter(AddIssueLabelAdapter.Listener { label ->
AlertDialog.Builder(this@AddIssueActivity)
.setTitle(R.string.remove)
.setMessage(R.string.are_you_sure_you_want_to_remove)
.setPositiveButton(android.R.string.yes) { dialog, which -> adapterLabels.removeLabel(label) }
.setNegativeButton(android.R.string.no) { dialog, which -> dialog.dismiss() }
.show()
})
listLabels.adapter = adapterLabels
toolbar.setNavigationIcon(R.drawable.ic_back_24dp)
toolbar.setNavigationOnClickListener { onBackPressed() }
toolbar.setOnMenuItemClickListener(Toolbar.OnMenuItemClickListener { item ->
when (item.itemId) {
R.id.action_create, R.id.action_edit -> {
save()
return@OnMenuItemClickListener true
}
}
false
})
if (issue != null) {
bindIssue()
toolbar.inflateMenu(R.menu.menu_edit_milestone)
} else {
toolbar.inflateMenu(R.menu.menu_add_milestone)
}
load()
}
private fun load() {
App.get().gitLab.getMilestones(project.id, getString(R.string.milestone_state_value_default))
.compose(this.bindToLifecycle<Response<List<Milestone>>>())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(object : CustomResponseSingleObserver<List<Milestone>>() {
override fun error(t: Throwable) {
Timber.e(t)
progressMilestone.visibility = View.GONE
spinnerMilestone.visibility = View.GONE
}
override fun responseSuccess(milestones: List<Milestone>) {
progressMilestone.visibility = View.GONE
spinnerMilestone.visibility = View.VISIBLE
val milestoneSpinnerAdapter = MilestoneSpinnerAdapter(this@AddIssueActivity, milestones)
spinnerMilestone.adapter = milestoneSpinnerAdapter
if (issue != null) {
spinnerMilestone.setSelection(milestoneSpinnerAdapter.getSelectedItemPosition(issue!!.milestone))
}
}
})
App.get().gitLab.getProjectMembers(project.id)
.compose(this.bindToLifecycle<Response<List<Member>>>())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(object : CustomResponseSingleObserver<List<Member>>() {
override fun error(t: Throwable) {
Timber.e(t)
spinnerAssignee.visibility = View.GONE
progressAssignee.visibility = View.GONE
}
override fun responseSuccess(members: List<Member>) {
this@AddIssueActivity.members.addAll(members)
if (project.belongsToGroup()) {
Timber.d("Project belongs to a group, loading those users too")
App.get().gitLab.getGroupMembers(project.namespace.id)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(object : CustomResponseSingleObserver<List<Member>>() {
override fun error(t: Throwable) {
Timber.e(t)
spinnerAssignee.visibility = View.GONE
progressAssignee.visibility = View.GONE
}
override fun responseSuccess(members: List<Member>) {
this@AddIssueActivity.members.addAll(members)
setAssignees()
}
})
} else {
setAssignees()
}
}
})
App.get().gitLab.getLabels(project.id)
.compose(this.bindToLifecycle<List<Label>>())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(object : CustomSingleObserver<List<Label>>() {
override fun error(t: Throwable) {
Timber.e(t)
listLabels.visibility = View.GONE
progressLabels.visibility = View.GONE
textLabel.visibility = View.GONE
}
override fun success(labels: List<Label>) {
progressLabels.visibility = View.GONE
rootAddLabels.visibility = View.VISIBLE
setLabels(labels)
}
})
}
private fun showLoading() {
progress.visibility = View.VISIBLE
progress.alpha = 0.0f
progress.animate().alpha(1.0f)
}
private fun bindIssue() {
if (!TextUtils.isEmpty(issue!!.title)) {
textInputLayoutTitle.editText!!.setText(issue!!.title)
}
if (!TextUtils.isEmpty(issue!!.description)) {
textDescription.setText(issue!!.description)
}
}
private fun setAssignees() {
progressAssignee.visibility = View.GONE
spinnerAssignee.visibility = View.VISIBLE
val assigneeSpinnerAdapter = AssigneeSpinnerAdapter(this, ArrayList(members))
spinnerAssignee.adapter = assigneeSpinnerAdapter
if (issue != null) {
spinnerAssignee.setSelection(assigneeSpinnerAdapter.getSelectedItemPosition(issue!!.assignee))
}
}
private fun setLabels(projectLabels: List<Label>?) {
if (projectLabels != null && !projectLabels.isEmpty() && issue != null && issue!!.labels != null) {
val currentLabels = ArrayList<Label>()
for (label in projectLabels) {
for (labelName in issue!!.labels) {
if (labelName == label.name) {
currentLabels.add(label)
}
}
}
if (!currentLabels.isEmpty()) {
adapterLabels.setLabels(currentLabels)
}
}
}
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent) {
super.onActivityResult(requestCode, resultCode, data)
when (requestCode) {
REQUEST_LABEL -> if (resultCode == Activity.RESULT_OK) {
val label = Parcels.unwrap<Label>(data.getParcelableExtra<Parcelable>(AddLabelActivity.KEY_LABEL))
if (adapterLabels.containsLabel(label)) {
Snackbar.make(root, R.string.label_already_added, Snackbar.LENGTH_SHORT)
.show()
} else {
adapterLabels.addLabel(label)
}
}
}
}
override fun onBackPressed() {
AlertDialog.Builder(this)
.setTitle(R.string.discard)
.setMessage(R.string.are_you_sure_you_want_to_discard)
.setPositiveButton(android.R.string.yes) { dialog, which -> dismiss() }
.setNegativeButton(android.R.string.no) { dialog, which -> dialog.dismiss() }
.show()
}
private fun save() {
if (!TextUtils.isEmpty(textInputLayoutTitle.editText!!.text)) {
teleprinter.hideKeyboard()
textInputLayoutTitle.error = null
showLoading()
var assigneeId: Long? = null
if (spinnerAssignee.adapter != null) {
//the user did make a selection of some sort. So update it
val member = spinnerAssignee.selectedItem as? Member?
if (member == null) {
//Removes the assignment
assigneeId = 0L
} else {
assigneeId = member.id
}
}
var milestoneId: Long? = null
if (spinnerMilestone.adapter != null) {
//the user did make a selection of some sort. So update it
val milestone = spinnerMilestone.selectedItem as? Milestone?
if (milestone == null) {
//Removes the assignment
milestoneId = 0L
} else {
milestoneId = milestone.id
}
}
val labelsCommaSeperated = adapterLabels.commaSeperatedStringOfLabels
createOrSaveIssue(textInputLayoutTitle.editText!!.text.toString(),
textDescription.text.toString(),
assigneeId,
milestoneId,
labelsCommaSeperated)
} else {
textInputLayoutTitle.error = getString(R.string.required_field)
}
}
private fun createOrSaveIssue(title: String, description: String, assigneeId: Long?,
milestoneId: Long?, labels: String?) {
if (issue == null) {
observeUpdate(App.get().gitLab.createIssue(
project.id,
title,
description,
assigneeId,
milestoneId,
labels))
} else {
observeUpdate(App.get().gitLab.updateIssue(project.id,
issue!!.id,
title,
description,
assigneeId,
milestoneId,
labels))
}
}
private fun observeUpdate(observable: Single<Issue>) {
observable.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(object : CustomSingleObserver<Issue>() {
override fun error(t: Throwable) {
Timber.e(t)
Snackbar.make(root!!, getString(R.string.failed_to_create_issue), Snackbar.LENGTH_SHORT)
.show()
}
override fun success(issue: Issue) {
if (this@AddIssueActivity.issue == null) {
App.bus().post(IssueCreatedEvent(issue))
} else {
App.bus().post(IssueChangedEvent(issue))
}
dismiss()
}
})
}
companion object {
private val REQUEST_LABEL = 1
private val KEY_PROJECT = "project"
private val KEY_ISSUE = "issue"
fun newIntent(context: Context, project: Project, issue: Issue?): Intent {
val intent = Intent(context, AddIssueActivity::class.java)
intent.putExtra(KEY_PROJECT, Parcels.wrap(project))
if (issue != null) {
intent.putExtra(KEY_ISSUE, Parcels.wrap(issue))
}
return intent
}
}
}
\ No newline at end of file
Loading
Loading
@@ -61,7 +61,7 @@ import timber.log.Timber;
public class Navigator {
 
public static void navigateToAbout(Activity activity) {
activity.startActivity(AboutActivity.newIntent(activity));
activity.startActivity(AboutActivity.Companion.newIntent(activity));
}
 
public static void navigateToSettings(Activity activity) {
Loading
Loading
@@ -114,7 +114,7 @@ public class Navigator {
}
 
public static void navigateToActivity(Activity activity) {
activity.startActivity(ActivityActivity.newIntent(activity));
activity.startActivity(ActivityActivity.Companion.newIntent(activity));
}
 
public static void navigateToTodos(Activity activity) {
Loading
Loading
@@ -204,7 +204,7 @@ public class Navigator {
}
 
public static void navigateToEditIssue(Activity activity, View fab, Project project, Issue issue) {
Intent intent = AddIssueActivity.newIntent(activity, project, issue);
Intent intent = AddIssueActivity.Companion.newIntent(activity, project, issue);
activity.startActivity(intent);
}
 
Loading
Loading
@@ -213,7 +213,7 @@ public class Navigator {
}
 
private static void navigateToAddIssue(Activity activity, View fab, @DrawableRes int drawable, Project project, Issue issue) {
Intent intent = AddIssueActivity.newIntent(activity, project, issue);
Intent intent = AddIssueActivity.Companion.newIntent(activity, project, issue);
startMorphActivity(activity, fab, drawable, intent);
}
 
Loading
Loading
// Top-level build file where you can add configuration options common to all sub-projects/modules.
apply plugin: 'com.github.ben-manes.versions'
buildscript {
ext.kotlin_version = '1.0.6'
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
//check with ./gradlew dependencyUpdates
classpath 'com.github.ben-manes:gradle-versions-plugin:0.13.0'
}
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment