Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ import com.example.android.architecture.blueprints.todoapp.data.Task
sealed class TaskDetailEvent {
companion object {
@JvmStatic fun deleteTaskRequested() = DeleteTaskRequested
@JvmStatic fun completeTaskRequested() = CompleteTaskRequested
@JvmStatic fun activateTaskRequested() = ActivateTaskRequested
@JvmStatic fun editTaskRequested() = EditTaskRequested
}
}
object DeleteTaskRequested : TaskDetailEvent()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,15 @@
* limitations under the License.
* -/-/-
*/
package com.example.android.architecture.blueprints.todoapp.taskdetail.view

@ParametersAreNonnullByDefault
package com.example.android.architecture.blueprints.todoapp.taskdetail.view;
interface TaskDetailViewActions {

import javax.annotation.ParametersAreNonnullByDefault;
fun showTaskMarkedComplete()

fun showTaskMarkedActive()

fun showTaskSavingFailed()

fun showTaskDeletionFailed()
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,8 @@
* limitations under the License.
* -/-/-
*/
package com.example.android.architecture.blueprints.todoapp.taskdetail.view;
package com.example.android.architecture.blueprints.todoapp.taskdetail.view

public interface TaskDetailViewActions {
data class TaskDetailViewData(val title: TextViewData, val description: TextViewData, val completedChecked: Boolean)

void showTaskMarkedComplete();

void showTaskMarkedActive();

void showTaskSavingFailed();

void showTaskDeletionFailed();
}
data class TextViewData(val visibility: Int, val text: String)

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Copyright 2016, The Android Open Source Project
* Copyright (c) 2017-2018 Spotify AB
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@file:JvmName("TaskDetailViewDataMapper")

package com.example.android.architecture.blueprints.todoapp.taskdetail.view

import android.view.View
import com.example.android.architecture.blueprints.todoapp.data.Task

fun taskToTaskViewData(task: Task): TaskDetailViewData {
val details = task.details
val title = details.title
val description = details.description

return TaskDetailViewData(
title = TextViewData(if (title.isEmpty()) View.GONE else View.VISIBLE, title),
description = TextViewData(if (description.isEmpty()) View.GONE else View.VISIBLE, description),
completedChecked = details.completed)
}

This file was deleted.

Loading