Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added app/build/outputs/apk/debug/app-debug.apk
Binary file not shown.
18 changes: 18 additions & 0 deletions app/build/outputs/apk/debug/output-metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"version": 2,
"artifactType": {
"type": "APK",
"kind": "Directory"
},
"applicationId": "com.yyy.djk.dropdownmenu",
"variantName": "debug",
"elements": [
{
"type": "SINGLE",
"filters": [],
"versionCode": 1,
"versionName": "1.0",
"outputFile": "app-debug.apk"
}
]
}
12 changes: 6 additions & 6 deletions app/src/main/java/com/yyy/djk/dropdownmenu/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ public class MainActivity extends AppCompatActivity {
private String headers[] = {"城市", "年龄", "性别", "星座"};
private List<View> popupViews = new ArrayList<>();

private GirdDropDownAdapter cityAdapter;
private ListDropDownAdapter ageAdapter;
private ListDropDownAdapter sexAdapter;
private ConstellationAdapter cityAdapter;
private ConstellationAdapter ageAdapter;
private ConstellationAdapter sexAdapter;
private ConstellationAdapter constellationAdapter;

private String citys[] = {"不限", "武汉", "北京", "上海", "成都", "广州", "深圳", "重庆", "天津", "西安", "南京", "杭州"};
Expand All @@ -49,20 +49,20 @@ protected void onCreate(Bundle savedInstanceState) {
private void initView() {
//init city menu
final ListView cityView = new ListView(this);
cityAdapter = new GirdDropDownAdapter(this, Arrays.asList(citys));
cityAdapter = new ConstellationAdapter(this, Arrays.asList(citys));
cityView.setDividerHeight(0);
cityView.setAdapter(cityAdapter);

//init age menu
final ListView ageView = new ListView(this);
ageView.setDividerHeight(0);
ageAdapter = new ListDropDownAdapter(this, Arrays.asList(ages));
ageAdapter = new ConstellationAdapter(this, Arrays.asList(ages));
ageView.setAdapter(ageAdapter);

//init sex menu
final ListView sexView = new ListView(this);
sexView.setDividerHeight(0);
sexAdapter = new ListDropDownAdapter(this, Arrays.asList(sexs));
sexAdapter = new ConstellationAdapter(this, Arrays.asList(sexs));
sexView.setAdapter(sexAdapter);

//init constellation
Expand Down
5 changes: 4 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.1'
// classpath 'com.android.tools.build:gradle:2.3.1'
classpath 'com.android.tools.build:gradle:4.2.1'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' // Add this line

// NOTE: Do not place your application dependencies here; they belong
Expand All @@ -14,6 +16,7 @@ buildscript {
allprojects {
repositories {
jcenter()
google()
}
}

Expand Down
6 changes: 3 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Apr 11 16:01:41 CST 2017
#Fri Feb 18 11:51:14 CST 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
zipStoreBase=GRADLE_USER_HOME
2 changes: 1 addition & 1 deletion library/src/main/java/com/yyydjk/library/DropDownMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ private void addTab(@NonNull List<String> tabTexts, int i) {
tab.setEllipsize(TextUtils.TruncateAt.END);
tab.setGravity(Gravity.CENTER);
tab.setTextSize(TypedValue.COMPLEX_UNIT_PX,menuTextSize);
tab.setLayoutParams(new LayoutParams(0, ViewGroup.LayoutParams.WRAP_CONTENT, 1.0f));
// tab.setLayoutParams(new LayoutParams(0, ViewGroup.LayoutParams.WRAP_CONTENT, 1.0f));
tab.setTextColor(textUnselectedColor);
tab.setCompoundDrawablesWithIntrinsicBounds(null, null, getResources().getDrawable(menuUnselectedIcon), null);
tab.setText(tabTexts.get(i));
Expand Down