-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update doc add classes [English | Persian]
- Loading branch information
Showing
11 changed files
with
312 additions
and
2 deletions.
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 |
---|---|---|
|
@@ -33,4 +33,8 @@ img{ | |
|
||
img.emoji{ | ||
display: inline-block; | ||
} | ||
|
||
td,th{ | ||
border: 1px solid #77777788 !important; | ||
} |
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,7 @@ | ||
# Classes | ||
|
||
Anubias classes help you use other facilities, You can see list of classes: | ||
|
||
- [app](/classes/app.md) | ||
- [toast](/classes/toast.md) | ||
- [storage](/classes/storage.md) |
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,46 @@ | ||
# app | ||
|
||
The `app` class is a general class | ||
to do get general actions or get application's information. | ||
|
||
## mainColor | ||
|
||
Retrun the main color of application: | ||
|
||
```javascript | ||
text1.color = app.mainColor(); | ||
``` | ||
|
||
## colorOrMainColor | ||
|
||
If you want to use safe color, | ||
If the color is null then use main color You can use it: | ||
|
||
```javascript | ||
text1.color = app.colorOrMainColor(text2.color); | ||
``` | ||
|
||
## isDark | ||
|
||
The `isDark` function let you to know app is dark or not: | ||
```javascript | ||
if (app.isDark()){ | ||
// code | ||
} | ||
``` | ||
|
||
## pageBack | ||
Go back page or minimize app: | ||
|
||
```javascript | ||
app.pageBack(); | ||
``` | ||
|
||
## pageLoad | ||
You can load new page with this function | ||
|
||
```javascript | ||
app.pageLoad( Page2() ); | ||
``` | ||
|
||
Page2 is name of your page need to load |
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,38 @@ | ||
# storage | ||
|
||
The `storage` class to store data in secure storage with encryption. | ||
|
||
## read | ||
|
||
Read value as string | ||
- first parameter is `key` as `String` | ||
|
||
```javascript | ||
await storage.read('samplekey'); | ||
``` | ||
|
||
## write | ||
|
||
Write value as string by a key | ||
- first parameter is `key` as `String` | ||
- second parameter is `value` as `String` | ||
|
||
```javascript | ||
await storage.write('samplekey', 'my value here like a token'); | ||
``` | ||
|
||
## delete | ||
|
||
Delete a key | ||
- first parameter is `key` as `String` | ||
|
||
```javascript | ||
await storage.delete('samplekey'); | ||
``` | ||
|
||
## truncate | ||
Erase storage of your application | ||
|
||
```javascript | ||
await storage.truncate(); | ||
``` |
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,57 @@ | ||
|
||
# toast | ||
|
||
Toast class help you to show a toast message | ||
|
||
## Show | ||
|
||
This is main function of toast class, | ||
You can change default params as an object (xScript): | ||
|
||
```javascript | ||
toast.show({ | ||
'text': 'toast sample', | ||
'bgColor': Colors.black38, | ||
'txtColor': Colors.white, | ||
'fontSize': 16.0, | ||
'pos': toast.POS_CENTER, | ||
'length': Toast.LENGTH_SHORT, | ||
}); | ||
``` | ||
All members of the object are optional, You can ignore them. | ||
for example: | ||
|
||
```javascript | ||
toast.show({ | ||
'text': 'My new toast msg :)', | ||
'bgColor': Colors.red, | ||
}); | ||
``` | ||
|
||
## show object information | ||
|
||
| Key | Type | Default | | ||
| ------------ | ------------ | ------------ | | ||
| text | string | 'toast sample' | | ||
| bgColor | color | Colors.black38 | | ||
| txtColor | color | Colors.white | | ||
| fontSize | float | 16.0 | | ||
| pos | const | POS_CENTER | | ||
| length | const | LENGTH_SHORT | | ||
|
||
### pos - Position constants | ||
|
||
- POS_CENTER | ||
- POS_CENTER_LEFT | ||
- POS_CENTER_RIGHT | ||
- POS_TOP | ||
- POS_TOP_LEFT | ||
- POS_TOP_RIGHT | ||
- POS_BOTTOM | ||
- POS_BOTTOM_LEFT | ||
- POS_BOTTOM_RIGHT | ||
|
||
### length = toast duration | ||
|
||
- LENGTH_SHORT | ||
- LENGTH_LONG |
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 @@ | ||
# کلاس ها | ||
|
||
کلاس های آنوبیاس به شما کمک میکند از سایر امکانات نیز استفاده نمایید | ||
و برنامه خود را جذابتر کنید | ||
|
||
- [app](/fa/classes/app.md) | ||
- [toast](/fa/classes/toast.md) | ||
- [storage](/fa/classes/storage.md) |
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,48 @@ | ||
# app | ||
|
||
کلاس `app` یک کلاس عمومی است که | ||
به شما اجازه میدهد که کارهای عمومی در برنامه انجام دهید | ||
و اطلاعات از برنامه بدست بیاورید | ||
|
||
## mainColor | ||
|
||
برای دریافت رنگ اصلی برنامه : | ||
|
||
```javascript | ||
text1.color = app.mainColor(); | ||
``` | ||
|
||
## colorOrMainColor | ||
|
||
اگر به یک رنگ ایمن نیاز داشتید | ||
میتوانید رنگ ورودی را به این تابع بدهید و در صورت خالی بودن رنگ، | ||
آنگاه رنگ اصلی برنامه برای شما باز میگردد: | ||
|
||
```javascript | ||
text1.color = app.colorOrMainColor(text2.color); | ||
``` | ||
|
||
## isDark | ||
|
||
تابع `isDark` امکانش تخصیص این که برنامه به صورت تیره است یا خیر را به شما میدهد: | ||
```javascript | ||
if (app.isDark()){ | ||
// code | ||
} | ||
``` | ||
|
||
## pageBack | ||
برای بازگشت به صفحه قبلی و یا کوچک کردن برنامه: | ||
|
||
```javascript | ||
app.pageBack(); | ||
``` | ||
|
||
## pageLoad | ||
برای نمایش یک صفحه دیگر این تابع کارایی دارید | ||
|
||
```javascript | ||
app.pageLoad( Page2() ); | ||
``` | ||
|
||
Page2 در اینجا نام صفحه جدید جهت بارگزاری است |
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,38 @@ | ||
# storage | ||
|
||
کلاس `storage` برای ذخیره و بازیابی دادههای شما در یک بستر امن و رمزنگاری شده است . | ||
|
||
## read | ||
|
||
خواندن مقدار با نوع رشته string | ||
- پارامتر اول `key` نوع `String` | ||
|
||
```javascript | ||
await storage.read('samplekey'); | ||
``` | ||
|
||
## write | ||
|
||
نوشتن یک مقدار | ||
- پارامتر اول `key` نوع `String` | ||
- پارامتر دوم `value` نوع `String` | ||
|
||
```javascript | ||
await storage.write('samplekey', 'my value here like a token'); | ||
``` | ||
|
||
## delete | ||
|
||
حذف یک مقدار | ||
- پارامتر اول `key` نوع `String` | ||
|
||
```javascript | ||
await storage.delete('samplekey'); | ||
``` | ||
|
||
## truncate | ||
پاک کردن کل مقادیر ذخیره شده | ||
|
||
```javascript | ||
await storage.truncate(); | ||
``` |
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,56 @@ | ||
# toast | ||
|
||
این کلاس امکان نمایش پیام از نوع toast را میدهد | ||
|
||
## Show | ||
|
||
این تابع اصلی جهت نمایش است | ||
شما میتوانید تکتک مقادیر دلخواه را جایگزین کنید (xScript): | ||
|
||
```javascript | ||
toast.show({ | ||
'text': 'toast sample', | ||
'bgColor': Colors.black38, | ||
'txtColor': Colors.white, | ||
'fontSize': 16.0, | ||
'pos': toast.POS_CENTER, | ||
'length': Toast.LENGTH_SHORT, | ||
}); | ||
``` | ||
همه اعضای object بالا دلخواه میباشد شما هر یک از آنها رو میتوانید نادیده بگیرید | ||
مثال: | ||
|
||
```javascript | ||
toast.show({ | ||
'text': 'My new toast msg :)', | ||
'bgColor': Colors.red, | ||
}); | ||
``` | ||
|
||
## اطلاعات object show | ||
|
||
| کلید | نوع | مقدار | | ||
| ------------ | ------------ | ------------ | | ||
| text | string | 'toast sample' | | ||
| bgColor | color | Colors.black38 | | ||
| txtColor | color | Colors.white | | ||
| fontSize | float | 16.0 | | ||
| pos | ثابت | POS_CENTER | | ||
| length | ثابت | LENGTH_SHORT | | ||
|
||
### pos - ثوابت جهت جایگاه پیام | ||
|
||
- POS_CENTER | ||
- POS_CENTER_LEFT | ||
- POS_CENTER_RIGHT | ||
- POS_TOP | ||
- POS_TOP_LEFT | ||
- POS_TOP_RIGHT | ||
- POS_BOTTOM | ||
- POS_BOTTOM_LEFT | ||
- POS_BOTTOM_RIGHT | ||
|
||
### length - ثوابت جهت طول نمایش پیام | ||
|
||
- LENGTH_SHORT | ||
- LENGTH_LONG |
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
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