-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add setting and about view and so on ..
- Loading branch information
Showing
30 changed files
with
889 additions
and
239 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"project_info": { | ||
"project_number": "689745366156", | ||
"firebase_url": "https://readhub-46dc0.firebaseio.com", | ||
"project_id": "readhub-46dc0", | ||
"storage_bucket": "readhub-46dc0.appspot.com" | ||
}, | ||
"client": [ | ||
{ | ||
"client_info": { | ||
"mobilesdk_app_id": "1:689745366156:android:7c480c335dec1735", | ||
"android_client_info": { | ||
"package_name": "com.lovejjfg.readhub" | ||
} | ||
}, | ||
"oauth_client": [ | ||
{ | ||
"client_id": "689745366156-bisjq0200nash35ma70cdk5hol4mhhg9.apps.googleusercontent.com", | ||
"client_type": 3 | ||
} | ||
], | ||
"api_key": [ | ||
{ | ||
"current_key": "AIzaSyCVAQyvtIilb2FsdgqQneeKojWII5L98uI" | ||
} | ||
], | ||
"services": { | ||
"analytics_service": { | ||
"status": 1 | ||
}, | ||
"appinvite_service": { | ||
"status": 1, | ||
"other_platform_oauth_client": [] | ||
}, | ||
"ads_service": { | ||
"status": 2 | ||
} | ||
} | ||
} | ||
], | ||
"configuration_version": "1" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,32 +20,32 @@ package com.lovejjfg.readhub.data | |
|
||
import android.os.Parcel | ||
import android.os.Parcelable | ||
import com.google.gson.annotations.SerializedName | ||
|
||
data class Test( | ||
|
||
@field:SerializedName("name") | ||
val name: String? = "xxxxx", | ||
|
||
@field:SerializedName("age") | ||
val age: Int? = null | ||
) : Parcelable { | ||
companion object { | ||
@JvmField val CREATOR: Parcelable.Creator<Test> = object : Parcelable.Creator<Test> { | ||
override fun createFromParcel(source: Parcel): Test = Test(source) | ||
override fun newArray(size: Int): Array<Test?> = arrayOfNulls(size) | ||
} | ||
} | ||
/** | ||
* Created by Joe on 2017/3/14. | ||
* Email [email protected] | ||
*/ | ||
|
||
data class Library(var name: String?, var des: String?, var jumpUrl: String?) : Parcelable { | ||
constructor(source: Parcel) : this( | ||
source.readString(), | ||
source.readValue(Int::class.java.classLoader) as Int? | ||
source.readString(), | ||
source.readString() | ||
) | ||
|
||
override fun describeContents() = 0 | ||
|
||
override fun writeToParcel(dest: Parcel, flags: Int) { | ||
dest.writeString(name) | ||
dest.writeValue(age) | ||
override fun writeToParcel(dest: Parcel, flags: Int) = with(dest) { | ||
writeString(name) | ||
writeString(des) | ||
writeString(jumpUrl) | ||
} | ||
|
||
companion object { | ||
@JvmField | ||
val CREATOR: Parcelable.Creator<Library> = object : Parcelable.Creator<Library> { | ||
override fun createFromParcel(source: Parcel): Library = Library(source) | ||
override fun newArray(size: Int): Array<Library?> = arrayOfNulls(size) | ||
} | ||
} | ||
} | ||
} |
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
109 changes: 109 additions & 0 deletions
109
app/src/main/java/com/lovejjfg/readhub/view/AboutActivity.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,109 @@ | ||
/* | ||
* | ||
* Copyright (c) 2017. Joe | ||
* | ||
* 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. | ||
* | ||
*/ | ||
|
||
package com.lovejjfg.readhub.view | ||
|
||
import android.databinding.DataBindingUtil | ||
import android.os.Bundle | ||
import android.support.v7.app.AppCompatActivity | ||
import android.support.v7.widget.LinearLayoutManager | ||
import android.view.LayoutInflater | ||
import android.view.ViewGroup | ||
import com.lovejjfg.powerrecycle.PowerAdapter | ||
import com.lovejjfg.powerrecycle.holder.PowerHolder | ||
import com.lovejjfg.readhub.R | ||
import com.lovejjfg.readhub.data.Library | ||
import com.lovejjfg.readhub.databinding.ActivityAboutBinding | ||
import com.lovejjfg.readhub.databinding.HolderAboutInfoBinding | ||
import com.lovejjfg.readhub.utils.JumpUitl | ||
import java.util.* | ||
|
||
/** | ||
* ReadHub | ||
* Created by Joe at 2017/9/5. | ||
*/ | ||
class AboutActivity : AppCompatActivity() { | ||
private var aboutAdapter: PowerAdapter<Library>? = null | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
val contentView = DataBindingUtil.setContentView<ActivityAboutBinding>(this, R.layout.activity_about) | ||
contentView?.toolbar?.setNavigationOnClickListener({ finish() }) | ||
aboutAdapter = AboutAdapter() | ||
val recyclerView = contentView?.recyclerView | ||
recyclerView?.layoutManager = LinearLayoutManager(this) | ||
aboutAdapter?.attachRecyclerView(recyclerView!!) | ||
initData() | ||
aboutAdapter?.setOnItemClickListener({ itemView, position, item -> | ||
JumpUitl.jumpWeb(this, item.jumpUrl) | ||
}) | ||
} | ||
|
||
private fun initData() { | ||
val libraries = ArrayList<Library>() | ||
libraries.add(Library("Readhub", | ||
"Readhub Android 客户端", | ||
"https://github.com/lovejjfg/Readhub")) | ||
libraries.add(Library("Android support libraries", | ||
"The Android support libraries offer a number of features that are not built into the framework.", | ||
"https://developer.android.com/topic/libraries/support-library")) | ||
libraries.add(Library("OkHttp", | ||
"An HTTP & HTTP/2 client for Android and Java applications.", | ||
"http://square.github.io/okhttp/")) | ||
libraries.add(Library("RxKotlin", | ||
"RxJava bindings for Kotlin.", | ||
"https://github.com/ReactiveX/RxKotlin")) | ||
libraries.add(Library("PowerRecyclerView", | ||
"Easy for RecyclerView to pull refresh and load more.", | ||
"https://github.com/lovejjfg/PowerRecyclerView")) | ||
libraries.add(Library("Retrofit", | ||
"A type-safe HTTP client for Android and Java.", | ||
"http://square.github.io/retrofit/")) | ||
libraries.add(Library("RxAndroid", | ||
"RxJava bindings for Android.", | ||
"https://github.com/ReactiveX/RxAndroid")) | ||
libraries.add(Library("RxJava", | ||
"RxJava – Reactive Extensions for the JVM – a library for composing asynchronous and event-based programs using observable sequences for the Java VM.", | ||
"https://github.com/ReactiveX/RxJava")) | ||
libraries.add(Library("Gson", | ||
"A Java serialization/deserialization library to convert Java Objects into JSON and back", | ||
"https://github.com/google/gson")) | ||
|
||
aboutAdapter?.setList(libraries) | ||
|
||
} | ||
|
||
|
||
class AboutAdapter : PowerAdapter<Library>() { | ||
override fun onViewHolderBind(holder: PowerHolder<Library>?, position: Int) { | ||
holder?.onBind(list[position]) | ||
} | ||
|
||
override fun onViewHolderCreate(parent: ViewGroup, viewType: Int): PowerHolder<Library>? { | ||
val infoBinding = DataBindingUtil.inflate<HolderAboutInfoBinding>(LayoutInflater.from(parent.context), R.layout.holder_about_info, parent, false) | ||
return AboutHolder(infoBinding) | ||
} | ||
|
||
} | ||
|
||
class AboutHolder(itemView: HolderAboutInfoBinding) : PowerHolder<Library>(itemView.root) { | ||
private var dataBind: HolderAboutInfoBinding? = itemView | ||
override fun onBind(t: Library?) { | ||
dataBind?.lib = t | ||
} | ||
} | ||
} |
Oops, something went wrong.