Skip to content

Commit

Permalink
In his name; Added Xamarin Android
Browse files Browse the repository at this point in the history
  • Loading branch information
moratab committed Sep 15, 2017
0 parents commit 5334d7b
Show file tree
Hide file tree
Showing 1,394 changed files with 202,367 additions and 0 deletions.
Binary file added .vs/Sharif-Support/v15/.suo
Binary file not shown.
40 changes: 40 additions & 0 deletions Sharif-Support.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26228.4
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Support.Android", "Support\Support.Android\Support.Android.csproj", "{8EADCA87-5094-4532-91F6-93AC25667CE5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|iPhone = Debug|iPhone
Debug|iPhoneSimulator = Debug|iPhoneSimulator
Release|Any CPU = Release|Any CPU
Release|iPhone = Release|iPhone
Release|iPhoneSimulator = Release|iPhoneSimulator
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8EADCA87-5094-4532-91F6-93AC25667CE5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8EADCA87-5094-4532-91F6-93AC25667CE5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8EADCA87-5094-4532-91F6-93AC25667CE5}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{8EADCA87-5094-4532-91F6-93AC25667CE5}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{8EADCA87-5094-4532-91F6-93AC25667CE5}.Debug|iPhone.Build.0 = Debug|Any CPU
{8EADCA87-5094-4532-91F6-93AC25667CE5}.Debug|iPhone.Deploy.0 = Debug|Any CPU
{8EADCA87-5094-4532-91F6-93AC25667CE5}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{8EADCA87-5094-4532-91F6-93AC25667CE5}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{8EADCA87-5094-4532-91F6-93AC25667CE5}.Debug|iPhoneSimulator.Deploy.0 = Debug|Any CPU
{8EADCA87-5094-4532-91F6-93AC25667CE5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8EADCA87-5094-4532-91F6-93AC25667CE5}.Release|Any CPU.Build.0 = Release|Any CPU
{8EADCA87-5094-4532-91F6-93AC25667CE5}.Release|Any CPU.Deploy.0 = Release|Any CPU
{8EADCA87-5094-4532-91F6-93AC25667CE5}.Release|iPhone.ActiveCfg = Release|Any CPU
{8EADCA87-5094-4532-91F6-93AC25667CE5}.Release|iPhone.Build.0 = Release|Any CPU
{8EADCA87-5094-4532-91F6-93AC25667CE5}.Release|iPhone.Deploy.0 = Release|Any CPU
{8EADCA87-5094-4532-91F6-93AC25667CE5}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{8EADCA87-5094-4532-91F6-93AC25667CE5}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{8EADCA87-5094-4532-91F6-93AC25667CE5}.Release|iPhoneSimulator.Deploy.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
34 changes: 34 additions & 0 deletions Support/Support.Android/Activities/AddItemActivity.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

using System;
using Android.App;
using Android.OS;
using Android.Support.Design.Widget;
using Android.Widget;
using Plugin.CurrentActivity;

namespace Support.Droid
{

[Activity(Label = "AddItemActivity")]
public class AddItemActivity : Activity
{
FloatingActionButton saveButton;
EditText title, description;


protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);



saveButton.Click += SaveButton_Click;
}

private void SaveButton_Click(object sender, EventArgs e)
{

Finish();
}
}
}
40 changes: 40 additions & 0 deletions Support/Support.Android/Activities/BaseActivity.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using Android.OS;
using Android.Support.V7.App;
using Android.Support.V7.Widget;

namespace Support.Droid
{
public class BaseActivity : AppCompatActivity
{
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
SetContentView(LayoutResource);
Toolbar = FindViewById<Toolbar>(Resource.Id.toolbar);
if (Toolbar != null)
{
SetSupportActionBar(Toolbar);
SupportActionBar.SetDisplayHomeAsUpEnabled(true);
SupportActionBar.SetHomeButtonEnabled(true);

}
}

public Toolbar Toolbar
{
get;
set;
}

protected virtual int LayoutResource
{
get;
}

protected int ActionBarIcon
{
set { Toolbar?.SetNavigationIcon(value); }
}
}
}

59 changes: 59 additions & 0 deletions Support/Support.Android/Activities/MainActivity.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
using Android.App;
using Android.Content;
using Android.Content.PM;
using Android.OS;
using Android.Support.Design.Widget;
using Android.Support.V4.App;
using Android.Support.V4.View;
using Android.Views;
using Android.Widget;

