Skip to content

Commit

Permalink
renamed collapsed key to expanded to match property it's refernencing…
Browse files Browse the repository at this point in the history
….Other minor fixes
  • Loading branch information
jd-alexander committed May 1, 2018
1 parent 80e417c commit c1f5ab7
Show file tree
Hide file tree
Showing 198 changed files with 786 additions and 1,002 deletions.
1 change: 1 addition & 0 deletions collect_app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ dependencies {
exclude group: 'org.apache.httpcomponents'
}

implementation group: 'com.rarepebble', name: 'colorpicker', version: '2.3.1'
implementation group: 'commons-io', name: 'commons-io', version: '2.5'
implementation group: 'net.sf.kxml', name: 'kxml2', version: '2.3.0'
implementation group: 'net.sf.opencsv', name: 'opencsv', version: '2.3'
Expand Down
87 changes: 23 additions & 64 deletions collect_app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ the specific language governing permissions and limitations under the License.
android:installLocation="auto"
android:label="@string/app_name"
android:largeHeap="true"
android:supportsRtl="true"
android:theme="@style/AppThemeBase.Collect">
android:supportsRtl="true">
<provider
android:name=".provider.FormsProvider"
android:authorities="org.odk.collect.android.provider.odk.forms"
Expand All @@ -97,8 +96,7 @@ the specific language governing permissions and limitations under the License.

<activity
android:name=".activities.MainMenuActivity"
android:configChanges="locale|orientation|screenSize"
android:label="@string/app_name" />
android:configChanges="locale|orientation|screenSize" />
<activity
android:name=".activities.ScannerWithFlashlightActivity"
android:screenOrientation="portrait"
Expand All @@ -107,7 +105,6 @@ the specific language governing permissions and limitations under the License.
<activity
android:name=".activities.FormEntryActivity"
android:configChanges="orientation"
android:label="@string/app_name"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
Expand All @@ -127,16 +124,12 @@ the specific language governing permissions and limitations under the License.
android:taskAffinity="" />
<activity
android:name=".activities.DrawActivity"
android:label="@string/app_name"
android:screenOrientation="landscape" />
<activity
android:name=".activities.GoogleDriveActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:windowSoftInputMode="stateHidden" />
<activity
android:name=".activities.InstanceChooserList"
android:label="@string/app_name">
<activity android:name=".activities.InstanceChooserList">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.EDIT" />
Expand All @@ -146,9 +139,7 @@ the specific language governing permissions and limitations under the License.
<data android:mimeType="vnd.android.cursor.dir/vnd.odk.instance" />
</intent-filter>
</activity>
<activity
android:name=".activities.FormChooserList"
android:label="@string/app_name">
<activity android:name=".activities.FormChooserList">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.EDIT" />
Expand All @@ -159,82 +150,51 @@ the specific language governing permissions and limitations under the License.
<data android:mimeType="vnd.android.cursor.dir/vnd.odk.form" />
</intent-filter>
</activity>
<activity
android:name=".activities.FormDownloadList"
android:label="@string/app_name" />
<activity android:name=".activities.FormDownloadList" />
<activity
android:name=".activities.FileManagerTabs"
android:configChanges="orientation|screenSize"
android:label="@string/app_name" />
android:configChanges="orientation|screenSize" />
<activity
android:name=".activities.GoogleSheetsUploaderActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name" />
android:configChanges="orientation|screenSize" />
<activity
android:name=".activities.InstanceUploaderList"
android:configChanges="orientation|screenSize"
android:label="@string/app_name">
android:configChanges="orientation|screenSize">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.EDIT" />

