当前位置:网站首页>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 .
边栏推荐
- Airsim雷达相机融合生成彩色点云
- EDA open source simulation tool verilator beginner 6: debugging examples
- Serial port oscilloscope software ns-scope
- 7-26 word length (input and output in the loop)
- [MySQL learning notes27] stored procedure
- Programmer's regimen
- 使用threejs简单Web3D效果
- Caesar
- Source code analysis of open source API gateway APIs IX
- Gdip - hatchbrush pattern table
猜你喜欢
![[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

The triode is a great invention

Learn the knowledge you need to know about the communication protocol I2C bus

Principle and process of embossing

SQL number injection and character injection

Gdip - hatchbrush pattern table

Set up file server Minio for quick use

5大组合拳,解决校园6大难题,护航教育信息化建设

【网站架构】一招搞定90%的分布式事务,实打实介绍数据库事务、分布式事务的工作原理应用场景
![[introduction] approximate value](/img/6b/597178d848dd21110f36601fc31092.png)
[introduction] approximate value
随机推荐
Kickback -- find the first palindrome character in a group of characters
Precautions and skills in using regular expressions in golang
【入门】提取不重复的整数
SharePoint - modify web application authentication using PowerShell
[untitled]
On June 30, 2022, the record of provincial competition + national competition of Bluebridge
EDA开源仿真工具verilator入门6:调试实例
The Windows C disk is full
Airsim雷达相机融合生成彩色点云
Anddroid 文本合成语音TTS实现
Sorting out tcp/udp communication problems
QT -- 1. QT connection database
Gdip - hatchBrush图案表
Teach you how to apply for domestic trademark online step by step
postgresql源码学习(26)—— Windows vscode远程调试Linux上的postgresql
5大组合拳,解决校园6大难题,护航教育信息化建设
谈谈数字化转型的几个关键问题
【入门】输入n个整数,输出其中最小的k个
[kv260] generate chip temperature curve with xadc
php laravel微信支付