Skip to content

Commit

Permalink
Merge pull request #386 from Alfresco/1.6.1
Browse files Browse the repository at this point in the history
Prepare 1.6.1 release
  • Loading branch information
JM.PASCAL committed Mar 9, 2016
2 parents 53c1027 + 9b986ad commit a75803e
Show file tree
Hide file tree
Showing 181 changed files with 4,671 additions and 1,233 deletions.
2 changes: 2 additions & 0 deletions alfresco-mobile-android/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
/build
#Google
google-services.json
32 changes: 28 additions & 4 deletions alfresco-mobile-android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,33 @@
/*
* Copyright (C) 2005-2016 Alfresco Software Limited.
*
* This file is part of Alfresco Mobile for Android.
*
* 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 the License.
*/

apply plugin: 'com.android.application'

android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
compileSdkVersion 23
buildToolsVersion "23.0.2"

defaultConfig {
applicationId APPLICATION_ID

minSdkVersion 15
targetSdkVersion 22
versionCode 51
versionCode 60
versionName VERSION_NAME

manifestPlaceholders = [PROVIDER_AUTHORITY: PROVIDER_AUTHORITY]
Expand All @@ -23,6 +41,8 @@ android {
resValue "string", "oauth_callback", OAUTH_CALLBACK
resValue "string", "oauth_scope", OAUTH_SCOPE
resValue "string", "bamboo_buildnumber", BUILDNUMBER

resValue "string", "ga_trackingId", TRACKER_ID
}

lintOptions {
Expand Down Expand Up @@ -57,7 +77,7 @@ android {
resValue "string", "favorites_adapter", FAVORITES_ADAPTER_DEBUG

resValue "string", "hockeyapp_key", HOCKEYAPP_KEY

resValue "string", "ga_trackingId", TRACKER_ID_DEBUG
}

release {
Expand Down Expand Up @@ -89,9 +109,13 @@ android {
dependencies {
//DEBUG BUILD TYPE
debugCompile project(':extensions:hockeyapp')
debugCompile project(':extensions:analytics')
debugCompile project(':extensions:tools')


storeCompile project(':extensions:samsung')
storeCompile project(':extensions:scansnap')
storeCompile project(':extensions:analytics')
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,25 @@
******************************************************************************/
package org.alfresco.mobile.android.application.managers;

import org.alfresco.mobile.android.application.R;
import org.alfresco.mobile.android.application.extension.analytics.GAnalyticsManagerImpl;
import org.alfresco.mobile.android.application.fragments.config.ConfigMenuEditorFragment;
import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.platform.extensions.DevToolsManager;
import org.alfresco.mobile.android.ui.holder.HolderUtils;
import org.alfresco.mobile.android.ui.holder.TwoLinesCheckboxViewHolder;
import org.alfresco.mobile.android.ui.holder.TwoLinesViewHolder;

import android.content.Context;
import android.support.v4.app.FragmentActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

public class DevToolsManagerImpl extends DevToolsManager
{
public boolean enableManualDispatch = false;

// ///////////////////////////////////////////////////////////////////////////
// CONSTRUCTOR
// ///////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -54,4 +65,40 @@ public void displayMenuConfig(FragmentActivity activity)
{
ConfigMenuEditorFragment.with(activity).display();
}

@Override
public void generateMenu(final FragmentActivity activity, ViewGroup root)
{
TwoLinesViewHolder vh = HolderUtils.configure(root, R.layout.row_two_lines_borderless, "Menu Editor",
"Tools to edit and manage menu and profiles", -1);

((ViewGroup) vh.icon.getParent().getParent()).setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
{
DevToolsManager.getInstance(activity).displayMenuConfig(activity);
}
});

View v = LayoutInflater.from(root.getContext()).inflate(R.layout.row_two_lines_checkbox, root, false);
final TwoLinesCheckboxViewHolder cvh = HolderUtils.configure(v, "Analytics RealTime",
"Switch ON to enable faster realtime analytics", enableManualDispatch);
root.addView(v);

cvh.choose.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
{
enableManualDispatch = cvh.choose.isChecked();
if (AnalyticsManager.getInstance(activity) != null)
{
((GAnalyticsManagerImpl) AnalyticsManager.getInstance(activity))
.enableManualDispatch(cvh.choose.isChecked());
}
}
});
}

}
37 changes: 37 additions & 0 deletions alfresco-mobile-android/src/debug/res/values/keys.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright (C) 2005-2016 Alfresco Software Limited.
~
~ This file is part of Alfresco Mobile for Android.
~
~ 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 the License.
-->

<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="all">

<!-- Percentage of events to include in reports -->
<string name="ga_sampleFrequency">100.0</string>

<!-- Enable automatic Activity measurement -->
<bool name="ga_autoActivityTracking">false</bool>

<!-- Enable Manual Dispatch -->
<bool name="ga_manualDispatch">false</bool>

<!-- catch and report uncaught exceptions from the app -->
<bool name="ga_reportUncaughtExceptions">true</bool>

<!-- How long a session exists before giving up -->
<integer name="ga_sessionTimeout">2</integer>


</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@
"root-view-id": "views-menu-default"
}
},
"features": [
{
"id": "feature-analytics-default",
"type": "org.alfresco.client.feature.analytics",
"enable": false
}
],
"view-groups": [
{
"id": "views-menu-default",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,32 +1,35 @@
/*******************************************************************************
* Copyright (C) 2005-2014 Alfresco Software Limited.
/*
* Copyright (C) 2005-2016 Alfresco Software Limited.
*
* This file is part of Alfresco Mobile for Android.
* This file is part of Alfresco Mobile for Android.
*
* 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
* 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
* 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 the License.
*******************************************************************************/
* 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 the License.
*/
package org.alfresco.mobile.android.application;

import org.alfresco.mobile.android.application.managers.upgrade.UpgradeManager;
import org.alfresco.mobile.android.async.OperationsUtils;
import org.alfresco.mobile.android.platform.SessionManager;
import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;

import android.app.Application;

public class AlfrescoApplication extends Application
{
protected SessionManager sessionManager;

private AnalyticsManager analyticsManager;

@Override
public void onCreate()
{
Expand All @@ -39,4 +42,9 @@ public void onCreate()
// Remove operations if necessary
OperationsUtils.clean(this);
}

synchronized public AnalyticsManager getAnalyticsTracker()
{
return AnalyticsManager.getInstance(this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import org.alfresco.mobile.android.application.intent.RequestCode;
import org.alfresco.mobile.android.application.managers.ConfigManager;
import org.alfresco.mobile.android.application.managers.RenditionManagerImpl;
import org.alfresco.mobile.android.application.managers.extensions.AnalyticHelper;
import org.alfresco.mobile.android.application.security.DataProtectionUserDialogFragment;
import org.alfresco.mobile.android.async.Operator;
import org.alfresco.mobile.android.async.account.CreateAccountEvent;
Expand All @@ -67,6 +68,7 @@
import org.alfresco.mobile.android.platform.accounts.AccountsPreferences;
import org.alfresco.mobile.android.platform.accounts.AlfrescoAccount;
import org.alfresco.mobile.android.platform.accounts.AlfrescoAccountManager;
import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.platform.favorite.FavoritesManager;
import org.alfresco.mobile.android.platform.intent.AlfrescoIntentAPI;
import org.alfresco.mobile.android.platform.intent.PrivateIntent;
Expand Down Expand Up @@ -216,7 +218,7 @@ public void onCreate(Bundle savedInstanceState)
// re-created after the AlfrescoAccount is created.
DataProtectionUserDialogFragment.newInstance(true).show(getSupportFragmentManager(),
DataProtectionUserDialogFragment.TAG);
prefs.edit().putBoolean(GeneralPreferences.HAS_ACCESSED_PAID_SERVICES, true).commit();
prefs.edit().putBoolean(GeneralPreferences.HAS_ACCESSED_PAID_SERVICES, true).apply();
}
}
}
Expand Down Expand Up @@ -280,6 +282,11 @@ public void onDrawerOpened(View drawerView)
@Override
protected void onStart()
{
if (AnalyticsManager.getInstance(this) != null && AnalyticsManager.getInstance(this).isEnable())
{
AnalyticsManager.getInstance(this).startReport(this);
}

registerPublicReceiver(new NetworkReceiver(), new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION));

super.onStart();
Expand Down Expand Up @@ -355,7 +362,7 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data)
((MainMenuFragment) getFragment(MainMenuFragment.SLIDING_TAG)).refreshAccount();

// Send Event
ConfigManager.getInstance(this).loadAndUseCustom(getCurrentAccount());
// ConfigManager.getInstance(this).loadAndUseCustom(getCurrentAccount());
EventBusManager.getInstance()
.post(new ConfigManager.ConfigurationMenuEvent(getCurrentAccount().getId()));
}
Expand Down Expand Up @@ -782,7 +789,7 @@ public void onAccountCreated(CreateAccountEvent event)
{
DataProtectionUserDialogFragment.newInstance(true).show(getSupportFragmentManager(),
DataProtectionUserDialogFragment.TAG);
prefs.edit().putBoolean(GeneralPreferences.HAS_ACCESSED_PAID_SERVICES, true).commit();
prefs.edit().putBoolean(GeneralPreferences.HAS_ACCESSED_PAID_SERVICES, true).apply();
}
}
}
Expand Down Expand Up @@ -943,7 +950,7 @@ public void onAccountLoaded(LoadAccountCompletedEvent event)
if (paidNetwork)
{
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
prefs.edit().putBoolean(GeneralPreferences.HAS_ACCESSED_PAID_SERVICES, true).commit();
prefs.edit().putBoolean(GeneralPreferences.HAS_ACCESSED_PAID_SERVICES, true).apply();

if (mdmManager.hasConfig())
{
Expand Down Expand Up @@ -972,6 +979,9 @@ public void onAccountLoaded(LoadAccountCompletedEvent event)
startActivityForResult(new Intent(this, InfoActivity.class), SyncMigrationFragment.REQUEST_CODE);
}

// Analytics
AnalyticHelper.analyzeSession(this, event.account, getCurrentSession());

// Activate Automatic Sync for Sync Content & Favorite
SyncContentManager.getInstance(this).setActivateSync(getCurrentAccount(), true);
if (SyncContentManager.getInstance(this).canSync(getCurrentAccount()))
Expand All @@ -986,6 +996,7 @@ public void onAccountLoaded(LoadAccountCompletedEvent event)
}

