This commit is contained in:
cimenmus
2017-10-24 21:05:50 +03:00
parent d7395683a5
commit 95da99ba07
5 changed files with 32 additions and 75 deletions

2
.idea/misc.xml generated
View File

@@ -37,7 +37,7 @@
<ConfirmationsSetting value="0" id="Add" /> <ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" /> <ConfirmationsSetting value="0" id="Remove" />
</component> </component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" /> <output url="file://$PROJECT_DIR$/build/classes" />
</component> </component>
<component name="ProjectType"> <component name="ProjectType">

View File

@@ -2,6 +2,7 @@ package ch.pizzalink.android.activity;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.util.Log;
import android.view.View; import android.view.View;
import android.widget.Button; import android.widget.Button;
import android.widget.RelativeLayout; import android.widget.RelativeLayout;
@@ -88,18 +89,6 @@ public class RegisterActivity extends BaseActivity {
onBackPressed(); onBackPressed();
} }
}); });
zonePizzalinkDropdown.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showZoneDialog();
}
});
countryPizzalinkDropdown.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showCountryDialog();
}
});
} }
private boolean checkFields(){ private boolean checkFields(){
@@ -269,11 +258,19 @@ public class RegisterActivity extends BaseActivity {
params.put("address_2", ""); params.put("address_2", "");
params.put("city", pizzalinkEditTextList.get(7).getText()); params.put("city", pizzalinkEditTextList.get(7).getText());
params.put("postcode", postcodePizzalinkDrowpdown.getText()); params.put("postcode", postcodePizzalinkDrowpdown.getText());
params.put("zone_id", "1"); params.put("zone_id", selectedZoneModel.getStoreId());
params.put("country_id", "1"); params.put("country_id", selectedCountryModel.getId());
return params; return params;
} }
private void onZoneDropdownClicked(View view){
Log.i("vdknvkd", "vıjıwf");
}
private void onCountryDropdownClicked(View view){
Log.i("vdknvkd", "vıjıwf");
}
private void showZoneDialog(){ private void showZoneDialog(){
final ArrayList<String> zoneNameList = new ArrayList<>(); final ArrayList<String> zoneNameList = new ArrayList<>();

View File

@@ -7,6 +7,7 @@ import android.text.Editable;
import android.text.InputType; import android.text.InputType;
import android.text.TextWatcher; import android.text.TextWatcher;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.inputmethod.InputMethodManager; import android.view.inputmethod.InputMethodManager;
@@ -22,25 +23,13 @@ import ch.pizzalink.android.helper.PasswordHelper;
* Created by cimenmus on 23.10.2017. * Created by cimenmus on 23.10.2017.
*/ */
public class PizzalinkDropdown extends LinearLayout implements View.OnClickListener { public class PizzalinkDropdown extends LinearLayout{
private View rootView; private View rootView;
private TextView hintTextView; private TextView hintTextView;
private EditText editText; private TextView textview;
private Typeface typeFace; private Typeface typeFace;
private String hint; private String hint;
private OnClickListener onClickListener;
/*
public PizzalinkDropdown(LinearLayout rootView, boolean isLeftIconVisible, int leftIconId,
int editTextHintId, int inputType, boolean isPasswordIconVisible){
initViews(rootView);
setLeftIcon(isLeftIconVisible, leftIconId);
setPasswordIcon(isPasswordIconVisible);
setEditTextt(editTextHintId, inputType);
}
*/
public PizzalinkDropdown(Context context) { public PizzalinkDropdown(Context context) {
super(context); super(context);
@@ -61,34 +50,9 @@ public class PizzalinkDropdown extends LinearLayout implements View.OnClickListe
private void init(Context context) { private void init(Context context) {
rootView = (View) inflate(context, R.layout.layout_pizzalink_dropdown, this); rootView = (View) inflate(context, R.layout.layout_pizzalink_dropdown, this);
hintTextView = (TextView) rootView.findViewById(R.id.hintTextView); hintTextView = (TextView) rootView.findViewById(R.id.hintTextView);
editText = (EditText) rootView.findViewById(R.id.editText); textview = (TextView) rootView.findViewById(R.id.textview);
rootView.setClickable(true); rootView.setClickable(true);
hintTextView.setText(hint); hintTextView.setText(hint);
rootView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(onClickListener != null){
onClickListener.onClick(rootView);
}
}
});
this.setClickable(true);
this.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if(onClickListener != null){
onClickListener.onClick(rootView);
}
}
});
}
public void setOnClickListener(OnClickListener onClickListener){
this.onClickListener = onClickListener;
} }
public boolean isEmpty(){ public boolean isEmpty(){
@@ -100,13 +64,14 @@ public class PizzalinkDropdown extends LinearLayout implements View.OnClickListe
} }
public void setText(String text){ public void setText(String text){
editText.setText(text); textview.setText(text);
} }
@Override private void onZoneDropdownClicked(View view){
public void onClick(View v) { Log.i("vdknvkd", "vıjıwf");
if(onClickListener != null){ }
onClickListener.onClick(rootView);
} private void onCountryDropdownClicked(View view){
Log.i("vdknvkd", "vıjıwf");
} }
} }

View File

@@ -30,8 +30,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"
android:background="@color/white" android:background="@color/white">
tools:context="ch.pizzalink.android.activity.LoginActivity">
<ch.pizzalink.android.view.PizzalinkEditText <ch.pizzalink.android.view.PizzalinkEditText
android:id="@+id/firstnamePizzalinkEditText" android:id="@+id/firstnamePizzalinkEditText"
@@ -93,7 +92,8 @@
android:id="@+id/zonePizzalinkDropdown" android:id="@+id/zonePizzalinkDropdown"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:dropdownHint="@string/zone"/> app:dropdownHint="@string/zone"
android:onClick="onZoneDropdownClicked"/>
<ch.pizzalink.android.view.PizzalinkDropdown <ch.pizzalink.android.view.PizzalinkDropdown
android:id="@+id/postcodePizzalinkDrowpdown" android:id="@+id/postcodePizzalinkDrowpdown"
@@ -105,7 +105,8 @@
android:id="@+id/countryPizzalinkDropdown" android:id="@+id/countryPizzalinkDropdown"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:dropdownHint="@string/country"/> app:dropdownHint="@string/country"
android:onClick="onCountryDropdownClicked"/>
<android.support.v4.widget.Space <android.support.v4.widget.Space
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@@ -7,8 +7,7 @@
android:paddingLeft="24dp" android:paddingLeft="24dp"
android:paddingStart="24dp" android:paddingStart="24dp"
android:paddingRight="24dp" android:paddingRight="24dp"
android:paddingEnd="24dp" android:paddingEnd="24dp">
android:clickable="true">
<TextView <TextView
android:id="@+id/hintTextView" android:id="@+id/hintTextView"
@@ -22,8 +21,8 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<EditText <TextView
android:id="@+id/editText" android:id="@+id/textview"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="@color/black" android:textColor="@color/black"
@@ -31,12 +30,7 @@
android:textColorHint="@color/row_product_ingredients_background" android:textColorHint="@color/row_product_ingredients_background"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:background="@android:color/transparent" android:background="@android:color/transparent"
android:layout_marginBottom="12dp" android:layout_marginBottom="12dp" />
android:clickable="false"
android:cursorVisible="false"
android:editable="false"
android:focusable="false"
android:focusableInTouchMode="false"/>
</RelativeLayout> </RelativeLayout>