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
jafar@jafar-300V3A-300V4A-300V5A:~/AndroidStudioProjects/my.soliq_yur.uz$ env | |
XDG_VTNR=7 | |
LC_PAPER=uz_UZ.UTF-8 | |
LC_ADDRESS=uz_UZ.UTF-8 | |
XDG_SESSION_ID=c2 | |
XDG_GREETER_DATA_DIR=/var/lib/lightdm-data/jafar | |
CLUTTER_IM_MODULE=xim | |
LC_MONETARY=uz_UZ.UTF-8 | |
SESSION=ubuntu | |
GIO_LAUNCHED_DESKTOP_FILE_PID=2754 |
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 loadData() { | |
val list = mutableListOf<ChequeDetails>() | |
val disposable = | |
AppDatabase.getDatabase(MyApplication.context, viewModelScope).chequeDao().getAll() | |
.flatMap { items -> | |
Flowable.fromIterable(items) | |
.map { chequeData -> | |
val services = AppDatabase.getDatabase(MyApplication.context, viewModelScope) | |
.chequeServicesDao() | |
.getChequeServicesBy(chequeData.id) |
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
package com.example.myapplication.Services; | |
import com.google.gson.Gson; | |
import com.google.gson.GsonBuilder; | |
import java.security.cert.CertificateException; | |
import java.util.concurrent.TimeUnit; | |
import javax.net.ssl.HostnameVerifier; | |
import javax.net.ssl.SSLContext; | |
import javax.net.ssl.SSLSession; | |
import javax.net.ssl.SSLSocketFactory; |
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
package com.example.myapplication.adapters | |
import android.content.Context | |
import android.view.LayoutInflater | |
import android.view.View | |
import android.view.ViewGroup | |
import android.widget.TextView | |
import androidx.annotation.NonNull | |
import androidx.recyclerview.widget.AsyncListDiffer | |
import androidx.recyclerview.widget.DiffUtil |
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
// Baza | |
@Database(entities = [Person::class],version = 1,exportSchema = false) | |
@TypeConverters(Converters::class) | |
abstract class MainDatabase :RoomDatabase(){ | |
abstract fun getPeople() :PersonDao | |
companion object{ | |
@Volatile | |
private var instance: MainDatabase? = null |
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 PeopleAdapter(var context: Context, var list: List<Person>, var clicklidtrnrt:OnItemClickListener) | |
: RecyclerView.Adapter<PeopleAdapter.PeopleViewHolder>(){ | |
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): PeopleViewHolder { | |
return PeopleViewHolder(LayoutInflater.from(context).inflate(R.layout.item_people,parent,false)) | |
} | |
override fun getItemCount(): Int { | |
return list.size | |
} |
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
//person | |
@Entity(tableName = "person") | |
data class Person( | |
val uuid:String?=null, | |
val name:String?=null, | |
val surname:String?=null, | |
val phone:String?=null, | |
val update_time:String?=null, | |
val image_uuid:String?=null, | |
val image_update_time: String?=null, |
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 ConnectivityLiveData(private val connectivityManager: ConnectivityManager):LiveData<Boolean>(){ | |
constructor(application: Application) : this(application.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager) | |
private val networkCallback= @RequiresApi(Build.VERSION_CODES.LOLLIPOP) | |
object : ConnectivityManager.NetworkCallback() { | |
override fun onAvailable(network: Network) { | |
super.onAvailable(network) | |
postValue(true) | |
} |
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 SendMessageFragment : DialogFragment() { | |
private var _binding: FragmentSendMessageBinding?=null | |
private val binding get() = _binding!! | |
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, | |
savedInstanceState: Bundle?): View? { | |
return inflater.inflate(R.layout.fragment_send_message, container, false) | |
} |
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 HomeFragment : Fragment(R.layout.fragment_home){ | |
private var _binding: FragmentHomeBinding?=null | |
private val binding:FragmentHomeBinding get() = _binding!! | |
private lateinit var viewmodel : PeopleViewModel | |
lateinit var homeAdapter: PeopleAdapter | |
lateinit var preference: AuthPreference | |
var tagResponseDb:List<TagResponseDb>?=null | |
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { |