Skip to content

Commit

Permalink
Merge pull request #1485 from microsoft/release/4.1.0
Browse files Browse the repository at this point in the history
Start new 4.1.0 version
  • Loading branch information
LuyaLiu authored Dec 24, 2020
2 parents 2528773 + 9b0ef73 commit 7d3a51a
Show file tree
Hide file tree
Showing 150 changed files with 1,933 additions and 589 deletions.
1 change: 1 addition & 0 deletions Apps/Contoso.Android.Puppet/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ public static class Constants
public const string Info = "Info";
public const string Warning = "Warning";
public const string Error = "Error";
public const string StorageSizeKey = "StorageSizeKey";
}
}
14 changes: 13 additions & 1 deletion Apps/Contoso.Android.Puppet/MainActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System.Linq;
using Android.App;
using Android.Content;
using Android.Content.PM;
using Android.OS;
using Android.Support.Design.Widget;
Expand Down Expand Up @@ -47,14 +48,20 @@ protected override void OnCreate(Bundle savedInstanceState)
Crashes.SendingErrorReport += SendingErrorReportHandler;
Crashes.SentErrorReport += SentErrorReportHandler;
Crashes.FailedToSendErrorReport += FailedToSendErrorReportHandler;

// Set callbacks
Crashes.ShouldProcessErrorReport = ShouldProcess;
Crashes.ShouldAwaitUserConfirmation = ConfirmationHandler;

Distribute.ReleaseAvailable = OnReleaseAvailable;
Distribute.NoReleaseAvailable = OnNoReleaseAvailable;
AppCenterLog.Assert(LogTag, "AppCenter.Configured=" + AppCenter.Configured);
AppCenter.SetLogUrl("https://in-integration.dev.avalanch.es");
var prefs = GetSharedPreferences("AppCenter", FileCreationMode.Private);
var storageSizeValue = prefs.GetLong(Constants.StorageSizeKey, 0);
if (storageSizeValue > 0)
{
AppCenter.SetMaxStorageSizeAsync(storageSizeValue);
}
Distribute.SetInstallUrl("https://install.portal-server-core-integration.dev.avalanch.es");
Distribute.SetApiUrl("https://asgard-int.trafficmanager.net/api/v0.1");
AppCenter.Start("bff0949b-7970-439d-9745-92cdc59b10fe", typeof(Analytics), typeof(Crashes), typeof(Distribute));
Expand Down Expand Up @@ -119,6 +126,11 @@ bool ConfirmationHandler()
return true;
}

void OnNoReleaseAvailable()
{
AppCenterLog.Info(LogTag, "No release available callback invoked.");
}

bool OnReleaseAvailable(ReleaseDetails releaseDetails)
{
AppCenterLog.Info(LogTag, "OnReleaseAvailable id=" + releaseDetails.Id
Expand Down
23 changes: 23 additions & 0 deletions Apps/Contoso.Android.Puppet/ModulePages/AppCenterFragment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ public class AppCenterFragment : PageFragment
private TextView LogWriteLevelLabel;
private Button LogWriteButton;
private EditText UserIdText;
private Button SaveStorageSizeButton;
private EditText StorageSizeText;

public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
Expand All @@ -56,14 +58,24 @@ public override void OnViewCreated(View view, Bundle savedInstanceState)
LogWriteLevelLabel = view.FindViewById(Resource.Id.write_log_level) as TextView;
LogWriteButton = view.FindViewById(Resource.Id.write_log) as Button;
UserIdText = view.FindViewById(Resource.Id.write_user_id) as EditText;
SaveStorageSizeButton = view.FindViewById(Resource.Id.save_storage_size) as Button;
StorageSizeText = view.FindViewById(Resource.Id.write_storage_size) as EditText;

// Subscribe to events.
AppCenterEnabledSwitch.CheckedChange += UpdateEnabled;
((View)LogLevelLabel.Parent).Click += LogLevelClicked;
((View)LogWriteLevelLabel.Parent).Click += LogWriteLevelClicked;
LogWriteButton.Click += WriteLog;
SaveStorageSizeButton.Click += SaveStorageSize;
UserIdText.KeyPress += UserIdTextKeyPressedHandler;

// Set max storage size value.
var prefs = Context.GetSharedPreferences("AppCenter", FileCreationMode.Private);
var storageSizeValue = prefs.GetLong(Constants.StorageSizeKey, 0);
if (storageSizeValue > 0)
{
StorageSizeText.Text = storageSizeValue.ToString();
}
UpdateState();
}

Expand Down Expand Up @@ -130,5 +142,16 @@ private void WriteLog(object sender, EventArgs e)
string tag = LogWriteTagText.Text;
LogFunctions[mLogWriteLevel](tag, message);
}

