Skip to content
Browse files

Update Android SDK to 4.2.2 (17)

  • Loading branch information...
1 parent 54f928d commit 9215da6f098df81b61340d361be58d585070e166 @dodyg committed Jun 19, 2013
Showing with 58 additions and 37 deletions.
  1. +1 −1 .idea/misc.xml
  2. +4 −2 AndroidRivers.iml
  3. +2 −1 HoloEverywhere-master/addons/preferences/preferences.iml
  4. +1 −1 HoloEverywhere-master/addons/preferences/project.properties
  5. +1 −1 HoloEverywhere-master/addons/slidingmenu/project.properties
  6. +2 −1 HoloEverywhere-master/addons/slidingmenu/slidingmenu.iml
  7. +2 −1 HoloEverywhere-master/contrib/ActionBarSherlock/ActionBarSherlock.iml
  8. +1 −1 HoloEverywhere-master/contrib/ActionBarSherlock/project.properties
  9. +2 −1 HoloEverywhere-master/library/library.iml
  10. +1 −1 HoloEverywhere-master/library/project.properties
  11. +2 −1 NewsEngine/NewsEngine.iml
  12. +1 −1 NewsEngine/project.properties
  13. +4 −1 README.md
  14. BIN lib/kotlin-runtime.jar
  15. +1 −1 project.properties
  16. +3 −0 src/com/silverkeytech/android_rivers/InfinityProgressDialog.kt
  17. +4 −0 src/com/silverkeytech/android_rivers/Result.kt
  18. +3 −0 src/com/silverkeytech/android_rivers/ScrollMotionDetector.kt
  19. +1 −3 src/com/silverkeytech/android_rivers/Texts.kt
  20. +3 −6 src/com/silverkeytech/android_rivers/UrlShortener.kt
  21. +1 −1 src/com/silverkeytech/android_rivers/Utils.kt
  22. +4 −1 src/com/silverkeytech/android_rivers/activities/Activities.kt
  23. +4 −3 src/com/silverkeytech/android_rivers/activities/BookmarkCollectionRenderer.kt
  24. +1 −1 src/com/silverkeytech/android_rivers/activities/RiverContentRenderer.kt
  25. +2 −1 src/com/silverkeytech/android_rivers/activities/RiverSourcesRenderer.kt
  26. +2 −1 src/com/silverkeytech/android_rivers/asyncs/DownloadImageAsync.kt
  27. +3 −3 src/com/silverkeytech/android_rivers/fragments/PodcastListFragment.kt
  28. +2 −2 src/com/silverkeytech/android_rivers/fragments/RiverListFragment.kt