namespace Support.Droid
{
[Activity(Label = "@string/app_name",
LaunchMode = LaunchMode.SingleInstance,
ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation,
ScreenOrientation = ScreenOrientation.Portrait)]
public class MainActivity : BaseActivity
{

protected override int LayoutResource => Resource.Layout.activity_main;

ViewPager pager;

protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);

pager = FindViewById<ViewPager>(Resource.Id.viewpager);
pager.OffscreenPageLimit = 3;

pager.PageSelected += (sender, args) =>
{


};

Toolbar.MenuItemClick += (sender, e) =>
{
var intent = new Intent(this, typeof(AddItemActivity)); ;
StartActivity(intent);
};

SupportActionBar.SetDisplayHomeAsUpEnabled(false);
SupportActionBar.SetHomeButtonEnabled(false);


}

public override bool OnCreateOptionsMenu(IMenu menu)
{
MenuInflater.Inflate(Resource.Menu.top_menus, menu);
return base.OnCreateOptionsMenu(menu);
}

}

}


23 changes: 23 additions & 0 deletions Support/Support.Android/Activities/SplashActivity.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using Android.App;
using Android.Content;
using Android.OS;
using Android.Support.V7.App;

namespace Support.Droid
{
[Activity(Label = "@string/app_name", Theme = "@style/SplashTheme", MainLauncher = true)]
public class SplashActivity : AppCompatActivity
{
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);

var mainActivityIntent = new Intent(this, typeof(MainActivity));
mainActivityIntent.AddFlags(ActivityFlags.ClearTop);
mainActivityIntent.AddFlags(ActivityFlags.SingleTop);

StartActivity(mainActivityIntent);
Finish();
}
}
}
19 changes: 19 additions & 0 deletions Support/Support.Android/Assets/AboutAssets.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Any raw assets you want to be deployed with your application can be placed in
this directory (and child directories) and given a Build Action of "AndroidAsset".

These files will be deployed with your package and will be accessible using Android's
AssetManager, like this:

public class ReadAsset : Activity
{
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);

InputStream input = Assets.Open ("my_asset.txt");
}
}

Additionally, some Android functions will automatically load asset files:

Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
6 changes: 6 additions & 0 deletions Support/Support.Android/Properties/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.companyname.Support" android:installLocation="auto">
<uses-sdk android:minSdkVersion="15" />
<uses-permission android:name="android.permission.INTERNET" />
<application android:theme="@style/MasterDetailTheme" android:allowBackup="true" android:label="@string/app_name"></application>
</manifest>
28 changes: 28 additions & 0 deletions Support/Support.Android/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using Android.App;

// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.

[assembly: AssemblyTitle("Support.Android")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.

[assembly: AssemblyVersion("1.0.0")]

// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.

//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]

44 changes: 44 additions & 0 deletions Support/Support.Android/Resources/AboutResources.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
Images, layout descriptions, binary blobs and string dictionaries can be included
in your application as resource files. Various Android APIs are designed to
operate on the resource IDs instead of dealing with images, strings or binary blobs
directly.

For example, a sample Android app that contains a user interface layout (main.axml),
an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
would keep its resources in the "Resources" directory of the application:

Resources/
drawable/
icon.png

layout/
main.axml

values/
strings.xml

In order to get the build system to recognize Android resources, set the build action to
"AndroidResource". The native Android APIs do not operate directly with filenames, but
instead operate on resource IDs. When you compile an Android application that uses resources,
the build system will package the resources for distribution and generate a class called "R"
(this is an Android convention) that contains the tokens for each one of the resources
included. For example, for the above Resources layout, this is what the R class would expose:

public class R {
public class drawable {
public const int icon = 0x123;
}

public class layout {
public const int main = 0x456;
}

public class strings {
public const int first_string = 0xabc;
public const int second_string = 0xbcd;
}
}

You would then use R.drawable.icon to reference the drawable/icon.png file, or R.layout.main
to reference the layout/main.axml file, or R.strings.first_string to reference the first
string in the dictionary file values/strings.xml.
Loading

0 comments on commit 5334d7b

Please sign in to comment.