invalidateOptionsMenu();

}

@Subscribe
Expand Down Expand Up @@ -1077,7 +1088,6 @@ else if (sessionState == SESSION_ERROR && getCurrentSession() == null)
if (!isSyncActive(AlfrescoAccountManager.getInstance(context)
.getAndroidAccount(getCurrentAccount().getId()), SyncContentProvider.AUTHORITY))
{
Log.e(TAG, "[Sync NETWORK]");
SyncContentManager.getInstance(context).sync(getCurrentAccount());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
import org.alfresco.mobile.android.application.fragments.workflow.CreateTaskTypePickerFragment;
import org.alfresco.mobile.android.application.ui.form.picker.DocumentPickerFragment.onPickDocumentFragment;
import org.alfresco.mobile.android.async.file.encryption.AccountProtectionEvent;
import org.alfresco.mobile.android.platform.extensions.AnalyticsHelper;
import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.platform.intent.PrivateIntent;

import android.content.Intent;
Expand Down Expand Up @@ -140,6 +142,8 @@ && getIntent().getExtras().containsKey(PrivateIntent.EXTRA_DOCUMENTS))
Fragment f = docs.isEmpty() ? new CreateTaskTypePickerFragment()
: CreateTaskTypePickerFragment.newInstance(docs);
FragmentDisplayer.with(this).load(f).back(false).animate(null).into(FragmentDisplayer.PANEL_LEFT);

AnalyticsHelper.reportScreen(this, AnalyticsManager.SCREEN_TASK_CREATE_TYPE);
}

if (PrivateIntent.ACTION_DISPLAY_HELP.equals(action))
Expand Down
Loading

0 comments on commit a75803e

Please sign in to comment.