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
6d9b7738
Kaydet (Commit)
6d9b7738
authored
Ara 17, 2014
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
android: extract LOAbout from LibreOfficeMainActivity
Change-Id: Ied6a9a64041de94766b307c7ca64eba7edeab64c
üst
d4a953e5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
75 additions
and
47 deletions
+75
-47
LOAbout.java
...rimental/LOAndroid3/src/java/org/libreoffice/LOAbout.java
+74
-0
LibreOfficeMainActivity.java
...id3/src/java/org/libreoffice/LibreOfficeMainActivity.java
+1
-47
No files found.
android/experimental/LOAndroid3/src/java/org/libreoffice/LOAbout.java
0 → 100644
Dosyayı görüntüle @
6d9b7738
package
org
.
libreoffice
;
import
android.app.Activity
;
import
android.app.AlertDialog
;
import
android.content.DialogInterface
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.support.v4.widget.DrawerLayout
;
import
android.util.DisplayMetrics
;
import
android.util.Log
;
import
android.view.LayoutInflater
;
import
android.view.Menu
;
import
android.view.MenuItem
;
import
android.view.View
;
import
android.widget.AdapterView
;
import
android.widget.ListView
;
import
android.widget.RelativeLayout
;
import
android.widget.TextView
;
import
java.util.ArrayList
;
import
java.util.List
;
public
abstract
class
LOAbout
extends
Activity
{
private
static
final
String
DEFAULT_DOC_PATH
=
"/assets/example.odt"
;
protected
void
showAbout
()
{
// Inflate the about message contents
View
messageView
=
getLayoutInflater
().
inflate
(
R
.
layout
.
about
,
null
,
false
);
// When linking text, force to always use default color. This works
// around a pressed color state bug.
TextView
textView
=
(
TextView
)
messageView
.
findViewById
(
R
.
id
.
about_credits
);
int
defaultColor
=
textView
.
getTextColors
().
getDefaultColor
();
textView
.
setTextColor
(
defaultColor
);
AlertDialog
.
Builder
builder
=
new
AlertDialog
.
Builder
(
this
);
builder
.
setIcon
(
R
.
drawable
.
lo_icon
);
builder
.
setTitle
(
R
.
string
.
app_name
);
builder
.
setView
(
messageView
);
builder
.
setNegativeButton
(
R
.
string
.
about_license
,
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
id
)
{
LOKitShell
.
sendEvent
(
LOEventFactory
.
close
());
LOKitShell
.
sendEvent
(
LOEventFactory
.
load
(
"/assets/license.txt"
));
dialog
.
dismiss
();
}
});
builder
.
setPositiveButton
(
R
.
string
.
about_notice
,
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
id
)
{
LOKitShell
.
sendEvent
(
LOEventFactory
.
close
());
LOKitShell
.
sendEvent
(
LOEventFactory
.
load
(
"/assets/notice.txt"
));
dialog
.
dismiss
();
}
});
builder
.
setNeutralButton
(
R
.
string
.
about_moreinfo
,
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
id
)
{
LOKitShell
.
sendEvent
(
LOEventFactory
.
close
());
LOKitShell
.
sendEvent
(
LOEventFactory
.
load
(
DEFAULT_DOC_PATH
));
dialog
.
dismiss
();
}
});
AlertDialog
dialog
=
builder
.
create
();
dialog
.
show
();
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java
Dosyayı görüntüle @
6d9b7738
...
...
@@ -24,7 +24,7 @@ import org.mozilla.gecko.gfx.LayerView;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
LibreOfficeMainActivity
extends
Activity
{
public
class
LibreOfficeMainActivity
extends
LOAbout
{
private
static
final
String
LOGTAG
=
"LibreOfficeMainActivity"
;
private
static
final
String
DEFAULT_DOC_PATH
=
"/assets/example.odt"
;
...
...
@@ -185,52 +185,6 @@ public class LibreOfficeMainActivity extends Activity {
return
mDocumentPartViewListAdapter
;
}
private
void
showAbout
()
{
// Inflate the about message contents
View
messageView
=
getLayoutInflater
().
inflate
(
R
.
layout
.
about
,
null
,
false
);
// When linking text, force to always use default color. This works
// around a pressed color state bug.
TextView
textView
=
(
TextView
)
messageView
.
findViewById
(
R
.
id
.
about_credits
);
int
defaultColor
=
textView
.
getTextColors
().
getDefaultColor
();
textView
.
setTextColor
(
defaultColor
);
AlertDialog
.
Builder
builder
=
new
AlertDialog
.
Builder
(
this
);
builder
.
setIcon
(
R
.
drawable
.
lo_icon
);
builder
.
setTitle
(
R
.
string
.
app_name
);
builder
.
setView
(
messageView
);
builder
.
setNegativeButton
(
R
.
string
.
about_license
,
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
id
)
{
LOKitShell
.
sendEvent
(
LOEventFactory
.
close
());
LOKitShell
.
sendEvent
(
LOEventFactory
.
load
(
"/assets/license.txt"
));
dialog
.
dismiss
();
}
});
builder
.
setPositiveButton
(
R
.
string
.
about_notice
,
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
id
)
{
LOKitShell
.
sendEvent
(
LOEventFactory
.
close
());
LOKitShell
.
sendEvent
(
LOEventFactory
.
load
(
"/assets/notice.txt"
));
dialog
.
dismiss
();
}
});
builder
.
setNeutralButton
(
R
.
string
.
about_moreinfo
,
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
id
)
{
LOKitShell
.
sendEvent
(
LOEventFactory
.
close
());
LOKitShell
.
sendEvent
(
LOEventFactory
.
load
(
DEFAULT_DOC_PATH
));
dialog
.
dismiss
();
}
});
AlertDialog
dialog
=
builder
.
create
();
dialog
.
show
();
}
public
void
showProgressSpinner
()
{
findViewById
(
R
.
id
.
loadingPanel
).
setVisibility
(
View
.
VISIBLE
);
}
...
...
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