Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit e612916
Showing
17,882 changed files
with
3,287,696 additions
and
0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[Desktop Entry] | ||
Type=Application | ||
Exec=/usr/local/pandroid/pandroid | ||
Path=/usr/local/pandroid | ||
Icon=/usr/local/pandroid/pandroid.png | ||
GenericName=Pascal Android |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# pandroid | ||
|
||
Create Android application from FPC JVM | ||
|
||
|
||
debian | ||
|
||
/usr/local/pandroid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
androidr15 - Android 4.0.3 (API 15) | ||
androidr16 - Android 4.1.2 (API 16) | ||
androidr17 - Android 4.2.2 (API 17) | ||
androidr18 - Android 4.3.1 (API 18) | ||
androidr19 - Android 4.4.2 (API 19) | ||
androidr20 - Android 4.4W.2 (API 20) | ||
androidr21 - Android 5.0.1 (API 21) | ||
androidr22 - Android 5.1.1 (API 22) | ||
androidr23 - Android 6.0 (API 23) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
openjdk-7-jdk | ||
/usr/lib/jvm/java-7-openjdk-amd64 | ||
|
||
#: apt-get install ant | ||
#: apt-get install android-tools-adb | ||
|
||
directory | ||
sdk | ||
prema sdk.png | ||
|
||
extract to | ||
|
||
/usr/local/pandroid/ | ||
/usr/local/pandroid/keystore | ||
/usr/local/pandroid/library | ||
/usr/local/pandroid/sdk | ||
/usr/local/pandroid/source | ||
/usr/local/pandroid/template | ||
/usr/local/pandroid/units |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<CONFIG> | ||
<ProjectOptions> | ||
<Version Value="9"/> | ||
<General> | ||
<Flags> | ||
<MainUnitHasCreateFormStatements Value="False"/> | ||
<MainUnitHasTitleStatement Value="False"/> | ||
</Flags> | ||
<SessionStorage Value="InProjectDir"/> | ||
<MainUnit Value="0"/> | ||
<Title Value="DemoChart"/> | ||
<UseAppBundle Value="False"/> | ||
<ResourceType Value="res"/> | ||
</General> | ||
<i18n> | ||
<EnableI18N LFM="False"/> | ||
</i18n> | ||
<VersionInfo> | ||
<StringTable ProductVersion=""/> | ||
</VersionInfo> | ||
<BuildModes Count="1"> | ||
<Item1 Name="Default" Default="True"/> | ||
</BuildModes> | ||
<PublishOptions> | ||
<Version Value="2"/> | ||
</PublishOptions> | ||
<RunParams> | ||
<local> | ||
<FormatVersion Value="1"/> | ||
</local> | ||
</RunParams> | ||
<Units Count="1"> | ||
<Unit0> | ||
<Filename Value="DemoChart.lpr"/> | ||
<IsPartOfProject Value="True"/> | ||
</Unit0> | ||
</Units> | ||
</ProjectOptions> | ||
<CompilerOptions> | ||
<Version Value="11"/> | ||
<Target> | ||
<Filename Value="DemoChart"/> | ||
</Target> | ||
<SearchPaths> | ||
<IncludeFiles Value="$(ProjOutDir)"/> | ||
<OtherUnitFiles Value="/usr/local/pandroid/units/typhon/;/usr/local/pandroid/units/"/> | ||
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/> | ||
<SrcPath Value="/usr/lib/codetyphon/fpc/fpc64/units/jvm-android/rtl/;/usr/lib/codetyphon/fpc/fpc64/units/jvm-android/rtl/org/freepascal/rtl/"/> | ||
</SearchPaths> | ||
<CodeGeneration> | ||
<TargetCPU Value="jvm"/> | ||
<TargetOS Value="android"/> | ||
</CodeGeneration> | ||
<Linking> | ||
<Debugging> | ||
<GenerateDebugInfo Value="False"/> | ||
</Debugging> | ||
</Linking> | ||
</CompilerOptions> | ||
<Debugging> | ||
<Exceptions Count="3"> | ||
<Item1> | ||
<Name Value="EAbort"/> | ||
</Item1> | ||
<Item2> | ||
<Name Value="ECodetoolError"/> | ||
</Item2> | ||
<Item3> | ||
<Name Value="EFOpenError"/> | ||
</Item3> | ||
</Exceptions> | ||
</Debugging> | ||
</CONFIG> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,204 @@ | ||
{********************************************************** | ||
Copyright (C) 2012-2016 | ||
Zeljko Cvijanovic www.zeljus.com (cvzeljko@gmail.com) & | ||
Miran Horjak usbdoo@gmail.com | ||
***********************************************************} | ||
{%BuildWorkingDir /usr/local/pandroid/example/DemoChart/android} | ||
{%BuildCommand sh build_debug_apk.sh} | ||
{%BuildScan MAKE-} | ||
unit DemoChart; | ||
|
||
|
||
{$mode objfpc}{$H+} | ||
{$modeswitch unicodestrings} | ||
{$namespace zeljus.com.demochart} | ||
|
||
interface | ||
|
||
uses androidr15, Rjava, AActivity, IniFile, AZCEditFile; | ||
|
||
var | ||
IniFileName : JLString; | ||
ini: ZCTIniFile; | ||
|
||
IDRadnoMjesto: Integer; //= '10'; | ||
IDPDA: Integer; | ||
|
||
type | ||
MainActivity = class(Activity) | ||
public | ||
procedure onCreate(savedInstanceState: AOBundle); override; | ||
procedure onClick(aView: AVView); override; | ||
procedure onClick(dInterface: ACDialogInterface; p1: LongInt); override; | ||
//popup menu | ||
function onCreateOptionsMenu(menu: AVMenu): JBoolean; override; | ||
function onOptionsItemSelected(Item: AVMenuItem): JBoolean; override; | ||
public | ||
intent: ACIntent; | ||
public | ||
procedure SetingsIniFile; | ||
procedure ReadIniFile; | ||
end; | ||
|
||
implementation | ||
|
||
uses AZCForms, chart; | ||
|
||
procedure MainActivity.onCreate(savedInstanceState: AOBundle); | ||
var | ||
layout : AZCForm; | ||
begin | ||
inherited onCreate(savedInstanceState); | ||
layout := AZCForm.create(Self, R.drawable.logo, 'Copyright(c) Zeljko Cvijanovic'); | ||
|
||
//================= Initialize | ||
IniFileName := JLString('/data/data/').concat(Self.getPackageName).concat('/assets/inifiles.ini'); | ||
ini:= ZCTIniFile.create(IniFileName); | ||
SetingsIniFile; | ||
//============================= | ||
|
||
layout.addButton(Self, 1, 'Chart'); | ||
|
||
layout.addButton(Self, 10, 'IZLAZ'); | ||
|
||
setContentView(layout); | ||
end; | ||
|
||
procedure MainActivity.onClick(aView: AVView); | ||
var | ||
incomeSeries, expenseSeries: OAMXYSeries; | ||
i: integer; | ||
|
||
dataset : OAMXYMultipleSeriesDataset; | ||
incomeRenderer: OARXYSeriesRenderer; | ||
expenseRenderer: OARXYSeriesRenderer; | ||
multiRenderer: OARXYMultipleSeriesRenderer; | ||
begin | ||
case aView.getId of | ||
1: begin | ||
incomeSeries := OAMXYSeries.create(JLString('Osa X')); //podatak 1 | ||
expenseSeries := OAMXYSeries.create(JLString('Osa Y')); //podatak 2 | ||
|
||
for i:=0 to 10 do begin | ||
incomeSeries.add(i, i * 2); | ||
expenseSeries.add(i, i / 2); | ||
end; | ||
|
||
// Creating a dataset to hold each series | ||
dataset := OAMXYMultipleSeriesDataset.create; | ||
// Adding Income Series to the dataset | ||
dataset.addSeries(incomeSeries); | ||
// Adding Expense Series to dataset | ||
dataset.addSeries(expenseSeries); | ||
|
||
// Creating XYSeriesRenderer to customize incomeSeries | ||
incomeRenderer:= OARXYSeriesRenderer.create; | ||
incomeRenderer.setColor(AGColor.YELLOW); | ||
incomeRenderer.setPointStyle(OACPointStyle.fCIRCLE); | ||
incomeRenderer.setFillPoints(true); | ||
incomeRenderer.setLineWidth(2); | ||
incomeRenderer.setChartValuesTextSize(20); | ||
incomeRenderer.setDisplayChartValues(true); | ||
|
||
// Creating XYSeriesRenderer to customize expenseSeries | ||
expenseRenderer:= OARXYSeriesRenderer.create; | ||
expenseRenderer.setColor(AGColor.WHITE); | ||
expenseRenderer.setPointStyle(OACPointStyle.fCIRCLE); | ||
expenseRenderer.setFillPoints(true); | ||
expenseRenderer.setLineWidth(2); | ||
expenseRenderer.setChartValuesTextSize(20); | ||
expenseRenderer.setDisplayChartValues(true); | ||
|
||
// Creating a XYMultipleSeriesRenderer to customize the whole chart | ||
multiRenderer:= OARXYMultipleSeriesRenderer.create; | ||
multiRenderer.setXLabels(0); | ||
multiRenderer.setExternalZoomEnabled(true); | ||
multiRenderer.setChartTitle(JLString(' Chart X Y')); | ||
multiRenderer.setXTitle(JLString('Year 2015')); | ||
multiRenderer.setYTitle(JLString('xxx')); | ||
multiRenderer.setZoomButtonsVisible(true); | ||
multiRenderer.setChartValuesTextSize(20); | ||
multiRenderer.setZoomEnabled(true, true); | ||
multiRenderer.setLabelsTextSize(20); | ||
multiRenderer.setXLabelsAngle(0); | ||
multiRenderer.setXLabelsColor(AGColor.YELLOW); | ||
|
||
multiRenderer.addSeriesRenderer(incomeRenderer); | ||
multiRenderer.addSeriesRenderer(expenseRenderer); | ||
|
||
//version | ||
intent:= OAChartFactory.getLineChartIntent(getBaseContext(), dataset, multiRenderer); | ||
|
||
//version | ||
//intent:= OAChartFactory.getBarChartIntent(getBaseContext(), dataset, multiRenderer, OACBarChart.InnerType.fDEFAULT); | ||
//intent:= OAChartFactory.getBarChartIntent(getBaseContext(), dataset, multiRenderer, OACBarChart.InnerType.fSTACKED); | ||
|
||
// Start Activity | ||
startActivity(intent); | ||
|
||
end; | ||
10: Finish; | ||
end; | ||
|
||
end; | ||
|
||
procedure MainActivity.onClick(dInterface: ACDialogInterface; p1: LongInt); | ||
begin | ||
//inherited onClick(dInterface, p1); | ||
ReadIniFile; | ||
end; | ||
|
||
//------------------------------------- | ||
function MainActivity.onCreateOptionsMenu(menu: AVMenu): JBoolean; | ||
var | ||
MenuItem : AVMenuItem; | ||
SubMenu : AVSubMenu; | ||
begin | ||
inherited onCreateOptionsMenu(menu); | ||
|
||
SubMenu := menu.addSubMenu(0, 0, 0, JLString(string('Meni'))); | ||
SubMenu.add(0, 1, 0, JLString('Edit ini file')).setIcon(R.drawable.ic_next); | ||
|
||
MenuItem := SubMenu.getItem; | ||
MenuItem.setIcon(r.drawable.ic_menu); | ||
MenuItem.setShowAsAction(AVMenuItem.SHOW_AS_ACTION_ALWAYS); | ||
|
||
Result := true; | ||
end; | ||
|
||
function MainActivity.onOptionsItemSelected(Item: AVMenuItem): JBoolean; | ||
var | ||
edit: AEditFile; | ||
begin | ||
Result := true; | ||
case item.getItemID of | ||
1: begin | ||
edit := AEditFile.create(Self , IniFileName) ; | ||
edit.show; | ||
end else Result := false; | ||
end; | ||
end; | ||
|
||
procedure MainActivity.SetingsIniFile; | ||
begin | ||
|
||
|
||
|
||
ini.setInt(JLString('PDAsetings'), JLString('IDRadnoMjesto'), | ||
ini.getInt(JLString('PDAsetings'), JLString('IDRadnoMjesto'), 1) ); | ||
ini.setInt(JLString('PDAsetings'), JLString('IDPDA'), | ||
ini.getInt(JLString('PDAsetings'), JLString('IDPDA'), 1 )); | ||
|
||
ReadIniFile; | ||
end; | ||
|
||
procedure MainActivity.ReadIniFile; | ||
begin | ||
|
||
|
||
IDRadnoMjesto := ini.getInt(JLString('PDAsetings'), JLString('IDRadnoMjesto'), 1); | ||
IDPDA := ini.getInt(JLString('PDAsetings'), JLString('IDPDA'), 1); | ||
|
||
end; | ||
|
||
end. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<CONFIG> | ||
<ProjectSession> | ||
<Version Value="9"/> | ||
<BuildModes Active="Default"/> | ||
<Units Count="2"> | ||
<Unit0> | ||
<Filename Value="DemoChart.lpr"/> | ||
<IsPartOfProject Value="True"/> | ||
<IsVisibleTab Value="True"/> | ||
<TopLine Value="111"/> | ||
<CursorPos X="24" Y="132"/> | ||
<UsageCount Value="21"/> | ||
<Loaded Value="True"/> | ||
</Unit0> | ||
<Unit1> | ||
<Filename Value="android/build_debug_apk.sh"/> | ||
<EditorIndex Value="-1"/> | ||
<CursorPos X="50" Y="7"/> | ||
<UsageCount Value="10"/> | ||
<DefaultSyntaxHighlighter Value="Bash"/> | ||
</Unit1> | ||
</Units> | ||
<JumpHistory Count="3" HistoryIndex="2"> | ||
<Position1> | ||
<Filename Value="DemoChart.lpr"/> | ||
<Caret Line="76" Column="45" TopLine="57"/> | ||
</Position1> | ||
<Position2> | ||
<Filename Value="DemoChart.lpr"/> | ||
<Caret Line="84" Column="44" TopLine="53"/> | ||
</Position2> | ||
<Position3> | ||
<Filename Value="DemoChart.lpr"/> | ||
<Caret Line="80" Column="51" TopLine="60"/> | ||
</Position3> | ||
</JumpHistory> | ||
</ProjectSession> | ||
</CONFIG> |
Oops, something went wrong.