add indexer

This commit is contained in:
Alexey Kuznetsov 2016-03-25 19:50:08 +03:00
commit 27fee5e156
3 changed files with 56 additions and 1 deletions

View file

@ -34,5 +34,6 @@ dependencies {
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support:support-v4:23.2.0'
compile 'com.android.support:preference-v14:23.2.0'
compile 'com.android.support:design:23.2.0'
compile 'com.android.support:design:23.2.0'
compile 'com.google.android.gms:play-services-appindexing:8.1.0'
}

View file

@ -41,6 +41,9 @@ import com.github.axet.audiorecorder.app.MainApplication;
import com.github.axet.audiorecorder.app.Storage;
import com.github.axet.audiorecorder.widgets.OpenFileDialog;
import com.github.axet.audiorecorder.widgets.PopupShareActionProvider;
import com.google.android.gms.appindexing.Action;
import com.google.android.gms.appindexing.AppIndex;
import com.google.android.gms.common.api.GoogleApiClient;
import java.io.File;
import java.text.SimpleDateFormat;
@ -57,6 +60,12 @@ public class MainActivity extends AppCompatActivity implements AbsListView.OnScr
static final int TYPE_EXPANDED = 1;
static final int TYPE_DELETED = 2;
/**
* ATTENTION: This was auto-generated to implement the App Indexing API.
* See https://g.co/AppIndexing/AndroidStudio for more information.
*/
private GoogleApiClient client;
final int[] ALL = {TYPE_COLLAPSED, TYPE_EXPANDED};
int scrollState;
@ -421,6 +430,10 @@ public class MainActivity extends AppCompatActivity implements AbsListView.OnScr
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// ATTENTION: This was auto-generated to implement the App Indexing API.
// See https://g.co/AppIndexing/AndroidStudio for more information.
client = new GoogleApiClient.Builder(this).addApi(AppIndex.API).build();
storage = new Storage(this);
handler = new Handler();
@ -606,4 +619,44 @@ public class MainActivity extends AppCompatActivity implements AbsListView.OnScr
recordings.close();
}
@Override
public void onStart() {
super.onStart();
// ATTENTION: This was auto-generated to implement the App Indexing API.
// See https://g.co/AppIndexing/AndroidStudio for more information.
client.connect();
Action viewAction = Action.newAction(
Action.TYPE_VIEW, // TODO: choose an action type.
"Main Page", // TODO: Define a title for the content shown.
// TODO: If you have web page content that matches this app activity's content,
// make sure this auto-generated web page URL is correct.
// Otherwise, set the URL to null.
Uri.parse("http://host/path"),
// TODO: Make sure this auto-generated app deep link URI is correct.
Uri.parse("android-app://com.github.axet.mover/http/host/path")
);
AppIndex.AppIndexApi.start(client, viewAction);
}
@Override
public void onStop() {
super.onStop();
// ATTENTION: This was auto-generated to implement the App Indexing API.
// See https://g.co/AppIndexing/AndroidStudio for more information.
Action viewAction = Action.newAction(
Action.TYPE_VIEW, // TODO: choose an action type.
"Main Page", // TODO: Define a title for the content shown.
// TODO: If you have web page content that matches this app activity's content,
// make sure this auto-generated web page URL is correct.
// Otherwise, set the URL to null.
Uri.parse("http://host/path"),
// TODO: Make sure this auto-generated app deep link URI is correct.
Uri.parse("android-app://com.github.axet.android-audio-recorder/http/host/path")
);
AppIndex.AppIndexApi.end(client, viewAction);
client.disconnect();
}
}

View file

@ -525,6 +525,7 @@ public class RecordingActivity extends AppCompatActivity {
}
void record() {
edit(false);
pitch.setOnTouchListener(null);
state.setText("recording");