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

Load the pipeline details right away

parent c7e863ea
No related branches found
No related tags found
No related merge requests found
Pipeline #
Showing
with 20 additions and 13 deletions
Loading
Loading
@@ -82,6 +82,7 @@ class ActivityActivity : BaseActivity() {
App.bus().unregister(this)
}
 
@Suppress("UNUSED_PARAMETER")
@Subscribe
fun onEvent(event: CloseDrawerEvent) {
drawerLayout.closeDrawers()
Loading
Loading
Loading
Loading
@@ -167,11 +167,13 @@ class GroupsActivity : BaseActivity() {
})
}
 
@Suppress("UNUSED_PARAMETER")
@Subscribe
fun onEvent(event: CloseDrawerEvent) {
drawerLayout.closeDrawers()
}
 
@Suppress("UNUSED_PARAMETER")
@Subscribe
fun onEvent(event: ReloadDataEvent) {
load()
Loading
Loading
Loading
Loading
@@ -148,7 +148,7 @@ class IssueActivity : BaseActivity() {
val project = project
val issue = issue
if (project != null && issue != null) {
Navigator.navigateToEditIssue(this@IssueActivity, fab, project, issue)
Navigator.navigateToEditIssue(this@IssueActivity, project, issue)
}
}
 
Loading
Loading
Loading
Loading
@@ -85,7 +85,7 @@ class MilestoneActivity : BaseActivity() {
 
@OnClick(R.id.edit)
fun onEditClicked(fab: View) {
Navigator.navigateToEditMilestone(this@MilestoneActivity, fab, project, milestone)
Navigator.navigateToEditMilestone(this@MilestoneActivity, project, milestone)
}
 
override fun onCreate(savedInstanceState: Bundle?) {
Loading
Loading
Loading
Loading
@@ -74,6 +74,7 @@ class ProjectsActivity : BaseActivity() {
}
}
 
@Suppress("UNUSED_PARAMETER")
@Subscribe
fun onEvent(event: CloseDrawerEvent) {
drawerLayout.closeDrawers()
Loading
Loading
Loading
Loading
@@ -49,7 +49,7 @@ class SettingsActivity : BaseActivity() {
}
 
bindPrefs()
switchRequireAuth.setOnCheckedChangeListener { compoundButton, b ->
switchRequireAuth.setOnCheckedChangeListener { _, b ->
Prefs.isRequiredDeviceAuth = b
}
}
Loading
Loading
Loading
Loading
@@ -66,6 +66,7 @@ class TodosActivity : BaseActivity() {
return true
}
 
@Suppress("UNUSED_PARAMETER")
@Subscribe
fun onEvent(event: CloseDrawerEvent) {
drawerLayout.closeDrawers()
Loading
Loading
Loading
Loading
@@ -220,6 +220,7 @@ class IssuesFragment : ButterKnifeFragment() {
adapterIssue.updateIssue(event.issue)
}
 
@Suppress("UNUSED_PARAMETER")
@Subscribe
fun onEvent(event: IssueReloadEvent) {
loadData()
Loading
Loading
Loading
Loading
@@ -193,6 +193,7 @@ class MergeRequestsFragment : ButterKnifeFragment() {
loadData()
}
 
@Suppress("UNUSED_PARAMETER", "unused")
@Subscribe
fun onMergeRequestChanged(event: MergeRequestChangedEvent) {
loadData()
Loading
Loading
Loading
Loading
@@ -74,6 +74,7 @@ class PipelineDescriptionFragment : ButterKnifeFragment() {
swipeRefreshLayout.setOnRefreshListener { load() }
bindPipeline(pipeline)
App.bus().register(this)
load()
}
 
override fun onDestroyView() {
Loading
Loading
@@ -82,12 +83,14 @@ class PipelineDescriptionFragment : ButterKnifeFragment() {
}
 
fun load() {
swipeRefreshLayout.isRefreshing = true
App.get().gitLab.getPipeline(project.id, pipeline.id)
.setup(bindUntilEvent(FragmentEvent.DESTROY_VIEW))
.subscribe(object : CustomSingleObserver<Pipeline>() {
 
override fun error(t: Throwable) {
Timber.e(t)
swipeRefreshLayout.isRefreshing = false
Snackbar.make(root, R.string.unable_to_load_pipeline, Snackbar.LENGTH_LONG)
.show()
}
Loading
Loading
Loading
Loading
@@ -99,7 +99,7 @@ class ProjectsFragment : ButterKnifeFragment() {
override fun onAttach(context: Context?) {
super.onAttach(context)
if (context is Listener) {
listener = context as Listener?
listener = context
}
}
 
Loading
Loading
Loading
Loading
@@ -159,7 +159,7 @@ object Navigator {
startMorphActivity(activity, fab, R.drawable.ic_add_24dp, intent)
}
 
fun navigateToEditIssue(activity: Activity, fab: View, project: Project, issue: Issue) {
fun navigateToEditIssue(activity: Activity, project: Project, issue: Issue) {
val intent = AddIssueActivity.newIntent(activity, project, issue)
activity.startActivity(intent)
}
Loading
Loading
@@ -188,7 +188,7 @@ object Navigator {
startMorphActivity(activity, fab, R.drawable.ic_add_24dp, intent)
}
 
fun navigateToEditMilestone(activity: Activity, fab: View, project: Project, milestone: Milestone) {
fun navigateToEditMilestone(activity: Activity, project: Project, milestone: Milestone) {
val intent = AddMilestoneActivity.newIntent(activity, project.id, milestone)
activity.startActivity(intent)
}
Loading
Loading
Loading
Loading
@@ -47,13 +47,13 @@ class FeedRemoteViewsFactory(private val context: Context, intent: Intent, accou
}
 
override fun onCreate() {
entries = ArrayList<Entry>()
entries = ArrayList()
}
 
override fun onDestroy() {
// In onDestroy() you should tear down anything that was setup for your data source,
// eg. cursors, connections, etc.
entries!!.clear()
entries.clear()
}
 
override fun getCount(): Int {
Loading
Loading
@@ -63,10 +63,10 @@ class FeedRemoteViewsFactory(private val context: Context, intent: Intent, accou
override fun getViewAt(position: Int): RemoteViews? {
// position will always range from 0 to getCount() - 1.
 
if (position >= entries!!.size) {
if (position >= entries.size) {
return null
}
val entry = entries!![position]
val entry = entries[position]
 
val rv = RemoteViews(context.packageName, R.layout.widget_item_entry)
rv.setTextViewText(R.id.title, entry.title)
Loading
Loading
Loading
Loading
@@ -34,10 +34,7 @@ class ProjectFeedWidgetProvider : AppWidgetProvider() {
}
 
override fun onReceive(context: Context, intent: Intent) {
val mgr = AppWidgetManager.getInstance(context)
if (intent.action == ACTION_FOLLOW_LINK) {
val appWidgetId = intent.getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID,
AppWidgetManager.INVALID_APPWIDGET_ID)
val uri = intent.getStringExtra(EXTRA_LINK)
val launchIntent = DeepLinker.generateDeeplinkIntentFromUri(context, Uri.parse(uri))
launchIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
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