<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".activities.InstanceUploaderActivity"
android:label="@string/app_name" />
<activity
android:name=".activities.AboutActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.SettingsTheme" />
<activity
android:name=".preferences.PreferencesActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.SettingsTheme" />
<activity
android:name=".preferences.AdminPreferencesActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.SettingsTheme" />
<activity
android:name=".activities.ViewFormHierarchyActivity"
android:label="@string/app_name" />
<activity
android:name=".activities.EditFormHierarchyActivity"
android:label="@string/app_name" />
<activity
android:name=".activities.GeoPointActivity"
android:label="@string/app_name" />
<activity android:name=".activities.InstanceUploaderActivity" />
<activity android:name=".activities.AboutActivity" />
<activity android:name=".preferences.PreferencesActivity" />
<activity android:name=".preferences.AdminPreferencesActivity" />
<activity android:name=".activities.ViewFormHierarchyActivity" />
<activity android:name=".activities.EditFormHierarchyActivity" />
<activity android:name=".activities.GeoPointActivity" />
<activity
android:name=".activities.GeoPointMapActivity"
android:configChanges="orientation"
android:label="@string/app_name" />
android:configChanges="orientation" />
<activity
android:name=".activities.GeoPointOsmMapActivity"
android:configChanges="orientation"
android:label="@string/app_name" />
android:configChanges="orientation" />
<activity
android:name=".activities.GeoShapeOsmMapActivity"
android:configChanges="orientation"
android:label="@string/app_name" />
android:configChanges="orientation" />
<activity
android:name=".activities.GeoShapeGoogleMapActivity"
android:configChanges="orientation"
android:label="@string/app_name" />
android:configChanges="orientation" />
<activity
android:name=".activities.GeoTraceOsmMapActivity"
android:configChanges="orientation"
android:label="@string/app_name" />
android:configChanges="orientation" />
<activity
android:name=".activities.GeoTraceGoogleMapActivity"
android:configChanges="orientation"
android:label="@string/app_name" />
<activity
android:name=".activities.BearingActivity"
android:label="@string/app_name" />
android:configChanges="orientation" />
<activity android:name=".activities.BearingActivity" />
<activity
android:name=".activities.SplashScreenActivity"
android:label="@string/app_name"
android:theme="@android:style/Theme.Dialog">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down Expand Up @@ -304,8 +264,7 @@ the specific language governing permissions and limitations under the License.
<activity
android:name=".location.GeoActivity"
android:configChanges="orientation"
android:exported="true"
android:label="@string/app_name" />
android:exported="true" />
<activity android:name=".activities.WebViewActivity" />
<activity android:name=".activities.CaptureSelfieVideoActivity" />
<activity android:name=".activities.CaptureSelfieVideoActivityNewApi" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import android.content.pm.ResolveInfo;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
Expand All @@ -38,7 +37,7 @@

import timber.log.Timber;

