当前位置:网站首页>Koltin35, headline Android interview algorithm
Koltin35, headline Android interview algorithm
2022-07-01 08:07:00 【m0_ sixty-six million two hundred and sixty-four thousand nine 】
fun getBusinessInfo() {
val businessCall = takeoutService.getBusinessInfo()
businessCall.enqueue(callback)
}
override fun parserJson(json: String) {
val gson = Gson()
val jsoObj = JSONObject(json)
val allStr = jsoObj.getString(“list”)
// Collection of commodity types
goodstypeList = gson.fromJson(allStr, object : TypeToken<List>() {
}.type)
Log.e(“business”, “ The merchant has a total of ” + goodstypeList.size + “ Categories of goods ”)
goodsFragment.onLoadBusinessSuccess(goodstypeList)
}
}
GoodsTypeInfo.kt Commodity bean
package com.example.takeout.model.beans
class GoodsTypeInfo {
var id: Int = 0// Commodity type id
var name: String = “”// Commodity type name
var info: String = “”// Special information
var list: List = listOf()// List of goods
constructor() : super() {}
constructor(id: Int, name: String, info: String, list: List) : super() {
this.id = id
this.name = name
this.info = info
this.list = list
}
override fun toString(): String {
return “GoodsTypeInfo [id= i d , n a m e = id, name= id,name=name, info= i n f o , l i s t = info, list= info,list=list]”
}
var redDotCount: Int = 0
}
GoodsTypeRvAdapter.kt The main interface on the left side of the product RecycleView, It uses FragmentActivity? As a androidx Below Context
package com.example.takeout.ui.adapter
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.fragment.app.FragmentActivity
import androidx.recyclerview.widget.RecyclerView
import com.example.takeout.R
import com.example.takeout.model.beans.GoodsTypeInfo
import com.example.takeout.ui.fragment.GoodsFragment
import org.jetbrains.anko.find
class GoodsTypeRvAdapter(val context: FragmentActivity?, val goodsFragment: GoodsFragment) :
RecyclerView.Adapter<RecyclerView.ViewHolder>() {
var goodsTypeList: List = listOf()
fun setDatas(list: List) {
this.goodsTypeList = list
notifyDataSetChanged()
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
val itemView = LayoutInflater.from(context).inflate(R.layout.item_type, parent, false)
return GoodsTypeItemHolder(itemView)
}
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
val goodsTypeItemHolder = holder as GoodsTypeItemHolder
goodsTypeItemHolder.bindData(goodsTypeList.get(position), position)
}
override fun getItemCount(): Int {
return goodsTypeList.size
}
inner class GoodsTypeItemHolder(val item: View) : RecyclerView.ViewHolder(item) {
val tvType: TextView
init {
tvType = item.find(R.id.type)
}
fun bindData(goodsTypeInfo: GoodsTypeInfo, position: Int) {
tvType.text = goodsTypeInfo.name
}
}
}
TakeoutService.kt The request format of the server
package com.example.takeout.model.net
import retrofit2.Call
import retrofit2.http.GET
import rx.Observable
interface TakeoutService {
//ex. @GET(“users/{user}/repos”)
//ex. fun listRepos(@Path(“user”) user: String): Call<List>
//http://127.0.0.1:8090/takeout?index=0
@GET(“takeout?index=0”)
fun getHomeInfo(): Call
//http://127.0.0.1:8090/takelogin?index=0
@GET(“takelogin?index=0”)
fun loginByPhone(): Call
//http://127.0.0.1:8090/takeorder?index=0
@GET(“takeorder?index=0”)
fun getOrderList(): Call
// Use Rxjava Combined interface
//http://127.0.0.1:8090/takeorder?index=0
@GET(“takeorder?index=0”)
fun getOrderListByRxjava(): Observable
@GET(“takebusiness?index=0”)
fun getBusinessInfo(): Call
}
item_type.xml Layout file
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android=“http://schemas.android.com/apk/res/android”
android:layout_width=“match_parent”
android:clickable=“true”
android:layout_height=“wrap_content”
Last
It is said that three years is a barrier for programmers , Whether to promote or improve their core competitiveness , These years have been critical .
Technology is developing so fast , Where to start learning , In order to reach the level of Senior Engineer , At last, we advanced to Android Architects / technician ? I summed up this 5 large ;
I've collected these years Ali , And Tencent , Bytes to beat , Huawei , Interview questions of Xiaomi and other companies , Sort out the interview requirements and technical points into a large and complete “ Android Architects ” interview Xmind( In fact, it took a lot more energy than expected ), Contains the context of knowledge + Branch details .
《Android Architecture video +BAT Interview topics PDF+ Learning notes 》



