Skip to content

Commit 646f0b4

Browse files
Merge pull request nextcloud#12184 from nextcloud/refactor/convert-events-to-kt
Convert Events to Kotlin
2 parents 548f770 + 4d8c97e commit 646f0b4

15 files changed

Lines changed: 84 additions & 187 deletions

app/src/main/java/com/owncloud/android/ui/events/AccountRemovedEvent.java renamed to app/src/main/java/com/owncloud/android/ui/events/AccountRemovedEvent.kt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,9 @@
1818
* You should have received a copy of the GNU Affero General Public License
1919
* along with this program. If not, see <http://www.gnu.org/licenses/>.
2020
*/
21-
22-
package com.owncloud.android.ui.events;
21+
package com.owncloud.android.ui.events
2322

2423
/**
2524
* Event that notifies that an account was removed
2625
*/
27-
28-
public class AccountRemovedEvent {
29-
30-
}
26+
class AccountRemovedEvent

app/src/main/java/com/owncloud/android/ui/events/ChangeMenuEvent.java renamed to app/src/main/java/com/owncloud/android/ui/events/ChangeMenuEvent.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,11 @@
1515
* GNU Affero General Public License for more details.
1616
*
1717
* You should have received a copy of the GNU Affero General Public License
18-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
18+
* along with this program. If not, see <http:></http:>//www.gnu.org/licenses/>.
1919
*/
20-
package com.owncloud.android.ui.events;
20+
package com.owncloud.android.ui.events
2121

2222
/**
2323
* Currently a dummy event to restore grid view, sort, and search
2424
*/
25-
public class ChangeMenuEvent {
26-
}
25+
class ChangeMenuEvent

app/src/main/java/com/owncloud/android/ui/events/CommentsEvent.java renamed to app/src/main/java/com/owncloud/android/ui/events/CommentsEvent.kt

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,9 @@
1818
* You should have received a copy of the GNU General Public License
1919
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2020
*/
21-
22-
package com.owncloud.android.ui.events;
21+
package com.owncloud.android.ui.events
2322

2423
/**
2524
* Event for refreshing comment state of a file
2625
*/
27-
public class CommentsEvent {
28-
public final String remoteId;
29-
30-
public CommentsEvent(String remoteId) {
31-
this.remoteId = remoteId;
32-
}
33-
}
26+
class CommentsEvent(val remoteId: String)

app/src/main/java/com/owncloud/android/ui/events/DummyDrawerEvent.java renamed to app/src/main/java/com/owncloud/android/ui/events/DummyDrawerEvent.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,11 @@
1515
* GNU Affero General Public License for more details.
1616
*
1717
* You should have received a copy of the GNU Affero General Public License
18-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
18+
* along with this program. If not, see <http:></http:>//www.gnu.org/licenses/>.
1919
*/
20-
package com.owncloud.android.ui.events;
20+
package com.owncloud.android.ui.events
2121

2222
/**
2323
* Dummy drawer event
2424
*/
25-
public class DummyDrawerEvent {
26-
}
25+
class DummyDrawerEvent

app/src/main/java/com/owncloud/android/ui/events/EncryptionEvent.java

Lines changed: 0 additions & 37 deletions
This file was deleted.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Nextcloud Android client application
3+
*
4+
* @author Tobias Kaminsky
5+
* Copyright (C) 2017 Tobias Kaminsky
6+
*
7+
* This program is free software: you can redistribute it and/or modify
8+
* it under the terms of the GNU Affero General Public License as published by
9+
* the Free Software Foundation, either version 3 of the License, or
10+
* at your option) any later version.
11+
*
12+
* This program is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU Affero General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU Affero General Public License
18+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19+
*/
20+
package com.owncloud.android.ui.events
21+
22+
/**
23+
* Event for set folder as encrypted/decrypted
24+
*/
25+
class EncryptionEvent(
26+
val localId: Long,
27+
val remoteId: String,
28+
val remotePath: String,
29+
val shouldBeEncrypted: Boolean
30+
)

app/src/main/java/com/owncloud/android/ui/events/FavoriteEvent.java

Lines changed: 0 additions & 33 deletions
This file was deleted.

app/src/main/java/com/owncloud/android/ui/events/VCardToggleEvent.java renamed to app/src/main/java/com/owncloud/android/ui/events/FavoriteEvent.kt

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,11 @@
1515
* GNU Affero General Public License for more details.
1616
*
1717
* You should have received a copy of the GNU Affero General Public License
18-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
18+
* along with this program. If not, see <http:></http:>//www.gnu.org/licenses/>.
1919
*/
20-
package com.owncloud.android.ui.events;
20+
package com.owncloud.android.ui.events
2121

22-
public class VCardToggleEvent {
23-
public boolean showRestoreButton;
24-
25-
public VCardToggleEvent(boolean showRestore) {
26-
this.showRestoreButton = showRestore;
27-
}
28-
}
22+
/**
23+
* Event for making favoriting work
24+
*/
25+
class FavoriteEvent(val remotePath: String, val shouldFavorite: Boolean)

app/src/main/java/com/owncloud/android/ui/events/InitiateSyncedFolder.java

Lines changed: 0 additions & 35 deletions
This file was deleted.

app/src/main/java/com/owncloud/android/ui/events/MenuItemClickEvent.java

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)