public class AboutActivity extends AppCompatActivity implements
public class AboutActivity extends CollectAbstractActivity implements
AboutListAdapter.AboutItemClickListener {

private static final String LICENSES_HTML_PATH = "file:///android_asset/open_source_licenses.html";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* Copyright (C) 2011 University of Washington
*
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,15 @@
import android.database.Cursor;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.annotation.LayoutRes;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.design.widget.BottomSheetDialog;
import android.support.v4.view.MenuItemCompat;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.SearchView;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
Expand All @@ -39,7 +36,6 @@
import android.widget.ListView;
import android.widget.ProgressBar;
import android.widget.SimpleCursorAdapter;
import android.widget.TextView;

import org.odk.collect.android.R;
import org.odk.collect.android.adapters.SortDialogAdapter;
Expand All @@ -57,7 +53,7 @@

import static org.odk.collect.android.utilities.ApplicationConstants.SortingOrder.BY_NAME_ASC;

abstract class AppListActivity extends AppCompatActivity {
abstract class AppListActivity extends CollectAbstractActivity {
protected static final int LOADER_ID = 0x01;
private static final String SELECTED_INSTANCES = "selectedInstances";
private static final String IS_SEARCH_BOX_SHOWN = "isSearchBoxShown";
Expand All @@ -69,7 +65,6 @@ abstract class AppListActivity extends AppCompatActivity {
protected LinkedHashSet<Long> selectedInstances = new LinkedHashSet<>();
protected String[] sortingOptions;
protected Integer selectedSortingOrder;
protected Toolbar toolbar;
protected ListView listView;
protected LinearLayout llParent;
protected ProgressBar progressBar;
Expand Down Expand Up @@ -125,23 +120,16 @@ public static void toggleButtonLabel(Button toggleButton, ListView lv) {
}

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
public void setContentView(@LayoutRes int layoutResID) {
super.setContentView(layoutResID);

listView = findViewById(android.R.id.list);
listView.setOnItemClickListener((AdapterView.OnItemClickListener) this);

TextView emptyView = findViewById(android.R.id.empty);
listView.setEmptyView(emptyView);
listView.setEmptyView(findViewById(android.R.id.empty));
progressBar = findViewById(R.id.progressBar);
llParent = findViewById(R.id.llParent);

initToolbar();
}

private void initToolbar() {
toolbar = findViewById(R.id.toolbar);

setSupportActionBar(toolbar);
setSupportActionBar(findViewById(R.id.toolbar));
}

@Override
Expand Down Expand Up @@ -176,20 +164,16 @@ protected void onRestoreInstanceState(Bundle state) {
isSearchBoxShown = state.getBoolean(IS_SEARCH_BOX_SHOWN);
isBottomDialogShown = state.getBoolean(IS_BOTTOM_DIALOG_SHOWN);
savedFilterText = state.getString(SEARCH_TEXT);

}

@Override
public boolean onCreateOptionsMenu(final Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.list_menu, menu);

getMenuInflater().inflate(R.menu.list_menu, menu);
final MenuItem sortItem = menu.findItem(R.id.menu_sort);
final MenuItem searchItem = menu.findItem(R.id.menu_filter);
searchView = (SearchView) MenuItemCompat.getActionView(searchItem);
searchView.setQueryHint(getResources().getString(R.string.search));
searchView.setMaxWidth(Integer.MAX_VALUE);

searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextSubmit(String query) {
Expand Down Expand Up @@ -306,8 +290,8 @@ protected void clearSearchView() {
}

private void setupBottomSheet() {
bottomSheetDialog = new BottomSheetDialog(this, R.style.MaterialDialogSheet);
View sheetView = getLayoutInflater().inflate(R.layout.bottom_sheet, null);
bottomSheetDialog = new BottomSheetDialog(this, themeUtils.getBottomDialogTheme());
final View sheetView = getLayoutInflater().inflate(R.layout.bottom_sheet, null);
final RecyclerView recyclerView = sheetView.findViewById(R.id.recyclerView);

final SortDialogAdapter adapter = new SortDialogAdapter(this, recyclerView, sortingOptions, getSelectedSortingOrder(), new RecyclerViewClickListener() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,13 @@
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import org.odk.collect.android.R;
import org.odk.collect.android.application.Collect;

import java.util.Locale;

public class BearingActivity extends AppCompatActivity implements SensorEventListener {
public class BearingActivity extends CollectAbstractActivity implements SensorEventListener {
private ProgressDialog bearingDialog;

private SensorManager sensorManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package org.odk.collect.android.activities;

import android.app.Activity;
import android.hardware.Camera;
import android.os.Bundle;
import android.view.View;
Expand All @@ -32,7 +31,7 @@

import timber.log.Timber;

public class CaptureSelfieActivity extends Activity {
public class CaptureSelfieActivity extends CollectAbstractActivity {
private Camera camera;
private CameraPreview preview;
private int cameraId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package org.odk.collect.android.activities;

import android.annotation.TargetApi;
import android.app.Activity;
import android.content.Context;
import android.hardware.camera2.CameraAccessException;
import android.hardware.camera2.CameraCharacteristics;
Expand All @@ -35,7 +34,7 @@
import timber.log.Timber;

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public class CaptureSelfieActivityNewApi extends Activity {
public class CaptureSelfieActivityNewApi extends CollectAbstractActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
Expand Down
Loading

0 comments on commit c1f5ab7

Please sign in to comment.