Online learning Android A lot of information , But if the knowledge learned is not systematic , When you encounter a problem, you just have a taste of it , No further study , So it's hard to really improve the technology . hope ** This systematic technology system ** There is a direction reference for you .
F-1644918297184)]
Online learning Android A lot of information , But if the knowledge learned is not systematic , When you encounter a problem, you just have a taste of it , No further study , So it's hard to really improve the technology . hope ** This systematic technology system ** There is a direction reference for you .
2021 In spite of the bumpy road , It's all about Android To fall , however , Don't panic , Make your own plan , Learn from yourself , Competition is everywhere , This is true of every industry . Believe in yourself , Nothing is impossible , Only the unexpected . Wish you all 2021 Everything is going well in the new year .
边栏推荐
- Caesar
- [MySQL learning notes 26] view
- getInputStream() has already been called for this request
- Php laraver Wechat payment
- Day5: scanner object, next() and nextline(), sequential structure, selection structure, circular structure
- [untitled]
- Basic number theory -- combinatorial number
- 力扣——求一组字符中的第一个回文字符
- Set up file server Minio for quick use
- Gui Gui programming (XV) - use scale to control font size changes
猜你喜欢
![[introduction] approximate value](/img/6b/597178d848dd21110f36601fc31092.png)
[introduction] approximate value

What information does the supplier need to know about Audi EDI project?

軟鍵盤高度報錯

Vhost kick & call principle
![[untitled]](/img/c2/63286ba00321c9cdef43ff40635a67.png)
[untitled]

Keithley 2100 software 𞓜 Keithley2400 test software ns SourceMeter

Day5: scanner object, next() and nextline(), sequential structure, selection structure, circular structure
![[getting started] enter the integer array and sorting ID, and sort its elements in ascending or descending order](/img/87/07783593dbabcf29700fa207ecda08.png)
[getting started] enter the integer array and sorting ID, and sort its elements in ascending or descending order

window c盘满了
![[staff] key number (key number identification position | key number marking list | a major key identification principle | F, C, G position marking ascending | F major key identification principle | B](/img/48/e98d01830867baa742574e1b6e1096.jpg)
[staff] key number (key number identification position | key number marking list | a major key identification principle | F, C, G position marking ascending | F major key identification principle | B
随机推荐
[MySQL learning notes 28] storage function
Introduction to kubernetes resource objects and common commands (II)
5大组合拳,解决校园6大难题,护航教育信息化建设
Office365 - how to use stream app to watch offline files at any time
[redis] it takes you through redis installation and connection at one go
如何使用layui将数据库中的数据以表格的形式展现出来
EDA开源仿真工具verilator入门6:调试实例
How relational databases work
Sqlalchemy creating MySQL_ Table
web254
How to check ad user information?
【力扣10天SQL入门】Day10 控制流
uni 热更新
Latex table
Instead of houses, another kind of capital in China is rising
Li Kou daily question - day 31 -1790 Can a string exchange be performed only once to make two strings equal
Gru of RNN
[getting started] extract non repeating integers
slice扩容机制分析
Connect timed out of database connection