forked from renyuneyun/Easer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5eb60c2
commit f795f5d
Showing
172 changed files
with
2,152 additions
and
477 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
app/src/main/java/ryey/easer/core/RemoteOperationPluginInfo.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* | ||
* Copyright (c) 2016 - 2018 Rui Zhao <[email protected]> | ||
* | ||
* This file is part of Easer. | ||
* | ||
* Easer is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* Easer is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with Easer. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package ryey.easer.core | ||
|
||
import android.os.Parcel | ||
import android.os.Parcelable | ||
import ryey.easer.commons.plugindef.operationplugin.Category | ||
import ryey.easer.remote_plugin.RemotePlugin | ||
|
||
class RemoteOperationPluginInfo(packageName: String, pluginId: String, | ||
pluginName: String, val category: Category) | ||
: RemotePluginInfo(packageName, pluginId, pluginName, RemotePlugin.TYPE_OPERATION_PLUGIN) { | ||
|
||
constructor(packageName: String, pluginId: String, | ||
pluginName: String, category: String) | ||
: this(packageName, pluginId, pluginName, | ||
try { | ||
Category.valueOf(category) | ||
} catch (e: Exception) { | ||
Category.unknown | ||
}) | ||
|
||
constructor(parcel: Parcel) : this( | ||
parcel.readString(), | ||
parcel.readString(), | ||
parcel.readString(), | ||
parcel.readString()) | ||
|
||
override fun writeToParcel(parcel: Parcel, flags: Int) { | ||
parcel.writeString(packageName) | ||
parcel.writeString(pluginId) | ||
parcel.writeString(pluginName) | ||
parcel.writeString(category.toString()) | ||
} | ||
|
||
override fun describeContents(): Int { | ||
return 0 | ||
} | ||
|
||
companion object CREATOR : Parcelable.Creator<RemoteOperationPluginInfo> { | ||
override fun createFromParcel(parcel: Parcel): RemoteOperationPluginInfo { | ||
return RemoteOperationPluginInfo(parcel) | ||
} | ||
|
||
override fun newArray(size: Int): Array<RemoteOperationPluginInfo?> { | ||
return arrayOfNulls(size) | ||
} | ||
} | ||
} |
Oops, something went wrong.