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
GlobalScope.launch(Dispatchers.Main) { | |
val resultList = mappingResult(response?.employee) | |
pro_bar.visibility = View.GONE | |
activity?.let { | |
val adapter = ArrayAdapter<String>(it, | |
android.R.layout.simple_list_item_1, resultList) | |
list_api.adapter = adapter | |
} | |
} |
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
GlobalScope.launch(Dispatchers.IO) { | |
try { | |
val request = retroApiInterface.getEmployeeListing() | |
val response = request.await().body() | |
handlingUI(response) | |
} catch (exception: Exception) { | |
Log.e("Retrofit Exception", exception.toString()) | |
} | |
} |
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
class APIService { | |
private lateinit var apiInterface: APIInterface | |
fun getClient(): APIInterface { | |
val gson = GsonBuilder().create() | |
val retrofit = Retrofit.Builder() | |
.baseUrl("https://limitless-lake-93364.herokuapp.com") | |
.client(provideOkHttpClient(provideLoggingInterceptor())) | |
.addConverterFactory(GsonConverterFactory.create(gson)) |
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 APIInterface { | |
@GET("/hello") | |
fun getEmployeeListing(): Deferred<Response<EmployeeListModel>> | |
} |
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
dependencies { | |
// Retrofit | |
implementation "com.squareup.retrofit2:retrofit:$retrofitVersion" | |
implementation "com.squareup.retrofit2:converter-gson:$retrofitVersion" | |
implementation 'com.jakewharton.retrofit:retrofit2-kotlin-coroutines-adapter:0.9.2' | |
// OKHttp | |
implementation "com.squareup.okhttp3:okhttp:$okHttpVersion" | |
implementation "com.squareup.okhttp3:logging-interceptor:$okHttpVersion" |
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
1. Highlight a recommended option, | |
2. Allow users to switch currency (€/$/£) | |
3. Allow users to switch pricing monthly/yearly | |
4. Keep the entire pricing plan area clickable | |
5. Use slider to calculate how much a user would save | |
6. Provide free first month for good engagement | |
7. Prominently highlight testimonials prominently | |
8. Repeating call to action on top and bottom | |
9. Sell benefits instead of features | |
10. Indicate that users can cancel any time |
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
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME}#end | |
import android.support.v7.widget.RecyclerView | |
import android.view.LayoutInflater | |
import android.view.View | |
import android.view.ViewGroup | |
import java.util.* | |
#parse("File Header.java") | |
class ${NAME} : RecyclerView.Adapter<${ViewHolder_Class}>() { |
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
var functions = require('firebase-functions'); | |
var admin = require('firebase-admin'); | |
var serviceAccount = require("./serviceAccountKey.json"); | |
// admin.initializeApp(functions.config().firebase); | |
admin.initializeApp({ | |
credential: admin.credential.cert(serviceAccount), | |
databaseURL: "https://tutsalert.firebaseio.com" | |
}); | |
exports.sendNotification = functions.database.ref('/articles/{articleId}') |