Skip to content

Commit

Permalink
refactored field/method modifiers and cleaned up code
Browse files Browse the repository at this point in the history
  • Loading branch information
doneill committed Nov 3, 2015
1 parent 178c5a7 commit 9981483
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,20 @@
public class AttributeEditorActivity extends Activity {

// arcgis components
MapView mapView;
ArcGISFeatureLayer featureLayer;
ArcGISDynamicMapServiceLayer operationalLayer;
Point pointClicked;
Envelope initextent;
private MapView mapView;
private ArcGISFeatureLayer featureLayer;
private ArcGISDynamicMapServiceLayer operationalLayer;
private Point pointClicked;
private Envelope initextent;

// android components
LayoutInflater inflator;
AttributeListAdapter listAdapter;
ListView listView;
View listLayout;
private LayoutInflater inflator;
private AttributeListAdapter listAdapter;
private ListView listView;
private View listLayout;

public static final String TAG = "AttributeEditorSample";
static final int ATTRIBUTE_EDITOR_DIALOG_ID = 1;
private static final int ATTRIBUTE_EDITOR_DIALOG_ID = 1;

@Override
public void onCreate(Bundle savedInstanceState) {
Expand Down Expand Up @@ -205,7 +205,7 @@ protected Dialog onCreateDialog(int id) {
/**
* Helper method to return an OnClickListener for the Apply button
*/
public OnClickListener returnOnClickApplyChangesListener() {
private OnClickListener returnOnClickApplyChangesListener() {

return new OnClickListener() {

Expand Down Expand Up @@ -305,7 +305,7 @@ public void onClick(View v) {
/**
* OnClick method for the Discard button
*/
public OnClickListener returnOnClickDiscardChangesListener() {
private OnClickListener returnOnClickDiscardChangesListener() {

return new OnClickListener() {

Expand All @@ -324,7 +324,7 @@ public void onClick(View v) {
*
* @return CallbackListener<FeatureEditResult[][]>
*/
CallbackListener<FeatureEditResult[][]> createEditCallbackListener(final boolean updateLayer) {
private CallbackListener<FeatureEditResult[][]> createEditCallbackListener(final boolean updateLayer) {

return new CallbackListener<FeatureEditResult[][]>() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
/**
* POJO for storing the data associated with a row in the attributes list
*/
public class AttributeItem {
class AttributeItem {

private Field field;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,29 +48,21 @@
* Adapter class which contains the logic of how to use and process the
* FeatureLayers Fields and Attributes into an List Layout
*/
public class AttributeListAdapter extends BaseAdapter {
class AttributeListAdapter extends BaseAdapter {

FeatureSet featureSet;

Field[] fields;

FeatureType[] types;

String typeIdFieldName;

Context context;

LayoutInflater lInflator;

int[] editableFieldIndexes;

String[] typeNames;

HashMap<String, FeatureType> typeMap;

AttributeItem[] items;

DateFormat formatter = DateFormat.getDateTimeInstance(DateFormat.SHORT,
private final Field[] fields;
private final FeatureType[] types;
private final String typeIdFieldName;
private final Context context;
private final LayoutInflater lInflator;
private final int[] editableFieldIndexes;
private final String[] typeNames;
private final HashMap<String, FeatureType> typeMap;
private AttributeItem[] items;

final DateFormat formatter = DateFormat.getDateTimeInstance(DateFormat.SHORT,
DateFormat.SHORT);

/**
Expand Down Expand Up @@ -263,8 +255,8 @@ public void setFeatureSet(FeatureSet featureSet) {
* value that is passed in from the list (the features value). Can be used
* for domains as well as types.
*/
Spinner createSpinnerViewFromArray(View container, Field field,
Object value, String[] values) {
private Spinner createSpinnerViewFromArray(View container, Field field,
Object value, String[] values) {

TextView fieldAlias = (TextView) container
.findViewById(R.id.field_alias_txt);
Expand All @@ -290,7 +282,7 @@ Spinner createSpinnerViewFromArray(View container, Field field,
* it uses the locale and presents a button with the date and time in short
* format.
*/
Button createDateButtonFromLongValue(View container, Field field, long date) {
private Button createDateButtonFromLongValue(View container, Field field, long date) {

TextView fieldAlias = (TextView) container
.findViewById(R.id.field_alias_txt);
Expand All @@ -314,7 +306,7 @@ Button createDateButtonFromLongValue(View container, Field field, long date) {
* is applied here, it is assumed that the container has this set already
* (in XML).
*/
View createAttributeRow(View container, Field field, Object value) {
private View createAttributeRow(View container, Field field, Object value) {

TextView fieldAlias = (TextView) container
.findViewById(R.id.field_alias_txt);
Expand Down Expand Up @@ -344,7 +336,7 @@ View createAttributeRow(View container, Field field, Object value) {
/**
* Helper method to create the date button and its associated events
*/
void addListenersToDatebutton(Button dateButton) {
private void addListenersToDatebutton(Button dateButton) {

// create new onDateSetLisetener with the button associated with it
final ListOnDateSetListener listener = new ListOnDateSetListener(
Expand Down Expand Up @@ -393,7 +385,7 @@ public void onClick(View v) {
*/
class ListOnDateSetListener implements OnDateSetListener {

Button button;
final Button button;

public ListOnDateSetListener(Button button) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public static FieldType determineFieldType(Field field) {
* Helper method to determine if a field should be shown in the list for
* editing
*/
public static boolean isFieldValidForEditing(Field field) {
private static boolean isFieldValidForEditing(Field field) {

int fieldType = field.getFieldType();

Expand Down

0 comments on commit 9981483

Please sign in to comment.