当前位置:网站首页>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 .
边栏推荐
- Thesis learning -- Analysis and Research on similarity query of hydrological time series
- Access报表实现小计功能
- Array: question brushing record
- 事务方法调用@Transactional
- 【力扣10天SQL入门】Day10 控制流
- Scala language learning-07-constructor
- Vhost kick & call principle
- 力扣每日一题-第32天-1822.数组元素积的符号
- Saving db4i depth camera pictures with MATLAB
- STM32 uses esp01s to go to the cloud, mqtt FX debugging
猜你喜欢

【入门】截取字符串

Set up file server Minio for quick use
![[website architecture] solve 90% of distributed transactions in one move, and introduce the working principles and application scenarios of database transactions and distributed transactions](/img/2c/07d729d49b1d74553decac4588074e.png)
[website architecture] solve 90% of distributed transactions in one move, and introduce the working principles and application scenarios of database transactions and distributed transactions
![[getting started] extract non repeating integers](/img/88/3e96df88e980bd98ac112b18a8678c.png)
[getting started] extract non repeating integers

Tupu software has passed CMMI5 certification| High authority and high-level certification in the international software field

谈谈数字化转型的几个关键问题
![[redis] it takes you through redis installation and connection at one go](/img/ca/89cb18f0eeb835f021d6a2489681a1.png)
[redis] it takes you through redis installation and connection at one go

The H5 page has set the font thickness style, but the wechat access style in Huawei mobile phone doesn't take effect?

Microsoft stream - how to modify video subtitles

Office365 - how to use stream app to watch offline files at any time
随机推荐
【无标题】
Teach you how to apply for domestic trademark online step by step
[untitled]
【刷题】字符统计【0】
Transaction method call @transactional
軟鍵盤高度報錯
[staff] high and low octave mark (the notes in the high octave mark | mark range are increased by one octave as a whole | low octave mark | mark range are decreased by one octave as a whole)
使用threejs简单Web3D效果
[untitled]
web254
php laravel微信支付
5大组合拳,解决校园6大难题,护航教育信息化建设
QT -- 1. QT connection database
力扣——求一组字符中的第一个回文字符
Cyclic neural network
Chinese font Gan: zi2zi
OJ输入输出练习
[dynamic planning] p1020 missile interception (variant of the longest increasing subsequence)
Caesar
Uni hot update