diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 49beec1..dfb02a7 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,15 +1,15 @@ + package="org.freedombox.freedombox"> - + - + - + - + - - + - + - + diff --git a/app/src/main/java/org/freedombox/freedombox/Constants.kt b/app/src/main/java/org/freedombox/freedombox/Constants.kt index 55c2f2f..b046c64 100644 --- a/app/src/main/java/org/freedombox/freedombox/Constants.kt +++ b/app/src/main/java/org/freedombox/freedombox/Constants.kt @@ -17,6 +17,6 @@ package org.freedombox.freedombox -const val DEFAULT_IP = "http://10.42.0.1" +const val DEFAULT_IP = "https://10.42.0.1:4430/plinth/api/1/services" const val SERVICES_URL = "services.json" const val APP_RESPONSE = "appResponse" diff --git a/app/src/main/java/org/freedombox/freedombox/modules/AppModule.kt b/app/src/main/java/org/freedombox/freedombox/modules/AppModule.kt index 9388865..c5527f3 100644 --- a/app/src/main/java/org/freedombox/freedombox/modules/AppModule.kt +++ b/app/src/main/java/org/freedombox/freedombox/modules/AppModule.kt @@ -20,6 +20,8 @@ package org.freedombox.freedombox.modules import android.app.Application import android.content.SharedPreferences import android.preference.PreferenceManager +import com.google.gson.Gson +import com.google.gson.GsonBuilder import dagger.Module import dagger.Provides import org.freedombox.freedombox.utils.ImageRenderer @@ -42,4 +44,7 @@ class AppModule(val application: Application) { @Singleton fun provideImageRenderer(): ImageRenderer = ImageRenderer(application.applicationContext) + + @Provides + fun provideGson() : Gson = GsonBuilder().setPrettyPrinting().create(); } diff --git a/app/src/main/java/org/freedombox/freedombox/utils/ImageRenderer.kt b/app/src/main/java/org/freedombox/freedombox/utils/ImageRenderer.kt index c810ede..2c58166 100644 --- a/app/src/main/java/org/freedombox/freedombox/utils/ImageRenderer.kt +++ b/app/src/main/java/org/freedombox/freedombox/utils/ImageRenderer.kt @@ -32,23 +32,31 @@ import org.freedombox.freedombox.svg.SvgDecoder import org.freedombox.freedombox.svg.SvgDrawableTranscoder import java.io.InputStream -class ImageRenderer(context: Context) { +class ImageRenderer(val context: Context) { private val requestBuilder: GenericRequestBuilder = Glide - .with(context) - .using(Glide.buildStreamModelLoader(Uri::class.java, context), InputStream::class.java) - .from(Uri::class.java) - .`as`(SVG::class.java) - .transcode(SvgDrawableTranscoder(), PictureDrawable::class.java) - .sourceEncoder(StreamEncoder()) - .cacheDecoder(FileToStreamDecoder(SvgDecoder())) - .decoder(SvgDecoder()) - .dontAnimate() - .error(R.drawable.ic_logo) + .with(context) + .using(Glide.buildStreamModelLoader(Uri::class.java, context), InputStream::class.java) + .from(Uri::class.java) + .`as`(SVG::class.java) + .transcode(SvgDrawableTranscoder(), PictureDrawable::class.java) + .sourceEncoder(StreamEncoder()) + .cacheDecoder(FileToStreamDecoder(SvgDecoder())) + .decoder(SvgDecoder()) + .dontAnimate() + .error(R.drawable.ic_logo) - fun loadImageFromURL(url: Uri, imageView: ImageView) { + fun loadSvgImageFromURL(url: Uri, imageView: ImageView) { requestBuilder - .diskCacheStrategy(DiskCacheStrategy.SOURCE) - .load(url) - .into(imageView) + .diskCacheStrategy(DiskCacheStrategy.SOURCE) + .load(url) + .into(imageView) + } + + fun loadImageFromURL(url: Uri, imageView: ImageView) { + Glide.with(context) + .load(url) + .diskCacheStrategy(DiskCacheStrategy.SOURCE) + .error(R.drawable.ic_logo) + .into(imageView) } } diff --git a/app/src/main/java/org/freedombox/freedombox/views/adapter/DiscoveryListAdapter.kt b/app/src/main/java/org/freedombox/freedombox/views/adapter/DiscoveryListAdapter.kt index 586fc68..b67a0de 100644 --- a/app/src/main/java/org/freedombox/freedombox/views/adapter/DiscoveryListAdapter.kt +++ b/app/src/main/java/org/freedombox/freedombox/views/adapter/DiscoveryListAdapter.kt @@ -18,38 +18,49 @@ package org.freedombox.freedombox.views.adapter import android.content.Context +import android.support.v7.widget.RecyclerView import android.view.LayoutInflater import android.view.View import android.view.ViewGroup -import android.widget.BaseAdapter import android.widget.TextView import org.freedombox.freedombox.R -class DiscoveryListAdapter(val context: Context, +class DiscoveryListAdapter(private val context: Context, private val boxNameList: List, - private val portList: List) : BaseAdapter() { + private val portList: List, + private val itemClickListener: DiscoveryListAdapter.OnItemClickListener) : RecyclerView.Adapter() { - override fun getView(position: Int, convertView: View?, parent: ViewGroup?): View { - var inflaterView = convertView - - if (inflaterView == null) { - val inflater = context.getSystemService(Context.LAYOUT_INFLATER_SERVICE) - as LayoutInflater - inflaterView = inflater.inflate(R.layout.discovery_listview, null) + override fun onBindViewHolder(holder: DiscoveryListItemViewHolder?, position: Int) { + holder.let { + holder?.updateView(boxNameList[position], portList[position]) } + } - val boxName = inflaterView!!.findViewById(R.id.boxName) - val port = inflaterView.findViewById(R.id.port) + override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): DiscoveryListItemViewHolder { + val inflater = context.getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater + val view = inflater.inflate(R.layout.discovery_listview, null) + return DiscoveryListItemViewHolder(view) + } - boxName.text = boxNameList[position] - port.text = portList[position] + override fun getItemCount(): Int = boxNameList.size - return inflaterView - } + inner class DiscoveryListItemViewHolder(view: View) : RecyclerView.ViewHolder(view) { + var boxNameTextView: TextView = view.findViewById(R.id.boxName) as TextView + var portNumberTextView: TextView = view.findViewById(R.id.port) as TextView - override fun getItem(position: Int) = boxNameList[position] + init { + view.setOnClickListener { itemClickListener.onItemClick(adapterPosition) } + } - override fun getItemId(position: Int) = boxNameList[position].hashCode().toLong() + fun updateView(boxName: String, portNumber: String) { + boxNameTextView.text = boxName + portNumberTextView.text = portNumber + } + } - override fun getCount() = boxNameList.size + fun getItem(position: Int) : String = boxNameList.get(position) + + interface OnItemClickListener { + fun onItemClick(position: Int) + } } diff --git a/app/src/main/java/org/freedombox/freedombox/views/adapter/GridAdapter.kt b/app/src/main/java/org/freedombox/freedombox/views/adapter/GridAdapter.kt index 34075b6..15a4abc 100644 --- a/app/src/main/java/org/freedombox/freedombox/views/adapter/GridAdapter.kt +++ b/app/src/main/java/org/freedombox/freedombox/views/adapter/GridAdapter.kt @@ -30,7 +30,9 @@ import kotlinx.android.synthetic.main.app_container.view.appDescription import kotlinx.android.synthetic.main.app_container.view.appIcon import kotlinx.android.synthetic.main.app_container.view.appName import kotlinx.android.synthetic.main.app_container.view.cardHolder +import org.freedombox.freedombox.DEFAULT_IP import org.freedombox.freedombox.R +import org.freedombox.freedombox.SERVICES_URL import org.freedombox.freedombox.utils.ImageRenderer import java.util.Locale @@ -40,21 +42,24 @@ class GridAdapter(val context: Context, val imageRenderer: ImageRenderer) : Base override fun getView(position: Int, convertView: View?, parent: ViewGroup?): View { val inflater = context - .getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater + .getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater val rowView = inflater.inflate(R.layout.app_container, null) val appDetail = items[position].asJsonObject val locale = Locale.getDefault() - rowView.appName.text = appDetail["label"] - .asJsonObject[locale.language] - .asString - rowView.appDescription.text = appDetail["description"] - .asJsonObject[locale.language] - .asString + rowView.appName.text = appDetail["name"] + .asJsonObject[locale.language] + .asString + rowView.appDescription.text = appDetail["short_description"]?.let { + appDetail["short_description"] + .asJsonObject[locale.language] + .asString + } + val url = listOf(DEFAULT_IP, appDetail["icon"].asString).joinToString(separator = "/") imageRenderer.loadImageFromURL( - Uri.parse(appDetail["icon"].asString), - rowView.appIcon + Uri.parse(url), + rowView.appIcon ) rowView.appIcon.setOnClickListener {} diff --git a/app/src/main/java/org/freedombox/freedombox/views/fragments/DiscoveryFragment.kt b/app/src/main/java/org/freedombox/freedombox/views/fragments/DiscoveryFragment.kt index dff07af..953786b 100644 --- a/app/src/main/java/org/freedombox/freedombox/views/fragments/DiscoveryFragment.kt +++ b/app/src/main/java/org/freedombox/freedombox/views/fragments/DiscoveryFragment.kt @@ -23,42 +23,47 @@ import android.content.SharedPreferences import android.net.nsd.NsdManager import android.net.nsd.NsdServiceInfo import android.os.Bundle +import android.support.v7.widget.LinearLayoutManager import android.util.Log import android.view.View -import com.google.gson.GsonBuilder +import com.google.gson.Gson import com.google.gson.reflect.TypeToken -import kotlinx.android.synthetic.main.fragment_discovery.configuredGroup -import kotlinx.android.synthetic.main.fragment_discovery.configuredListView -import kotlinx.android.synthetic.main.fragment_discovery.discoveredListView +import kotlinx.android.synthetic.main.fragment_discovery.* import org.freedombox.freedombox.R import org.freedombox.freedombox.components.AppComponent import org.freedombox.freedombox.utils.storage.getSharedPreference import org.freedombox.freedombox.views.activities.LauncherActivity import org.freedombox.freedombox.views.adapter.DiscoveryListAdapter +import org.freedombox.freedombox.views.adapter.DiscoveryListAdapter.OnItemClickListener import org.freedombox.freedombox.views.model.ConfigModel import javax.inject.Inject class DiscoveryFragment : BaseFragment() { - val TAG = "DISCOVERY_FRAGMENT" - lateinit var adapter: DiscoveryListAdapter + private val TAG: String = DiscoveryFragment::class.java.simpleName + + private lateinit var discoveredBoxListAdapter: DiscoveryListAdapter + + private val discoveredBoxList = mutableListOf() - val discoveredBoxList = mutableListOf() private var configuredBoxList = listOf() - val discoveredPortList = mutableListOf() + private val discoveredPortList = mutableListOf() + private var configuredPortList = listOf() - var configuredBoxSetupList = listOf() + private var configuredBoxSetupList = listOf() private val SERVICE = "_freedombox._tcp" @Inject lateinit var sharedPreferences: SharedPreferences - lateinit var nsdManager: NsdManager + private lateinit var nsdManager: NsdManager private lateinit var discoveryListener: FBXDiscoveryListener + @Inject lateinit var gson: Gson + override fun onActivityCreated(savedInstanceState: Bundle?) { super.onActivityCreated(savedInstanceState) @@ -69,14 +74,13 @@ class DiscoveryFragment : BaseFragment() { nsdManager.discoverServices(SERVICE, NsdManager.PROTOCOL_DNS_SD, discoveryListener) val configuredBoxesJSON = getSharedPreference(sharedPreferences, - getString(R.string.default_box)) + getString(R.string.default_box)) configuredBoxesJSON?.let { - val gson = GsonBuilder().setPrettyPrinting().create() configuredBoxSetupList += gson. - fromJson>(configuredBoxesJSON, - object : TypeToken>() {}.type) + fromJson>(configuredBoxesJSON, + object : TypeToken>() {}.type) for (configModel in configuredBoxSetupList) { configuredBoxList += configModel.domain configuredPortList += "80" @@ -84,30 +88,31 @@ class DiscoveryFragment : BaseFragment() { configuredGroup.visibility = View.VISIBLE - adapter = DiscoveryListAdapter(activity!!.applicationContext, - configuredBoxList, - configuredPortList) - configuredListView.adapter = adapter + val configuredBoxListAdapter = DiscoveryListAdapter(activity!!.applicationContext, + configuredBoxList, + configuredPortList, object : OnItemClickListener { + override fun onItemClick(position: Int) { + val intent = Intent(activity, LauncherActivity::class.java) + intent.putExtra(getString(R.string.current_box), configuredBoxList[position]) + startActivity(intent) + } + }) + configuredListView.layoutManager = LinearLayoutManager(activity) + configuredListView.adapter = configuredBoxListAdapter + } - configuredListView.setOnItemClickListener { _, _, position, _ -> + discoveredBoxListAdapter = DiscoveryListAdapter(activity!!.applicationContext, + discoveredBoxList, + discoveredPortList, object : OnItemClickListener { + override fun onItemClick(position: Int) { val intent = Intent(activity, LauncherActivity::class.java) - intent.putExtra(getString(R.string.current_box), configuredBoxList[position]) + intent.putExtra(getString(R.string.current_box), + discoveredBoxList[position]) startActivity(intent) } - - } - - adapter = DiscoveryListAdapter(activity!!.applicationContext, - discoveredBoxList, - discoveredPortList) - discoveredListView.adapter = adapter - - discoveredListView.setOnItemClickListener { _, _, position, _ -> - val intent = Intent(activity, LauncherActivity::class.java) - intent.putExtra(getString(R.string.current_box), - discoveredBoxList[position]) - startActivity(intent) - } + }) + discoveredListView.layoutManager = LinearLayoutManager(activity) + discoveredListView.adapter = discoveredBoxListAdapter } companion object { @@ -148,8 +153,7 @@ class DiscoveryFragment : BaseFragment() { discoveredPortList.add(serviceInfo.port.toString()) } activity!!.runOnUiThread { - adapter.notifyDataSetChanged() - Log.i(TAG, "runOnUiThread") + discoveredBoxListAdapter.notifyDataSetChanged() } } @@ -157,8 +161,8 @@ class DiscoveryFragment : BaseFragment() { inner class FBXDiscoveryListener : NsdManager.DiscoveryListener { override fun onServiceFound(serviceInfo: NsdServiceInfo) { - Log.d(TAG, serviceInfo.serviceType) - Log.d(TAG, serviceInfo.serviceName) + Log.d(TAG, String.format("onServiceFound() serviceType %s", serviceInfo.serviceType)) + Log.d(TAG, String.format("onServiceFound() serviceName %s", serviceInfo.serviceName)) discoveredBoxList.clear() discoveredPortList.clear() nsdManager.resolveService(serviceInfo, FBXResolveListener()) diff --git a/app/src/main/java/org/freedombox/freedombox/views/fragments/LauncherFragment.kt b/app/src/main/java/org/freedombox/freedombox/views/fragments/LauncherFragment.kt index b76dac0..0e43554 100644 --- a/app/src/main/java/org/freedombox/freedombox/views/fragments/LauncherFragment.kt +++ b/app/src/main/java/org/freedombox/freedombox/views/fragments/LauncherFragment.kt @@ -17,14 +17,11 @@ package org.freedombox.freedombox.views.fragments -import android.content.Intent import android.content.SharedPreferences import android.os.Bundle import android.view.View import com.google.gson.JsonParser -import kotlinx.android.synthetic.main.fragment_launcher.appGrid -import kotlinx.android.synthetic.main.fragment_launcher.appsNotAvailable -import kotlinx.android.synthetic.main.fragment_launcher.fab +import kotlinx.android.synthetic.main.fragment_launcher.* import org.freedombox.freedombox.APP_RESPONSE import org.freedombox.freedombox.DEFAULT_IP import org.freedombox.freedombox.R @@ -32,7 +29,6 @@ import org.freedombox.freedombox.SERVICES_URL import org.freedombox.freedombox.components.AppComponent import org.freedombox.freedombox.utils.ImageRenderer import org.freedombox.freedombox.utils.network.getFBXApps -import org.freedombox.freedombox.views.activities.SetupActivity import org.freedombox.freedombox.views.adapter.GridAdapter import org.json.JSONObject import javax.inject.Inject @@ -52,12 +48,12 @@ class LauncherFragment : BaseFragment() { appGrid.adapter = adapter - fab.setOnClickListener { + /*fab.setOnClickListener { val currentBoxName = activity!!.intent.getStringExtra(getString(R.string.current_box)) val intent = Intent(activity, SetupActivity::class.java) intent.putExtra(getString(R.string.current_box), currentBoxName) startActivity(intent) - } + }*/ val onSuccess = fun(response: JSONObject) { val services = JsonParser().parse(response["services"].toString()).asJsonArray diff --git a/app/src/main/java/org/freedombox/freedombox/views/fragments/SplashFragment.kt b/app/src/main/java/org/freedombox/freedombox/views/fragments/SplashFragment.kt index ef3f745..a5830df 100644 --- a/app/src/main/java/org/freedombox/freedombox/views/fragments/SplashFragment.kt +++ b/app/src/main/java/org/freedombox/freedombox/views/fragments/SplashFragment.kt @@ -49,12 +49,12 @@ class SplashFragment : BaseFragment() { private fun openLauncherIfConfigured() { val configuredBoxesJSON = getSharedPreference(sharedPreferences, - getString(R.string.default_box)) + getString(R.string.default_box)) configuredBoxesJSON?.let { val gson = GsonBuilder().setPrettyPrinting().create() val configuredBoxList = gson.fromJson>(it, - object : TypeToken>() {}.type) + object : TypeToken>() {}.type) val intent = Intent(activity, LauncherActivity::class.java) intent.putParcelableArrayListExtra(getString(R.string.current_box), configuredBoxList) startActivity(intent) diff --git a/app/src/main/res/drawable/ic_back_arrow.xml b/app/src/main/res/drawable/ic_back_arrow.xml new file mode 100644 index 0000000..8c02a3c --- /dev/null +++ b/app/src/main/res/drawable/ic_back_arrow.xml @@ -0,0 +1,5 @@ + + + + diff --git a/app/src/main/res/layout/app_container.xml b/app/src/main/res/layout/app_container.xml index bfe630c..09be4ff 100644 --- a/app/src/main/res/layout/app_container.xml +++ b/app/src/main/res/layout/app_container.xml @@ -18,18 +18,19 @@ --> + xmlns:card_view="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:id="@+id/rel_layout" + android:layout_width="match_parent" + android:layout_height="match_parent"> + android:layout_marginBottom="10dp" + android:layout_marginTop="20dp" + android:contentDescription="@string/application_icon" + android:padding="5dp" + android:scaleType="center" /> - + android:layout_below="@+id/appIcon"> - + + + + + + + diff --git a/app/src/main/res/layout/discovery_listview.xml b/app/src/main/res/layout/discovery_listview.xml index 80b3fae..4441005 100644 --- a/app/src/main/res/layout/discovery_listview.xml +++ b/app/src/main/res/layout/discovery_listview.xml @@ -18,33 +18,67 @@ --> + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal" + tools:background="@android:color/holo_blue_light"> + android:contentDescription="@string/application_icon" + android:src="@drawable/ic_logo" /> - + - + android:layout_toLeftOf="@+id/arrowImageView" + android:layout_toStartOf="@+id/arrowImageView" + android:orientation="vertical" + android:weightSum="2"> + + - + + + - + android:layout_height="1dp" + android:layout_below="@+id/boxDetailsLayout" + android:background="@android:color/darker_gray" /> + + + diff --git a/app/src/main/res/layout/fragment_discovery.xml b/app/src/main/res/layout/fragment_discovery.xml index 111165d..41aac3e 100644 --- a/app/src/main/res/layout/fragment_discovery.xml +++ b/app/src/main/res/layout/fragment_discovery.xml @@ -18,27 +18,31 @@ --> + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent"> + android:visibility="visible" + tools:visibility="visible"> + android:padding="10dp" + android:text="@string/configured" /> - + android:layout_below="@+id/configured" + tools:listitem="@layout/discovery_listview" /> @@ -53,13 +57,14 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/blueGrey" - android:text="@string/discovered"/> + android:padding="10dp" + android:text="@string/discovered" /> - + android:layout_below="@+id/discovered" /> diff --git a/app/src/main/res/layout/fragment_launcher.xml b/app/src/main/res/layout/fragment_launcher.xml index 620d4bd..7633874 100644 --- a/app/src/main/res/layout/fragment_launcher.xml +++ b/app/src/main/res/layout/fragment_launcher.xml @@ -16,15 +16,15 @@ ~ You should have received a copy of the GNU General Public License ~ along with FreedomBox. If not, see . --> - + android:layout_height="match_parent"> + android:visibility="gone" /> + android:scrollbars="none" + android:verticalSpacing="16dp" /> - diff --git a/app/src/main/res/layout/fragment_setup.xml b/app/src/main/res/layout/fragment_setup.xml index 2ae4958..4cfea82 100644 --- a/app/src/main/res/layout/fragment_setup.xml +++ b/app/src/main/res/layout/fragment_setup.xml @@ -18,23 +18,24 @@ --> + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical"> + android:textColor="@drawable/selector_txt" /> + android:inputType="textUri" + android:textColor="@drawable/selector_txt" /> + android:textColor="@drawable/selector_txt" /> + android:inputType="textPassword" + android:textColor="@drawable/selector_txt" /> + android:text="@string/switch_title" /> + android:text="@string/save" /> diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 66fdac9..bc80b04 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -3,6 +3,5 @@ #3F51B5 #303F9F #FF4081 - #FFFFFF #CFD8DC diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 05542cc..483a896 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -15,4 +15,9 @@ current_box default_box Settings + Recently connected to + Freedom Boxes + Application Icon + Information + Installation Status diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 11c613c..30edd3b 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -6,4 +6,10 @@ @color/colorAccent + + diff --git a/app/src/test/java/org/freedombox/freedombox/view/adapter/DiscoveryListAdapterTest.kt b/app/src/test/java/org/freedombox/freedombox/view/adapter/DiscoveryListAdapterTest.kt index 09835ec..ac7bfdf 100644 --- a/app/src/test/java/org/freedombox/freedombox/view/adapter/DiscoveryListAdapterTest.kt +++ b/app/src/test/java/org/freedombox/freedombox/view/adapter/DiscoveryListAdapterTest.kt @@ -46,22 +46,20 @@ class DiscoveryListAdapterTest { portList.add(portName1) boxNameList.add(boxName2) portList.add(portName2) - listAdapter = DiscoveryListAdapter(applicationContext, boxNameList, portList) + listAdapter = DiscoveryListAdapter(applicationContext, boxNameList, portList, object : DiscoveryListAdapter.OnItemClickListener { + override fun onItemClick(position: Int) { + TODO("not implemented") //To change body of created functions use File | Settings | File Templates. + } + }) } @Test fun testItemCount() { - Assert.assertEquals(listAdapter.count, 2) + Assert.assertEquals(listAdapter.itemCount, 2) } @Test fun testGetItemAtPositionZero() { Assert.assertEquals(listAdapter.getItem(0), boxNameList[0]) } - - @Test - fun testGetItemIdAtPositionOne() { - Assert.assertEquals(listAdapter.getItemId(1), boxNameList[1].hashCode().toLong()) - } - } diff --git a/app/src/test/java/org/freedombox/freedombox/view/adapter/GridAdapterTest.kt b/app/src/test/java/org/freedombox/freedombox/view/adapter/GridAdapterTest.kt index bbf7866..0d8a1aa 100644 --- a/app/src/test/java/org/freedombox/freedombox/view/adapter/GridAdapterTest.kt +++ b/app/src/test/java/org/freedombox/freedombox/view/adapter/GridAdapterTest.kt @@ -41,11 +41,11 @@ class GridAdapterTest { private var jsonArray = JsonArray() private val jsonObject = JsonParser().parse(""" { - "label": { + "name": { "en": "conversations", "te": "సంభాషణలు" }, - "description": { + "short_description": { "en": "someDescription" }, "icon": "icons/conversations", diff --git a/build.gradle b/build.gradle index 0bfc761..7f5516c 100644 --- a/build.gradle +++ b/build.gradle @@ -17,7 +17,7 @@ buildscript { ext { - kotlin_version = '1.1.50' + kotlin_version = '1.1.51' dagger_version = '2.11' robolectric_version = '3.5.1' supportlib_version = '26.1.0'