private void SaveStorageSize(object sender, EventArgs e)
{
var inputText = StorageSizeText.Text;
var size = string.IsNullOrEmpty(inputText) ? 0 : long.Parse(inputText);
AppCenter.SetMaxStorageSizeAsync(size);
var prefs = Context.GetSharedPreferences("AppCenter", FileCreationMode.Private);
var prefEditor = prefs.Edit();
prefEditor.PutLong(Constants.StorageSizeKey, size);
prefEditor.Commit();
}
}
}
2 changes: 1 addition & 1 deletion Apps/Contoso.Android.Puppet/Properties/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.microsoft.appcenter.xamarin.puppet" android:versionCode="91" android:versionName="4.0.0-SNAPSHOT" android:installLocation="auto">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.microsoft.appcenter.xamarin.puppet" android:versionCode="93" android:versionName="4.1.0-SNAPSHOT" android:installLocation="auto">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="30" />
<application android:label="SXPuppet" android:icon="@drawable/Icon" android:theme="@style/PuppetTheme">
</application>
Expand Down
4 changes: 2 additions & 2 deletions Apps/Contoso.Android.Puppet/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.0.0")]
[assembly: AssemblyFileVersion("4.0.0.0")]
[assembly: AssemblyInformationalVersion("4.0.0-SNAPSHOT")]
[assembly: AssemblyFileVersion("4.1.0.0")]
[assembly: AssemblyInformationalVersion("4.1.0-SNAPSHOT")]
253 changes: 141 additions & 112 deletions Apps/Contoso.Android.Puppet/Resources/layout/AppCenter.axml
Original file line number Diff line number Diff line change
@@ -1,114 +1,143 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:focusable="true"
android:focusableInTouchMode="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="8dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:text="@string/AppCenterEnabled"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="8dp" />
<Switch
android:id="@+id/enabled_app_center"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:text="@string/AppCenterLogLevel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="8dp" />
<TextView
android:id="@+id/log_level"
android:text="\?"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?android:attr/listDivider" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:text="@string/AppCenterLogMessage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="8dp" />
<EditText
android:id="@+id/write_log_message"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:text="@string/AppCenterLogTag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="8dp" />
<EditText
android:id="@+id/write_log_tag"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:text="@string/AppCenterLogLevel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="8dp" />
<TextView
android:id="@+id/write_log_level"
android:text="\?"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right" />
</LinearLayout>
<Button
android:id="@+id/write_log"
android:text="@string/AppCenterWriteLog"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:text="@string/AppCenterUserId"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="8dp" />
<EditText
android:id="@+id/write_user_id"
android:maxLines="1"
android:inputType="text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right" />
</LinearLayout>
</LinearLayout>
</ScrollView>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:focusable="true"
android:focusableInTouchMode="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="8dp">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:text="@string/AppCenterEnabled"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="8dp" />
<Switch
android:id="@+id/enabled_app_center"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:text="@string/AppCenterLogLevel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="8dp" />
<TextView
android:id="@+id/log_level"
android:text="\?"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?android:attr/listDivider" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:text="@string/AppCenterLogMessage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="8dp" />
<EditText
android:id="@+id/write_log_message"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:text="@string/AppCenterLogTag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="8dp" />
<EditText
android:id="@+id/write_log_tag"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:text="@string/AppCenterLogLevel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="8dp" />
<TextView
android:id="@+id/write_log_level"
android:text="\?"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right" />
</LinearLayout>
<Button
android:id="@+id/write_log"
android:text="@string/AppCenterWriteLog"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:text="@string/AppCenterUserId"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="8dp" />
<EditText
android:id="@+id/write_user_id"
android:maxLines="1"
android:inputType="text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:text="@string/change_storage_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="8dp" />
<EditText
android:id="@+id/write_storage_size"
android:maxLines="1"
android:inputType="text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right" />
</LinearLayout>
<Button
android:id="@+id/save_storage_size"
android:text="@string/save"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</ScrollView>
</LinearLayout>
2 changes: 2 additions & 0 deletions Apps/Contoso.Android.Puppet/Resources/values/Strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,6 @@
<string name="add_property_dialog_message">Please enter a property values to add to the event</string>
<string name="add_property_dialog_add_button">Add Property</string>
<string name="add_property_dialog_cancel_button">Cancel</string>
<string name="save">Save</string>
<string name="change_storage_size">Change Storage Size</string>
</resources>
Loading

0 comments on commit 7d3a51a

Please sign in to comment.