-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
49303b2
commit c18c480
Showing
38 changed files
with
3,059 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,5 +43,6 @@ ext { | |
jiaozivideoplayer : '7.0.4', | ||
ahbottomnavigation: '2.3.4', | ||
banner : '2.3.16', | ||
lottie : '3.0.7', | ||
] | ||
} |
This file contains 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
This file contains 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
This file contains 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
31 changes: 31 additions & 0 deletions
31
main/src/main/java/com/heyongrui/main/adapter/DragAndSwipeAdapter.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.heyongrui.main.adapter; | ||
|
||
import com.chad.library.adapter.base.BaseItemDraggableAdapter; | ||
import com.chad.library.adapter.base.BaseViewHolder; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* Created by lambert on 2018/11/13. | ||
* 拖拽、滑动适配器 | ||
*/ | ||
public class DragAndSwipeAdapter extends BaseItemDraggableAdapter<Object, BaseViewHolder> { | ||
private int mItemType; | ||
|
||
public DragAndSwipeAdapter(List<Object> data, int itemType) { | ||
super(data); | ||
mItemType = itemType; | ||
} | ||
|
||
public DragAndSwipeAdapter(int layoutResId, int itemType, List<Object> data) { | ||
super(layoutResId, data); | ||
mItemType = itemType; | ||
} | ||
|
||
@Override | ||
protected void convert(BaseViewHolder helper, Object item) { | ||
switch (mItemType) { | ||
|
||
} | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
main/src/main/java/com/heyongrui/main/adapter/ExpandableAdapter.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.heyongrui.main.adapter; | ||
|
||
import androidx.core.content.ContextCompat; | ||
|
||
import com.chad.library.adapter.base.BaseMultiItemQuickAdapter; | ||
import com.chad.library.adapter.base.BaseViewHolder; | ||
import com.chad.library.adapter.base.entity.MultiItemEntity; | ||
import com.heyongrui.base.utils.UiUtil; | ||
import com.heyongrui.main.R; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* Created by lambert on 2018/8/29. | ||
* 可折叠分组适配器 | ||
*/ | ||
public class ExpandableAdapter extends BaseMultiItemQuickAdapter<MultiItemEntity, BaseViewHolder> { | ||
|
||
public static final int HOTEL_ROOM_TYPE = 10004; | ||
|
||
public ExpandableAdapter(List<MultiItemEntity> data) { | ||
super(data); | ||
// addItemType(HOTEL_ROOM_TYPE, R.layout.adapter_item_hotel_room_type); | ||
} | ||
|
||
@Override | ||
protected void convert(BaseViewHolder helper, MultiItemEntity item) { | ||
UiUtil.setOnclickFeedBack(mContext, ContextCompat.getColor(mContext, R.color.background), ContextCompat.getColor(mContext, R.color.gray), helper.itemView); | ||
switch (helper.getItemViewType()) { | ||
} | ||
} | ||
} |
89 changes: 89 additions & 0 deletions
89
main/src/main/java/com/heyongrui/main/adapter/HomeSectionAdapter.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
package com.heyongrui.main.adapter; | ||
|
||
import android.text.TextUtils; | ||
|
||
import com.chad.library.adapter.base.BaseSectionMultiItemQuickAdapter; | ||
import com.chad.library.adapter.base.BaseViewHolder; | ||
import com.heyongrui.main.R; | ||
import com.heyongrui.main.data.dto.FlightDto; | ||
|
||
import java.util.List; | ||
|
||
|
||
/** | ||
* lambert | ||
* 2019/6/25 18:17 | ||
*/ | ||
public class HomeSectionAdapter extends BaseSectionMultiItemQuickAdapter<HomeSectionEntity, BaseViewHolder> { | ||
|
||
public HomeSectionAdapter(List<HomeSectionEntity> data) { | ||
this(0, data); | ||
} | ||
|
||
public HomeSectionAdapter(int sectionHeadResId, List<HomeSectionEntity> data) { | ||
super(sectionHeadResId, data); | ||
addItemType(HomeSectionEntity.FLIGHT, R.layout.recycle_item_flight); | ||
} | ||
|
||
@Override | ||
protected void convertHead(BaseViewHolder helper, HomeSectionEntity item) { | ||
// switch (item.getItemType()) { | ||
// case HomeSectionEntity.FLIGHT: | ||
// TextView tvHeadSection = helper.getView(android.R.id.text1); | ||
// if (null != tvHeadSection) { | ||
// tvHeadSection.setText(TextUtils.isEmpty(item.header) ? "" : item.header); | ||
// } | ||
// break; | ||
// } | ||
} | ||
|
||
@Override | ||
protected void convert(BaseViewHolder helper, HomeSectionEntity item) { | ||
switch (helper.getItemViewType()) { | ||
case HomeSectionEntity.FLIGHT: { | ||
String flightCompany = "", flightNumber = "", flightRate = "", flightTime = "", fromAirport = "", | ||
fromAirportCode = "", fromCity = "", fromCityCode = "", fromTerminal = "", planTime = "", | ||
planArriveTime = "", toAirport = "", toAirportCode = "", toCity = "", toCityCode = "", | ||
toTerminal = "", flightCycle = ""; | ||
FlightDto flightDto = item.getFlightDto(); | ||
if (null != flightDto) { | ||
flightCompany = flightDto.getAirLines(); | ||
flightNumber = flightDto.getFlightNo(); | ||
flightRate = flightDto.getFlightRate(); | ||
flightTime = flightDto.getFlightTime(); | ||
fromAirport = flightDto.getFrom(); | ||
fromAirportCode = flightDto.getFromAirportCode(); | ||
fromCity = flightDto.getFromCityName(); | ||
fromCityCode = flightDto.getFromCityCode(); | ||
fromTerminal = flightDto.getFromTerminal(); | ||
planTime = flightDto.getPlanTime(); | ||
planArriveTime = flightDto.getPlanArriveTime(); | ||
toAirport = flightDto.getTo(); | ||
toAirportCode = flightDto.getToAirportCode(); | ||
toCity = flightDto.getToCityName(); | ||
toCityCode = flightDto.getToCityCode(); | ||
toTerminal = flightDto.getToTerminal(); | ||
flightCycle = flightDto.getWeek(); | ||
} | ||
helper.setText(R.id.tv_company, TextUtils.isEmpty(flightCompany) ? "" : flightCompany); | ||
helper.setText(R.id.tv_flight_number, TextUtils.isEmpty(flightNumber) ? "" : flightNumber); | ||
helper.setText(R.id.tv_flight_rate, TextUtils.isEmpty(flightRate) ? "" : flightRate); | ||
helper.setText(R.id.tv_flight_time, TextUtils.isEmpty(flightTime) ? "" : flightTime); | ||
helper.setText(R.id.tv_from_airport, TextUtils.isEmpty(fromAirport) ? "" : fromAirport); | ||
helper.setText(R.id.tv_from_airport_code, TextUtils.isEmpty(fromAirportCode) ? "" : fromAirportCode); | ||
helper.setText(R.id.tv_from_city_name, TextUtils.isEmpty(fromCity) ? "" : fromCity); | ||
helper.setText(R.id.tv_from_city_code, TextUtils.isEmpty(fromCityCode) ? "" : fromCityCode); | ||
helper.setText(R.id.tv_from_terminal, TextUtils.isEmpty(fromTerminal) ? "" : fromTerminal); | ||
helper.setText(R.id.tv_plan_time, TextUtils.isEmpty(planTime) ? "" : planTime); | ||
helper.setText(R.id.tv_plan_arrive_time, TextUtils.isEmpty(planArriveTime) ? "" : planArriveTime); | ||
helper.setText(R.id.tv_to_airport, TextUtils.isEmpty(toAirport) ? "" : toAirport); | ||
helper.setText(R.id.tv_to_airport_code, TextUtils.isEmpty(toAirportCode) ? "" : toAirportCode); | ||
helper.setText(R.id.tv_to_city_name, TextUtils.isEmpty(toCity) ? "" : toCity); | ||
helper.setText(R.id.tv_to_city_code, TextUtils.isEmpty(toCityCode) ? "" : toCityCode); | ||
helper.setText(R.id.tv_to_terminal, TextUtils.isEmpty(toTerminal) ? "" : toTerminal); | ||
helper.setText(R.id.tv_flight_cycle, TextUtils.isEmpty(flightCycle) ? "" : flightCycle); | ||
} | ||
break; | ||
} | ||
} | ||
} |
80 changes: 80 additions & 0 deletions
80
main/src/main/java/com/heyongrui/main/adapter/HomeSectionEntity.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
package com.heyongrui.main.adapter; | ||
|
||
import com.chad.library.adapter.base.entity.MultiItemEntity; | ||
import com.chad.library.adapter.base.entity.SectionMultiEntity; | ||
import com.heyongrui.main.data.dto.FlightDto; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* lambert | ||
* 2019/6/25 18:13 | ||
*/ | ||
public class HomeSectionEntity extends SectionMultiEntity implements MultiItemEntity { | ||
|
||
public static final int FLIGHT = 100; | ||
|
||
private int itemType; | ||
private int spanSize; | ||
|
||
private Object object; | ||
private FlightDto flightDto; | ||
|
||
public HomeSectionEntity(boolean isHeader, String header, boolean isShow) { | ||
super(isHeader, header); | ||
} | ||
|
||
public HomeSectionEntity(int itemType, Object object) { | ||
this(itemType, 1, object); | ||
} | ||
|
||
public HomeSectionEntity(int itemType, int spanSize, Object object) { | ||
super(object); | ||
this.itemType = itemType; | ||
this.spanSize = spanSize; | ||
this.object = object; | ||
if (object != null) { | ||
if (object instanceof List && ((List) object).size() > 0) { | ||
Object o = ((List) object).get(0); | ||
// if (o instanceof BannerDto) { | ||
// this.bannerDtoList = (List<BannerDto>) object; | ||
// } | ||
} else if (object instanceof FlightDto) { | ||
this.flightDto = (FlightDto) object; | ||
} | ||
} | ||
} | ||
|
||
@Override | ||
public int getItemType() { | ||
return itemType; | ||
} | ||
|
||
public void setItemType(int itemType) { | ||
this.itemType = itemType; | ||
} | ||
|
||
public int getSpanSize() { | ||
return spanSize; | ||
} | ||
|
||
public void setSpanSize(int spanSize) { | ||
this.spanSize = spanSize; | ||
} | ||
|
||
public Object getObject() { | ||
return object; | ||
} | ||
|
||
public void setObject(Object object) { | ||
this.object = object; | ||
} | ||
|
||
public FlightDto getFlightDto() { | ||
return flightDto; | ||
} | ||
|
||
public void setFlightDto(FlightDto flightDto) { | ||
this.flightDto = flightDto; | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
main/src/main/java/com/heyongrui/main/dagger/ActivityContext.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.heyongrui.main.dagger; | ||
|
||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
|
||
import javax.inject.Qualifier; | ||
|
||
@Qualifier | ||
@Retention(RetentionPolicy.RUNTIME) | ||
public @interface ActivityContext { | ||
|
||
} |
27 changes: 27 additions & 0 deletions
27
main/src/main/java/com/heyongrui/main/dagger/HomeComponent.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.heyongrui.main.dagger; | ||
|
||
import android.app.Activity; | ||
|
||
import androidx.fragment.app.Fragment; | ||
|
||
import com.heyongrui.base.dagger.AppComponent; | ||
import com.heyongrui.base.dagger.PerActivity; | ||
import com.heyongrui.main.mob.presenter.MobPresenter; | ||
|
||
import dagger.Component; | ||
|
||
/** | ||
* 2019/8/26 | ||
* lambert | ||
* 此Component依赖AppComponent,由于AppComponent使用了@Singleton,此处只能使用自定义@Scope(@PerActivity) | ||
*/ | ||
|
||
@PerActivity | ||
@Component(dependencies = AppComponent.class, modules = {HomeModule.class}) | ||
public interface HomeComponent { | ||
Activity getActivity(); | ||
|
||
Fragment getFragment(); | ||
|
||
void inject(MobPresenter mobPresenter); | ||
} |
Oops, something went wrong.