This file contains hidden or 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 MainActivity : AppCompatActivity() { | |
private var selectedView: View? = null | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
requestWindowFeature(Window.FEATURE_NO_TITLE); | |
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, | |
WindowManager.LayoutParams.FLAG_FULLSCREEN); | |
setContentView(R.layout.activity_main) |
This file contains hidden or 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
import android.os.Bundle | |
import android.view.Gravity | |
import android.view.LayoutInflater | |
import android.view.View | |
import android.view.ViewGroup | |
import androidx.fragment.app.DialogFragment | |
import com.timbrit.profesionales.R | |
import org.jetbrains.anko.sdk27.coroutines.onClick |
This file contains hidden or 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
Animation Resource - push_down_in.xml | |
<?xml version="1.0" encoding="utf-8"?> | |
<set xmlns:android="http://schemas.android.com/apk/res/android"> | |
<translate android:fromYDelta="-100%p" android:toYDelta="0" android:duration="5000"/> | |
<alpha android:fromAlpha="0.0" android:toAlpha="1.0" android:duration="5000" /> | |
</set> | |
Animation Resource - push_down_out.xml | |
<?xml version="1.0" encoding="utf-8"?> | |
<set xmlns:android="http://schemas.android.com/apk/res/android"> |
This file contains hidden or 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
private fun firebaseAuth(loginModelPost: LoginModelPost?,callback: () -> Unit): Either<Failure, Boolean>? { |
This file contains hidden or 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 ApiRefreshToken { | |
companion object { | |
private const val REFRESH_TOKEN = "/refreshToken" | |
} | |
@FormUrlEncoded | |
@POST(REFRESH_TOKEN) | |
fun refreshToken(@Field("refreshToken") refreshToken: String?): Call<TokenModel> | |
} |
This file contains hidden or 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
private fun createClientAuth(): OkHttpClient { | |
//ADD DISPATCHER WITH MAX REQUEST TO 1 | |
val dispatcher = Dispatcher() | |
dispatcher.maxRequests = 1 | |
val okHttpClientBuilder: OkHttpClient.Builder = OkHttpClient.Builder() | |
okHttpClientBuilder.dispatcher(dispatcher) | |
okHttpClientBuilder.addInterceptor(AuthenticationInterceptorRefreshToken(this, UserManager())) | |
return okHttpClientBuilder.build() | |
} | |
} |
This file contains hidden or 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
internal fun handleChatMessages(messages: List<MessageModel>?) { | |
hideProgress() | |
adapter.collection = messages.orEmpty() | |
animate { runLayoutAnimation() } | |
} | |
private fun animate(function: () -> Unit) { | |
when { | |
firstTimeCreated -> function.invoke() | |
} |
This file contains hidden or 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
--------------------------- ----- ------------ --------------- ------- ----------- ---------------- --- ---------- | |
Device Inches ResolutionPX Density DPI ResolutionDP AspectRatios SysNavYorN ContentResolutionDP | |
--------------------------- ----- ------------ --------------- ------- ----------- ---------------- --- ---------- | |
Galaxy Y 320 x 240 ldpi 0.75 120 427 x 320 4:3 1.3333 427 x 320 | |
? 400 x 240 ldpi 0.75 120 533 x 320 5:3 1.6667 533 x 320 | |
? 432 x 240 ldpi 0.75 120 576 x 320 9:5 1.8000 576 x 320 | |
Galaxy Ace 480 x 320 mdpi 1 160 480 x 320 3:2 1.5000 |
This file contains hidden or 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
fun Long.checkTimeIsOldThan(days: Int): Boolean { | |
val daysInMillis = TimeUnit.DAYS.toMillis(days.toLong()) | |
val currentTime = Date().time | |
val previousTime = this | |
val differ = currentTime - previousTime | |
return !(differ < daysInMillis && differ > -daysInMillis) | |
} |
This file contains hidden or 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 fiveMinutes = (1000 * 60 * 5).toLong() //5m in milliseconds |