View
2 .idea/misc.xml
@@ -3,7 +3,7 @@
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
- <component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true" project-jdk-name="Android 2.3.3 Platform" project-jdk-type="Android SDK">
+ <component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true" project-jdk-name="Android 4.2.2 Platform" project-jdk-type="Android SDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>
View
6 AndroidRivers.iml
@@ -2,7 +2,9 @@
<module type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android" name="Android">
- <configuration />
+ <configuration>
+ <option name="UPDATE_PROPERTY_FILES" value="true" />
+ </configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="true">
@@ -11,7 +13,7 @@
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/gen" isTestSource="false" />
</content>
- <orderEntry type="jdk" jdkName="Android 4.1 Platform" jdkType="Android SDK" />
+ <orderEntry type="jdk" jdkName="Android 4.2.2 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="KotlinRuntime" level="project" />
<orderEntry type="library" name="gson-2.2.2" level="project" />
View
3 HoloEverywhere-master/addons/preferences/preferences.iml
@@ -4,6 +4,7 @@
<facet type="android" name="Android">
<configuration>
<option name="LIBRARY_PROJECT" value="true" />
+ <option name="UPDATE_PROPERTY_FILES" value="true" />
</configuration>
</facet>
</component>
@@ -13,7 +14,7 @@
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/gen" isTestSource="false" />
</content>
- <orderEntry type="jdk" jdkName="Android 4.1 Platform" jdkType="Android SDK" />
+ <orderEntry type="jdk" jdkName="Android 4.2.2 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="library" />
<orderEntry type="module-library">
View
2 HoloEverywhere-master/addons/preferences/project.properties
@@ -11,7 +11,7 @@
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
# Project target.
-target=android-16
+target=android-17
android.library=true
android.library.reference.1=../../library
android.library.reference.2=../../contrib/ActionBarSherlock
View
2 HoloEverywhere-master/addons/slidingmenu/project.properties
@@ -9,6 +9,6 @@
android.library=true
# Project target.
-target=android-16
+target=android-17
android.library.reference.1=../../library
android.library.reference.2=../../contrib/ActionBarSherlock
View
3 HoloEverywhere-master/addons/slidingmenu/slidingmenu.iml
@@ -4,6 +4,7 @@
<facet type="android" name="Android">
<configuration>
<option name="LIBRARY_PROJECT" value="true" />
+ <option name="UPDATE_PROPERTY_FILES" value="true" />
</configuration>
</facet>
</component>
@@ -13,7 +14,7 @@
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/gen" isTestSource="false" />
</content>
- <orderEntry type="jdk" jdkName="Android 4.1 Platform" jdkType="Android SDK" />
+ <orderEntry type="jdk" jdkName="Android 4.2.2 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="library" />
<orderEntry type="module-library">
View
3 HoloEverywhere-master/contrib/ActionBarSherlock/ActionBarSherlock.iml
@@ -4,6 +4,7 @@
<facet type="android" name="Android">
<configuration>
<option name="LIBRARY_PROJECT" value="true" />
+ <option name="UPDATE_PROPERTY_FILES" value="true" />
</configuration>
</facet>
</component>
@@ -14,7 +15,7 @@
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/gen" isTestSource="false" />
</content>
- <orderEntry type="jdk" jdkName="Android 4.1 Platform" jdkType="Android SDK" />
+ <orderEntry type="jdk" jdkName="Android 4.2.2 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library">
<library>
View
2 HoloEverywhere-master/contrib/ActionBarSherlock/project.properties
@@ -9,4 +9,4 @@
android.library=true
# Project target.
-target=android-16
+target=android-17
View
3 HoloEverywhere-master/library/library.iml
@@ -4,6 +4,7 @@
<facet type="android" name="Android">
<configuration>
<option name="LIBRARY_PROJECT" value="true" />
+ <option name="UPDATE_PROPERTY_FILES" value="true" />
</configuration>
</facet>
</component>
@@ -13,7 +14,7 @@
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/gen" isTestSource="false" />
</content>
- <orderEntry type="jdk" jdkName="Android 4.1 Platform" jdkType="Android SDK" />
+ <orderEntry type="jdk" jdkName="Android 4.2.2 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="ActionBarSherlock" />
<orderEntry type="module-library">
View
2 HoloEverywhere-master/library/project.properties
@@ -8,7 +8,7 @@
# project structure.
# Project target.
-target=android-16
+target=android-17
android.library=true
android.library.reference.1=../contrib/ActionBarSherlock
View
3 NewsEngine/NewsEngine.iml
@@ -4,6 +4,7 @@
<facet type="android" name="Android">
<configuration>
<option name="LIBRARY_PROJECT" value="true" />
+ <option name="UPDATE_PROPERTY_FILES" value="true" />
</configuration>
</facet>
</component>
@@ -13,7 +14,7 @@
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/gen" isTestSource="false" />
</content>
- <orderEntry type="jdk" jdkName="Android 4.1 Platform" jdkType="Android SDK" />
+ <orderEntry type="jdk" jdkName="Android 4.2.2 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="KotlinRuntime" level="project" />
</component>
View
2 NewsEngine/project.properties
@@ -12,4 +12,4 @@
android.library=true
# Project target.
-target=android-16
+target=android-17
View
5 README.md
@@ -21,7 +21,10 @@ The mailing list for this project is at groups.google.com/group/news-and-protoco
This code is licensed under GPL version 3. Please read license.txt.
-I develop Android Rivers using <a href="http://kotlin.jetbrains.org/">Kotlin programming language</a>
+I develop Android Rivers using <a href="http://kotlin.jetbrains.org/">Kotlin programming language</a>. It might not be
+obvious that this is Kotlin project since there are a lot of Java code in the project. Most of these Java code are open source
+libraries that Android Rivers include in source form by necessity. Most of the Kotlin code is located at NewsEngine module and
+com.silverkeytech.android_rivers package at the main project.
By reading Android Rivers source code, you will learn about:
View
BIN lib/kotlin-runtime.jar
Binary file not shown.
View
2 project.properties
@@ -11,7 +11,7 @@
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
# Project target.
-target=android-16
+target=android-17
android.library.reference.1=HoloEverywhere-master/contrib/ActionBarSherlock
android.library.reference.2=HoloEverywhere-master/library
android.library.reference.3=HoloEverywhere-master/addons/preferences
View
3 src/com/silverkeytech/android_rivers/InfinityProgressDialog.kt
@@ -22,6 +22,9 @@ import android.content.Context
import android.content.DialogInterface
import org.holoeverywhere.app.ProgressDialog
+/*
+This is a progress dialog that show indeterminate progress (there is no 0..100 % progress indicator)
+ */
public class InfinityProgressDialog(ctx: Context, val message: String): ProgressDialog(ctx){
{
super.setCancelable(true)
View
4 src/com/silverkeytech/android_rivers/Result.kt
@@ -20,6 +20,10 @@ package com.silverkeytech.android_rivers
public class None(){
}
+/*
+This is a common class used to hold result of an operation. If the operation throws an exception, the exception is available
+on .exception property
+ */
public data class Result<T: Any>(p1: T?, p2: Exception? = null){
class object{
//return True result
View
3 src/com/silverkeytech/android_rivers/ScrollMotionDetector.kt
@@ -23,6 +23,9 @@ import android.view.View
import android.view.MotionEvent
import android.util.Log
+/*
+This is a utility class to handle user scroll/swipe movement and to differentiate a click with a swipe motion
+ */
public class ScrollMotionDetector (scrollTreshold : Float = 10.0){
class object {
public val TAG: String = javaClass<ScrollMotionDetector>().getSimpleName()
View
4 src/com/silverkeytech/android_rivers/Texts.kt
@@ -47,9 +47,7 @@ fun scrubHtml(text: String?): String {
for(i in 0..(spannedObjects.size - 1)){
if (spannedObjects[i] is ImageSpan){
val img = spannedObjects[i] as ImageSpan
- if (img != null){
- spanned.replace(spanned.getSpanStart(img), spanned.getSpanEnd(img), "")
- }
+ spanned.replace(spanned.getSpanStart(img), spanned.getSpanEnd(img), "")
}
}
View
9 src/com/silverkeytech/android_rivers/UrlShortener.kt
@@ -21,14 +21,11 @@ package com.silverkeytech.android_rivers
import com.github.kevinsawicki.http.HttpRequest
import com.google.gson.Gson
-public class shortenData (public val longUrl: String){
-}
-
-public class shortenDataReply(public val kind: String, public val id: String, public longUrl: String){
-}
-
public fun googleShorten(url: String): Result<String>
{
+ class shortenData (public val longUrl: String)
+ class shortenDataReply(public val kind: String, public val id: String, public longUrl: String)
+
try
{
val gson = Gson()
View
2 src/com/silverkeytech/android_rivers/Utils.kt
@@ -167,7 +167,7 @@ fun isModernAndroid(): Boolean {
}
fun Dialog?.findView<T : View>(id : Int) : T{
- return this!!.findViewById(id) as T
+ return this!!.findView<T>(id) as T
}
fun View?.findView<T : View>(id : Int) : T{
View
5 src/com/silverkeytech/android_rivers/activities/Activities.kt
@@ -54,7 +54,10 @@ public fun Activity.getStandardDialogBackgroundColor(): Int {
*/
}
-public fun Activity.findView<T: View>(id: Int): T {
+public fun Activity?.findView<T: View>(id: Int): T {
+ if (this == null)
+ throw Exception("Activity cannot be null");
+
return (this.findViewById(id) as T)
}
View
7 src/com/silverkeytech/android_rivers/activities/BookmarkCollectionRenderer.kt
@@ -39,6 +39,7 @@ import com.silverkeytech.android_rivers.getVisualPref
import com.silverkeytech.android_rivers.startFeedActivity
import com.silverkeytech.android_rivers.handleFontResize
import com.silverkeytech.android_rivers.createConfirmationDialog
+import com.silverkeytech.android_rivers.findView
public class BookmarkCollectionRenderer(val context: BookmarkCollectionActivity){
class object {
@@ -49,7 +50,7 @@ public class BookmarkCollectionRenderer(val context: BookmarkCollectionActivity)
val textSize = context.getVisualPref().listTextSize
if (bookmarks.count() == 0){
- var msg = context.findViewById(R.id.collection_message_tv)!! as TextView
+ var msg = context.findView<TextView>(R.id.collection_message_tv)
handleFontResize(msg, context.getString(R.string.empty_bookmark_collection_items_list)!!, textSize.toFloat())
}
@@ -89,7 +90,7 @@ public class BookmarkCollectionRenderer(val context: BookmarkCollectionActivity)
if (vw == null){
vw = inflater().inflate(android.R.layout.simple_list_item_1, parent, false)
- holder = ViewHolder(vw!!.findViewById(android.R.id.text1) as TextView)
+ holder = ViewHolder(vw.findView<TextView>(android.R.id.text1))
vw!!.setTag(holder)
}else{
holder = vw!!.getTag() as ViewHolder
@@ -119,7 +120,7 @@ fun showCollectionQuickActionPopup(context: BookmarkCollectionActivity, bookmark
pp.dismiss()
}
- val icon = x.findViewById(R.id.collection_quick_action_delete_icon) as ImageView
+ val icon = x.findView<ImageView>(R.id.collection_quick_action_delete_icon)
icon.setOnClickListener {
val dlg = createConfirmationDialog(context = context, message = "Are you sure about removing this collection bookmark?", positive = {
try{
View
2 src/com/silverkeytech/android_rivers/activities/RiverContentRenderer.kt
@@ -177,7 +177,7 @@ public class RiverContentRenderer(val context: Activity, val language: String){
body.setOnTouchListener(listener)
- var source = dlg.findViewById(R.id.news_details_source_tv)!! as TextView
+ var source = dlg.findView<TextView>(R.id.news_details_source_tv)
handleForeignText(language, body, msg)
handleForeignTextStyle(context, language, body, textSize.toFloat())
handleTextColorBasedOnTheme(context, body)
View
3 src/com/silverkeytech/android_rivers/activities/RiverSourcesRenderer.kt
@@ -31,6 +31,7 @@ import android.widget.TextView
import com.silverkeytech.android_rivers.getVisualPref
import com.silverkeytech.android_rivers.startFeedActivity
import com.silverkeytech.android_rivers.handleFontResize
+import com.silverkeytech.android_rivers.findView
public class RiverSourcesRenderer(val context: RiverSourcesActivity, val language: String){
class object {
@@ -68,7 +69,7 @@ public class RiverSourcesRenderer(val context: RiverSourcesActivity, val languag
if (vw == null){
vw = inflater.inflate(android.R.layout.simple_list_item_1, parent, false)
- holder = ViewHolder(vw!!.findViewById(android.R.id.text1) as TextView)
+ holder = ViewHolder(vw!!.findView<TextView>(android.R.id.text1))
vw!!.setTag(holder)
}else{
holder = vw!!.getTag() as ViewHolder
View
3 src/com/silverkeytech/android_rivers/asyncs/DownloadImageAsync.kt
@@ -39,6 +39,7 @@ import com.silverkeytech.android_rivers.InfinityProgressDialog
import com.silverkeytech.android_rivers.R
import com.silverkeytech.android_rivers.generateThrowawayName
import com.silverkeytech.android_rivers.imageMimeTypeToFileExtension
+import com.silverkeytech.android_rivers.findView
public data class DownloadedFile(val contentType: String, val filePath: String)
@@ -97,7 +98,7 @@ public class DownloadImageAsync(it: Context?): AsyncTask<String, Int, Result<Dow
return
}
- var image = vw.findViewById(R.id.image_view_main_iv) as ImageView
+ var image = vw.findView<ImageView>(R.id.image_view_main_iv)
var bmp: Bitmap?
try{
View
6 src/com/silverkeytech/android_rivers/fragments/PodcastListFragment.kt
@@ -147,7 +147,7 @@ public class PodcastListFragment(): MainListFragment() {
}
fun showMessage(msg: String) {
- val txt = getView()!!.findViewById(R.id.podcast_list_fragment_message_tv) as TextView
+ val txt = getView()!!.findView<TextView>(R.id.podcast_list_fragment_message_tv)
if (msg.isNullOrEmpty()){
txt.setVisibility(View.INVISIBLE)
txt.setText("")
@@ -176,7 +176,7 @@ public class PodcastListFragment(): MainListFragment() {
//show and prepare the interaction for each individual news item
fun renderFileListing(podcasts: List<Podcast>) {
//now sort it so people always have the latest news first
- val list = getView()!!.findViewById(android.R.id.list) as ListView
+ val list = getView()!!.findView<ListView>(android.R.id.list)
val textSize = parent.getVisualPref().listTextSize
@@ -240,7 +240,7 @@ public class PodcastListFragment(): MainListFragment() {
pp.dismiss()
}
- val icon = x.findViewById(R.id.podcast_quick_action_delete_icon) as ImageView
+ val icon = x.findView<ImageView>(R.id.podcast_quick_action_delete_icon)
icon.setOnClickListener {
val dlg = createConfirmationDialog(context = context, message = "Are you sure about deleting this podcast?", positive = {
try{
View
4 src/com/silverkeytech/android_rivers/fragments/RiverListFragment.kt
@@ -70,7 +70,7 @@ import com.silverkeytech.android_rivers.isLocalUrl
import com.silverkeytech.android_rivers.extractIdFromLocalUrl
import com.silverkeytech.android_rivers.startDownloadAllRiverService
import com.silverkeytech.android_rivers.createConfirmationDialog
-import com.silverkeytech.android_rivers.MessageEvent
+import com.silverkeytech.android_rivers.findView
public class RiverListFragment(): MainListFragment() {
class object {
@@ -131,7 +131,7 @@ public class RiverListFragment(): MainListFragment() {
setSortButtonText(sort, nextSort)
val refresh = menu.findItem(R.id.river_list_fragment_menu_refresh)!!
- val list = getView()!!.findViewById(android.R.id.list) as ListView
+ val list = getView()!!.findView<ListView>(android.R.id.list)
if (list.getCount() != 0)
refresh.setVisible(false)

0 comments on commit 9215da6

Please sign in to comment.
Something went wrong with that request. Please try again.