这是一个区域选择的工具
下载 (查看最新版本)
implementation 'com.github.dzenm.region-selection:multi:1.0.0'
<com.dzenm.multi.RegionSelectionView
android:id="@+id/region_view"
android:layout_width="match_parent"
android:layout_height="500dp"
app:layout_constraintBottom_toBottomOf="parent" />
final RegionSelectionView regionView = findViewById(R.id.region_view);
regionView.setOnSelectedListener(new RegionSelectionView.OnSelectedListener() {
public void onCompleted(RegionBean[] regionData) {
address.setText(getText(regionData));
}
});
new RegionSelectionDialog.Builder(MainActivity.this)
.setOnSelectedListener(new RegionSelectionDialog.OnSelectedListener() {
@Override
public void onCompleted(PopupWindow popupWindow, RegionBean[] regionData) {
popupWindow.dismiss();
reselected.setText(getText(regionData));
}
})
.create(getWindow().getDecorView());