Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
43103840
Kaydet (Commit)
43103840
authored
Haz 15, 2012
tarafından
Iain Billett
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added a list view to the Android UI.
üst
629001d4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
219 additions
and
2 deletions
+219
-2
file_list.xml
...-eclipse-workspace/LibreOfficeUI/res/layout/file_list.xml
+14
-0
file_list_item.xml
...pse-workspace/LibreOfficeUI/res/layout/file_list_item.xml
+43
-0
view_menu.xml
...12-eclipse-workspace/LibreOfficeUI/res/menu/view_menu.xml
+4
-2
strings.xml
...12-eclipse-workspace/LibreOfficeUI/res/values/strings.xml
+2
-0
LibreOfficeUIActivity.java
...fficeUI/src/org/libreoffice/ui/LibreOfficeUIActivity.java
+0
-0
ListItemAdapter.java
...LibreOfficeUI/src/org/libreoffice/ui/ListItemAdapter.java
+156
-0
No files found.
android/experimental/GSoC-2012-eclipse-workspace/LibreOfficeUI/res/layout/file_list.xml
0 → 100644
Dosyayı görüntüle @
43103840
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<ListView
android:id=
"@+id/file_explorer_list_view"
android:layout_width=
"fill_parent"
android:layout_height=
"fill_parent"
></ListView>
</LinearLayout>
\ No newline at end of file
android/experimental/GSoC-2012-eclipse-workspace/LibreOfficeUI/res/layout/file_list_item.xml
0 → 100644
Dosyayı görüntüle @
43103840
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"48dp"
android:orientation=
"horizontal"
>
<ImageView
android:id=
"@+id/file_list_item_icon"
android:layout_height=
"match_parent"
android:layout_width=
"32dp"
android:layout_margin=
"8dp"
android:layout_gravity=
"center"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"48dp"
android:orientation=
"horizontal"
android:layout_weight=
"3"
>
<TextView
android:id=
"@+id/file_list_item_name"
android:layout_height=
"48dp"
android:layout_width=
"match_parent"
android:textSize=
"16dp"
android:textStyle=
"bold"
android:layout_weight=
"1"
android:gravity=
"center"
/>
<TextView
android:id=
"@+id/file_list_item_size"
android:layout_height=
"48dp"
android:layout_width=
"match_parent"
android:textSize=
"16dp"
android:textStyle=
"bold"
android:layout_weight=
"1"
android:gravity=
"center"
/>
<TextView
android:id=
"@+id/file_list_item_date"
android:layout_height=
"48dp"
android:layout_width=
"match_parent"
android:textSize=
"16dp"
android:textStyle=
"bold"
android:layout_weight=
"1"
android:gravity=
"center"
/>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
android/experimental/GSoC-2012-eclipse-workspace/LibreOfficeUI/res/menu/view_menu.xml
Dosyayı görüntüle @
43103840
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
<menu
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<menu
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<item
android:id=
"@+id/menu_search"
<item
android:id=
"@+id/menu_search"
android:icon=
"@drawable/action_search"
android:icon=
"@drawable/action_search"
android:title=
"@string/menu_search"
android:showAsAction=
"always"
/>
android:showAsAction=
"ifRoom|withText"
/>
<item
android:id=
"@+id/menu_view_toggle"
android:title=
"@string/grid_view"
/>
</menu>
</menu>
\ No newline at end of file
android/experimental/GSoC-2012-eclipse-workspace/LibreOfficeUI/res/values/strings.xml
Dosyayı görüntüle @
43103840
...
@@ -4,6 +4,8 @@
...
@@ -4,6 +4,8 @@
<string
name=
"hello"
>
Hello World, LibreOfficeUIActivity!
</string>
<string
name=
"hello"
>
Hello World, LibreOfficeUIActivity!
</string>
<string
name=
"app_name"
>
LibreOfficeUI
</string>
<string
name=
"app_name"
>
LibreOfficeUI
</string>
<string
name=
"menu_search"
>
Search
</string>
<string
name=
"menu_search"
>
Search
</string>
<string
name=
"list_view"
>
List
</string>
<string
name=
"grid_view"
>
Grid
</string>
<string-array
name=
"file_view_modes"
>
<string-array
name=
"file_view_modes"
>
<item
>
EVERYTHING
</item>
<item
>
EVERYTHING
</item>
<item
>
DOCUMENTS
</item>
<item
>
DOCUMENTS
</item>
...
...
android/experimental/GSoC-2012-eclipse-workspace/LibreOfficeUI/src/org/libreoffice/ui/LibreOfficeUIActivity.java
Dosyayı görüntüle @
43103840
This diff is collapsed.
Click to expand it.
android/experimental/GSoC-2012-eclipse-workspace/LibreOfficeUI/src/org/libreoffice/ui/ListItemAdapter.java
0 → 100644
Dosyayı görüntüle @
43103840
package
org
.
libreoffice
.
ui
;
import
java.io.File
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
android.content.Context
;
import
android.database.DataSetObserver
;
import
android.util.Log
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.view.View.OnClickListener
;
import
android.widget.ImageView
;
import
android.widget.ListAdapter
;
import
android.widget.TextView
;
/*Currently this is class is not used but instead an inner class in LibreOfficeUI is impemented */
public
class
ListItemAdapter
implements
ListAdapter
{
private
Context
mContext
;
private
File
[]
filePaths
;
private
final
long
KB
=
1024
;
private
final
long
MB
=
1048576
;
public
ListItemAdapter
(
Context
mContext
,
File
[]
filePaths
)
{
this
.
mContext
=
mContext
;
this
.
filePaths
=
filePaths
;
}
public
int
getCount
()
{
// TODO Auto-generated method stub
return
filePaths
.
length
;
}
public
Object
getItem
(
int
arg0
)
{
// TODO Auto-generated method stub
return
null
;
}
public
long
getItemId
(
int
arg0
)
{
// TODO Auto-generated method stub
return
0
;
}
public
int
getItemViewType
(
int
arg0
)
{
// TODO Auto-generated method stub
return
0
;
}
public
View
getView
(
int
position
,
View
convertView
,
ViewGroup
parent
)
{
LayoutInflater
inflater
=
(
LayoutInflater
)
mContext
.
getSystemService
(
Context
.
LAYOUT_INFLATER_SERVICE
);
View
listItem
;
if
(
convertView
==
null
)
{
listItem
=
new
View
(
mContext
);
listItem
=
inflater
.
inflate
(
R
.
layout
.
file_list_item
,
null
);
}
else
{
listItem
=
(
View
)
convertView
;
}
listItem
.
setClickable
(
true
);
listItem
.
setOnClickListener
(
new
OnClickListener
()
{
public
void
onClick
(
View
v
)
{
Log
.
d
(
"LIST"
,
"click!"
);
}
});
// set value into textview
TextView
filename
=
(
TextView
)
listItem
.
findViewById
(
R
.
id
.
file_list_item_name
);
filename
.
setText
(
filePaths
[
position
].
getName
()
);
//filename.setClickable(true);
TextView
fileSize
=
(
TextView
)
listItem
.
findViewById
(
R
.
id
.
file_list_item_size
);
//TODO Give size in KB , MB as appropriate.
String
size
=
"0B"
;
long
length
=
filePaths
[
position
].
length
();
if
(
length
<
KB
){
size
=
Long
.
toString
(
length
)
+
"B"
;
}
if
(
length
>=
KB
&&
length
<
MB
){
size
=
Long
.
toString
(
length
/
KB
)
+
"KB"
;
}
if
(
length
>=
MB
){
size
=
Long
.
toString
(
length
/
MB
)
+
"MB"
;
}
fileSize
.
setText
(
size
);
//fileSize.setClickable(true);
TextView
fileDate
=
(
TextView
)
listItem
.
findViewById
(
R
.
id
.
file_list_item_date
);
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"dd MMM yyyy hh:ss"
);
Date
date
=
new
Date
(
filePaths
[
position
].
lastModified
()
);
//TODO format date
fileDate
.
setText
(
df
.
format
(
date
)
);
// set image based on selected text
ImageView
imageView
=
(
ImageView
)
listItem
.
findViewById
(
R
.
id
.
file_list_item_icon
);
if
(
filePaths
[
position
].
getName
().
endsWith
(
".odt"
)
){
imageView
.
setImageResource
(
R
.
drawable
.
writer
);
}
if
(
filePaths
[
position
].
getName
().
endsWith
(
".ods"
)
){
imageView
.
setImageResource
(
R
.
drawable
.
calc
);
}
if
(
filePaths
[
position
].
getName
().
endsWith
(
".odp"
)
){
imageView
.
setImageResource
(
R
.
drawable
.
impress
);
}
if
(
filePaths
[
position
].
isDirectory
()
){
//Eventually have thumbnails of each sub file on a black circle
//For now just a folder icon
imageView
.
setImageResource
(
R
.
drawable
.
folder
);
}
//imageView.setClickable(true);
return
listItem
;
}
public
int
getViewTypeCount
()
{
// TODO Auto-generated method stub
return
1
;
}
public
boolean
hasStableIds
()
{
// TODO Auto-generated method stub
return
false
;
}
public
boolean
isEmpty
()
{
// TODO Auto-generated method stub
return
false
;
}
public
void
registerDataSetObserver
(
DataSetObserver
arg0
)
{
// TODO Auto-generated method stub
}
public
void
unregisterDataSetObserver
(
DataSetObserver
arg0
)
{
// TODO Auto-generated method stub
}
public
boolean
areAllItemsEnabled
()
{
// TODO Auto-generated method stub
return
false
;
}
public
boolean
isEnabled
(
int
position
)
{
// TODO Auto-generated method stub
return
false
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment