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
package com.github.odaridavid.readmore | |
import androidx.appcompat.app.AppCompatActivity | |
import android.os.Bundle | |
import android.util.Log | |
import android.view.View | |
import android.widget.TextView | |
import androidx.annotation.IdRes | |
class MainActivity : AppCompatActivity() { |
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
<?xml version="1.0" encoding="utf-8"?> | |
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
tools:context=".MainActivity"> | |
<TextView | |
android:id="@+id/descriptionCollapsed" |
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
package com.github.odaridavid.spinner; | |
import android.os.Bundle; | |
import android.view.View; | |
import android.widget.AdapterView; | |
import android.widget.ArrayAdapter; | |
import android.widget.Spinner; | |
import android.widget.Toast; | |
import androidx.appcompat.app.AppCompatActivity; |
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
package com.moose.foodies.util | |
import com.moose.foodies.network.Authenticator | |
import io.reactivex.schedulers.Schedulers | |
import okhttp3.OkHttpClient | |
import okhttp3.logging.HttpLoggingInterceptor | |
import retrofit2.Retrofit | |
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory | |
import retrofit2.converter.gson.GsonConverterFactory | |
import retrofit2.converter.scalars.ScalarsConverterFactory |
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
package com.moose.foodies.network | |
import com.moose.foodies.FoodiesApplication | |
import com.moose.foodies.util.PreferenceHelper | |
import okhttp3.Headers | |
import okhttp3.Interceptor | |
import okhttp3.Response | |
object Authenticator : Interceptor { | |
override fun intercept(chain: Interceptor.Chain): Response { |
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
/** | |
* | |
* Copyright 2020 David Odari | |
* | |
* 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 |
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
#Get keystore information including Certificates for release builds | |
keytool -list -v -keystore ${locationToKeystore/app.jks} -alias ${keystore_alias} |
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
interface StarWarsApiService { | |
@GET("people") | |
suspend fun searchCharacters(@Query("search") params: String): SearchResponse | |
@GET | |
suspend fun getSpeciesDetails(@Url speciesUrl: String): SpecieDetailsResponse | |
@GET | |
suspend fun getFilmDetails(@Url filmsUrl: String): FilmDetailsResponse |
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
val String.id: Int | |
get() = | |
if (this.isNotBlank() && this.contains("-?\\d+(\\.\\d+)?".toRegex())) | |
this.replace("[^0-9]".toRegex(), "").toInt() | |
else -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
interface StarWarsApiService { | |
@GET("people") | |
suspend fun searchCharacters(@Query("search") params: String): SearchResponse | |
@GET("species/{id}/") | |
suspend fun getSpeciesDetails(@Path("id") speciesId: Int): SpeciesDetailResponse | |
@GET("films/{id}/") | |
suspend fun getFilmDetails(@Path("id") filmsId: Int): FilmDetailResponse |
NewerOlder