3 | # Encoding is UTF-8
4 |
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoog568/VerticalTextView/7a02da58527a000102065074f1ce32be76d3eb52/bin/res/crunch/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoog568/VerticalTextView/7a02da58527a000102065074f1ce32be76d3eb52/bin/res/crunch/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoog568/VerticalTextView/7a02da58527a000102065074f1ce32be76d3eb52/bin/res/crunch/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoog568/VerticalTextView/7a02da58527a000102065074f1ce32be76d3eb52/bin/res/crunch/drawable-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/bin/resources.ap_:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoog568/VerticalTextView/7a02da58527a000102065074f1ce32be76d3eb52/bin/resources.ap_
--------------------------------------------------------------------------------
/gen/com/yoog/widget/BuildConfig.java:
--------------------------------------------------------------------------------
1 | /** Automatically generated file. DO NOT MODIFY */
2 | package com.yoog.widget;
3 |
4 | public final class BuildConfig {
5 | public final static boolean DEBUG = true;
6 | }
--------------------------------------------------------------------------------
/gen/com/yoog/widget/R.java:
--------------------------------------------------------------------------------
1 | /* AUTO-GENERATED FILE. DO NOT MODIFY.
2 | *
3 | * This class was automatically generated by the
4 | * aapt tool from the resource data it found. It
5 | * should not be modified by hand.
6 | */
7 |
8 | package com.yoog.widget;
9 |
10 | public final class R {
11 | public static final class attr {
12 | /** Must be one of the following constant values.
13 |
14 |
15 |
16 |
17 | Constant | Value | Description |
18 | uptodown | 0 | |
19 | downtoup | 1 | |
20 | lefttoright | 2 | |
21 | righttoleft | 3 | |
22 |
23 | */
24 | public static final int direction=0x7f010000;
25 | }
26 | public static final class dimen {
27 | /** Default screen margins, per the Android Design guidelines.
28 |
29 | Customize dimensions originally defined in res/values/dimens.xml (such as
30 | screen margins) for sw720dp devices (e.g. 10" tablets) in landscape here.
31 |
32 | */
33 | public static final int activity_horizontal_margin=0x7f050000;
34 | public static final int activity_vertical_margin=0x7f050001;
35 | }
36 | public static final class drawable {
37 | public static final int ic_launcher=0x7f020000;
38 | }
39 | public static final class id {
40 | public static final int action_settings=0x7f040004;
41 | public static final int downtoup=0x7f040001;
42 | public static final int lefttoright=0x7f040002;
43 | public static final int righttoleft=0x7f040003;
44 | public static final int uptodown=0x7f040000;
45 | }
46 | public static final class layout {
47 | public static final int activity_main=0x7f030000;
48 | }
49 | public static final class menu {
50 | public static final int main=0x7f080000;
51 | }
52 | public static final class string {
53 | public static final int action_settings=0x7f060001;
54 | public static final int app_name=0x7f060000;
55 | public static final int hello_world=0x7f060002;
56 | }
57 | public static final class style {
58 | /**
59 | Base application theme, dependent on API level. This theme is replaced
60 | by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
61 |
62 |
63 | Theme customizations available in newer API levels can go in
64 | res/values-vXX/styles.xml, while customizations related to
65 | backward-compatibility can go here.
66 |
67 |
68 | Base application theme for API 11+. This theme completely replaces
69 | AppBaseTheme from res/values/styles.xml on API 11+ devices.
70 |
71 | API 11 theme customizations can go here.
72 |
73 | Base application theme for API 14+. This theme completely replaces
74 | AppBaseTheme from BOTH res/values/styles.xml and
75 | res/values-v11/styles.xml on API 14+ devices.
76 |
77 | API 14 theme customizations can go here.
78 | */
79 | public static final int AppBaseTheme=0x7f070000;
80 | /** Application theme.
81 | All customizations that are NOT specific to a particular API-level can go here.
82 | */
83 | public static final int AppTheme=0x7f070001;
84 | }
85 | public static final class styleable {
86 | /** Attributes that can be used with a verticaltextview.
87 | Includes the following attributes:
88 |
89 |
90 |
91 | Attribute | Description |
92 | {@link #verticaltextview_direction com.yoog.widget:direction} | |
93 |
94 | @see #verticaltextview_direction
95 | */
96 | public static final int[] verticaltextview = {
97 | 0x7f010000
98 | };
99 | /**
100 | This symbol is the offset where the {@link com.yoog.widget.R.attr#direction}
101 | attribute's value can be found in the {@link #verticaltextview} array.
102 |
103 |
104 |
Must be one of the following constant values.
105 |
106 |
107 |
108 |
109 | Constant | Value | Description |
110 | uptodown | 0 | |
111 | downtoup | 1 | |
112 | lefttoright | 2 | |
113 | righttoleft | 3 | |
114 |
115 | @attr name com.yoog.widget:direction
116 | */
117 | public static final int verticaltextview_direction = 0;
118 | };
119 | }
120 |
--------------------------------------------------------------------------------
/hs_err_pid9628.log:
--------------------------------------------------------------------------------
1 | #
2 | # A fatal error has been detected by the Java Runtime Environment:
3 | #
4 | # Internal Error (javaClasses.cpp:136), pid=9628, tid=5540
5 | # fatal error: Invalid layout of preloaded class
6 | #
7 | # JRE version: (7.0_45-b18) (build )
8 | # Java VM: Java HotSpot(TM) 64-Bit Server VM (24.45-b08 mixed mode windows-amd64 compressed oops)
9 | # Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
10 | #
11 | # If you would like to submit a bug report, please visit:
12 | # http://bugreport.sun.com/bugreport/crash.jsp
13 | #
14 |
15 | --------------- T H R E A D ---------------
16 |
17 | Current thread (0x000000000257d800): JavaThread "Unknown thread" [_thread_in_vm, id=5540, stack(0x00000000028d0000,0x00000000029d0000)]
18 |
19 | Stack: [0x00000000028d0000,0x00000000029d0000]
20 |
21 | --------------- P R O C E S S ---------------
22 |
23 | Java Threads: ( => current thread )
24 |
25 | Other Threads:
26 |
27 | =>0x000000000257d800 (exited) JavaThread "Unknown thread" [_thread_in_vm, id=5540, stack(0x00000000028d0000,0x00000000029d0000)]
28 |
29 | VM state:not at safepoint (not fully initialized)
30 |
31 | VM Mutex/Monitor currently owned by a thread: None
32 |
33 | GC Heap History (0 events):
34 | No events
35 |
36 | Deoptimization events (0 events):
37 | No events
38 |
39 | Internal exceptions (0 events):
40 | No events
41 |
42 | Events (10 events):
43 | Event: 0.160 loading class 0x00000000025fc620 done
44 | Event: 0.160 loading class 0x00000000025fc040 done
45 | Event: 0.160 loading class 0x00000000025fc020
46 | Event: 0.160 loading class 0x0000000002604120
47 | Event: 0.160 loading class 0x0000000002604120 done
48 | Event: 0.160 loading class 0x0000000002604150
49 | Event: 0.160 loading class 0x0000000002604150 done
50 | Event: 0.160 loading class 0x0000000002604180
51 | Event: 0.160 loading class 0x0000000002604180 done
52 | Event: 0.160 loading class 0x00000000025fc020 done
53 |
54 |
55 | Dynamic libraries:
56 | 0x000000013f220000 - 0x000000013f253000 D:\Java\jre7\bin\javaw.exe
57 | 0x0000000077240000 - 0x00000000773eb000 C:\Windows\SYSTEM32\ntdll.dll
58 | 0x0000000077120000 - 0x000000007723f000 C:\Windows\system32\kernel32.dll
59 | 0x000007fefd170000 - 0x000007fefd1db000 C:\Windows\system32\KERNELBASE.dll
60 | 0x000007feff190000 - 0x000007feff26b000 C:\Windows\system32\ADVAPI32.dll
61 | 0x000007fefee20000 - 0x000007fefeebf000 C:\Windows\system32\msvcrt.dll
62 | 0x000007fefeec0000 - 0x000007fefeedf000 C:\Windows\SYSTEM32\sechost.dll
63 | 0x000007fefeee0000 - 0x000007feff00e000 C:\Windows\system32\RPCRT4.dll
64 | 0x0000000076ee0000 - 0x0000000076fda000 C:\Windows\system32\USER32.dll
65 | 0x000007feff010000 - 0x000007feff077000 C:\Windows\system32\GDI32.dll
66 | 0x000007fefe9d0000 - 0x000007fefe9de000 C:\Windows\system32\LPK.dll
67 | 0x000007fefea70000 - 0x000007fefeb3a000 C:\Windows\system32\USP10.dll
68 | 0x000007fefb770000 - 0x000007fefb964000 C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7600.16385_none_fa645303170382f6\COMCTL32.dll
69 | 0x000007fefd700000 - 0x000007fefd771000 C:\Windows\system32\SHLWAPI.dll
70 | 0x000007fefec70000 - 0x000007fefec9e000 C:\Windows\system32\IMM32.DLL
71 | 0x000007fefd470000 - 0x000007fefd579000 C:\Windows\system32\MSCTF.dll
72 | 0x000007fefcf30000 - 0x000007fefcf70000 C:\Windows\system32\nvinitx.dll
73 | 0x000000006ead0000 - 0x000000006eba2000 D:\Java\jre7\bin\msvcr100.dll
74 | 0x000000005d380000 - 0x000000005db49000 D:\Java\jre7\bin\server\jvm.dll
75 | 0x000007fefb6d0000 - 0x000007fefb6d9000 C:\Windows\system32\WSOCK32.dll
76 | 0x000007fefe510000 - 0x000007fefe55d000 C:\Windows\system32\WS2_32.dll
77 | 0x000007fefe9e0000 - 0x000007fefe9e8000 C:\Windows\system32\NSI.dll
78 | 0x000007fefd070000 - 0x000007fefd0ab000 C:\Windows\system32\WINMM.dll
79 | 0x0000000077400000 - 0x0000000077407000 C:\Windows\system32\PSAPI.DLL
80 | 0x00000000743c0000 - 0x00000000743cf000 D:\Java\jre7\bin\verify.dll
81 | 0x0000000074390000 - 0x00000000743b8000 D:\Java\jre7\bin\java.dll
82 | 0x0000000071f30000 - 0x0000000071f45000 D:\Java\jre7\bin\zip.dll
83 |
84 | VM Arguments:
85 | jvm_args: -Dfile.encoding=UTF-8 -Xbootclasspath:D:\GoogleEclipseBit64\sdk\platforms\android-19\android.jar
86 | java_command: com.letv.lepai.common.utils.ZipUtils
87 | Launcher Type: SUN_STANDARD
88 |
89 | Environment Variables:
90 | PATH=C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;D:\TortoiseSVN\bin;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;D:\GoogleEclipseBit64\sdk\platform-tools;D:\GoogleEclipseBit64\sdk\tools;
91 | USERNAME=chenyueguo
92 | OS=Windows_NT
93 | PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 58 Stepping 9, GenuineIntel
94 |
95 |
96 |
97 | --------------- S Y S T E M ---------------
98 |
99 | OS: Windows 7 , 64 bit Build 7600
100 |
101 | CPU:total 4 (2 cores per cpu, 2 threads per core) family 6 model 58 stepping 9, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, erms, ht, tsc, tscinvbit, tscinv
102 |
103 | Memory: 4k page, physical 3786988k(942124k free), swap 7789168k(1870796k free)
104 |
105 | vm_info: Java HotSpot(TM) 64-Bit Server VM (24.45-b08) for windows-amd64 JRE (1.7.0_45-b18), built on Oct 8 2013 05:47:22 by "java_re" with unknown MS VC++:1600
106 |
107 | time: Thu Oct 23 14:16:02 2014
108 | elapsed time: 0 seconds
109 |
110 |
--------------------------------------------------------------------------------
/ic_launcher-web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoog568/VerticalTextView/7a02da58527a000102065074f1ce32be76d3eb52/ic_launcher-web.png
--------------------------------------------------------------------------------
/libs/android-support-v4.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoog568/VerticalTextView/7a02da58527a000102065074f1ce32be76d3eb52/libs/android-support-v4.jar
--------------------------------------------------------------------------------
/proguard-project.txt:
--------------------------------------------------------------------------------
1 | # To enable ProGuard in your project, edit project.properties
2 | # to define the proguard.config property as described in that file.
3 | #
4 | # Add project specific ProGuard rules here.
5 | # By default, the flags in this file are appended to flags specified
6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt
7 | # You can edit the include path and order by changing the ProGuard
8 | # include property in project.properties.
9 | #
10 | # For more details, see
11 | # http://developer.android.com/guide/developing/tools/proguard.html
12 |
13 | # Add any project specific keep options here:
14 |
15 | # If your project uses WebView with JS, uncomment the following
16 | # and specify the fully qualified class name to the JavaScript interface
17 | # class:
18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19 | # public *;
20 | #}
21 |
--------------------------------------------------------------------------------
/project.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system edit
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 | #
10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 |
13 | # Project target.
14 | target=android-19
15 | android.library=false
16 |
--------------------------------------------------------------------------------
/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoog568/VerticalTextView/7a02da58527a000102065074f1ce32be76d3eb52/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoog568/VerticalTextView/7a02da58527a000102065074f1ce32be76d3eb52/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoog568/VerticalTextView/7a02da58527a000102065074f1ce32be76d3eb52/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoog568/VerticalTextView/7a02da58527a000102065074f1ce32be76d3eb52/res/drawable-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
20 |
21 |
32 |
33 |
44 |
45 |
56 |
57 |
--------------------------------------------------------------------------------
/res/menu/main.xml:
--------------------------------------------------------------------------------
1 |
10 |
--------------------------------------------------------------------------------
/res/values-sw600dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/res/values-sw720dp-land/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 | 128dp
8 |
9 |
10 |
--------------------------------------------------------------------------------
/res/values-v11/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/res/values-v14/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/res/values/attr.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 16dp
5 | 16dp
6 |
7 |
8 |
--------------------------------------------------------------------------------
/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | VerticalTextView
5 | Settings
6 | Hello world!
7 |
8 |
9 |
--------------------------------------------------------------------------------
/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
14 |
15 |
16 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/com/yoog/widget/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.yoog.widget;
2 |
3 | import com.yoog.widget.R;
4 |
5 | import android.app.Activity;
6 | import android.os.Bundle;
7 | import android.view.Menu;
8 | import android.widget.LinearLayout.LayoutParams;
9 | import android.widget.RelativeLayout;
10 |
11 | public class MainActivity extends Activity {
12 |
13 | @Override
14 | protected void onCreate(Bundle savedInstanceState) {
15 | super.onCreate(savedInstanceState);
16 | setContentView(R.layout.activity_main);
17 |
18 | VerticalTextView mTextView = new VerticalTextView(this);
19 |
20 | RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(
21 | LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
22 |
23 | }
24 |
25 | @Override
26 | public boolean onCreateOptionsMenu(Menu menu) {
27 | // Inflate the menu; this adds items to the action bar if it is present.
28 | getMenuInflater().inflate(R.menu.main, menu);
29 | return true;
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/src/com/yoog/widget/VerticalTextView.java:
--------------------------------------------------------------------------------
1 | package com.yoog.widget;
2 |
3 | import com.yoog.widget.R;
4 |
5 | import android.content.Context;
6 | import android.content.res.TypedArray;
7 | import android.graphics.Canvas;
8 | import android.graphics.Path;
9 | import android.graphics.Rect;
10 | import android.util.AttributeSet;
11 | import android.widget.TextView;
12 |
13 | public class VerticalTextView extends TextView {
14 |
15 | public final static int ORIENTATION_UP_TO_DOWN = 0;
16 | public final static int ORIENTATION_DOWN_TO_UP = 1;
17 | public final static int ORIENTATION_LEFT_TO_RIGHT = 2;
18 | public final static int ORIENTATION_RIGHT_TO_LEFT = 3;
19 |
20 | Rect text_bounds = new Rect();
21 | private int direction;
22 |
23 | public VerticalTextView(Context context) {
24 | super(context);
25 | }
26 |
27 | public VerticalTextView(Context context, AttributeSet attrs) {
28 | super(context, attrs);
29 |
30 | TypedArray a = context.obtainStyledAttributes(attrs,
31 | R.styleable.verticaltextview);
32 | direction = a.getInt(R.styleable.verticaltextview_direction, 0);
33 | a.recycle();
34 |
35 | requestLayout();
36 | invalidate();
37 |
38 | }
39 |
40 | public void setDirection(int direction) {
41 | this.direction = direction;
42 |
43 | requestLayout();
44 | invalidate();
45 | }
46 |
47 | @Override
48 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
49 | getPaint().getTextBounds(getText().toString(), 0, getText().length(),
50 | text_bounds);
51 | if (direction == ORIENTATION_LEFT_TO_RIGHT
52 | || direction == ORIENTATION_RIGHT_TO_LEFT) {
53 | setMeasuredDimension(measureHeight(widthMeasureSpec),
54 | measureWidth(heightMeasureSpec));
55 | } else if (direction == ORIENTATION_UP_TO_DOWN
56 | || direction == ORIENTATION_DOWN_TO_UP) {
57 | setMeasuredDimension(measureWidth(widthMeasureSpec),
58 | measureHeight(heightMeasureSpec));
59 | }
60 |
61 | }
62 |
63 | private int measureWidth(int measureSpec) {
64 | int result = 0;
65 | int specMode = MeasureSpec.getMode(measureSpec);
66 | int specSize = MeasureSpec.getSize(measureSpec);
67 |
68 | if (specMode == MeasureSpec.EXACTLY) {
69 | result = specSize;
70 | } else {
71 | result = text_bounds.height() + getPaddingTop()
72 | + getPaddingBottom();
73 | // result = text_bounds.height();
74 | if (specMode == MeasureSpec.AT_MOST) {
75 | result = Math.min(result, specSize);
76 | }
77 | }
78 | return result;
79 | }
80 |
81 | private int measureHeight(int measureSpec) {
82 | int result = 0;
83 | int specMode = MeasureSpec.getMode(measureSpec);
84 | int specSize = MeasureSpec.getSize(measureSpec);
85 |
86 | if (specMode == MeasureSpec.EXACTLY) {
87 | result = specSize;
88 | } else {
89 | result = text_bounds.width() + getPaddingLeft() + getPaddingRight();
90 | // result = text_bounds.width();
91 | if (specMode == MeasureSpec.AT_MOST) {
92 | result = Math.min(result, specSize);
93 | }
94 | }
95 | return result;
96 | }
97 |
98 | @Override
99 | protected void onDraw(Canvas canvas) {
100 | // super.onDraw(canvas);
101 |
102 | canvas.save();
103 |
104 | int startX = 0;
105 | int startY = 0;
106 | int stopX = 0;
107 | int stopY = 0;
108 | Path path = new Path();
109 | if (direction == ORIENTATION_UP_TO_DOWN) {
110 | startX = (getWidth() - text_bounds.height() >> 1);
111 | startY = (getHeight() - text_bounds.width() >> 1);
112 | stopX = (getWidth() - text_bounds.height() >> 1);
113 | stopY = (getHeight() + text_bounds.width() >> 1);
114 | path.moveTo(startX, startY);
115 | path.lineTo(stopX, stopY);
116 | } else if (direction == ORIENTATION_DOWN_TO_UP) {
117 | startX = (getWidth() + text_bounds.height() >> 1);
118 | startY = (getHeight() + text_bounds.width() >> 1);
119 | stopX = (getWidth() + text_bounds.height() >> 1);
120 | stopY = (getHeight() - text_bounds.width() >> 1);
121 | path.moveTo(startX, startY);
122 | path.lineTo(stopX, stopY);
123 | } else if (direction == ORIENTATION_LEFT_TO_RIGHT) {
124 | startX = (getWidth() - text_bounds.width() >> 1);
125 | startY = (getHeight() + text_bounds.height() >> 1);
126 | stopX = (getWidth() + text_bounds.width() >> 1);
127 | stopY = (getHeight() + text_bounds.height() >> 1);
128 | path.moveTo(startX, startY);
129 | path.lineTo(stopX, stopY);
130 | } else if (direction == ORIENTATION_RIGHT_TO_LEFT) {
131 | startX = (getWidth() + text_bounds.width() >> 1);
132 | startY = (getHeight() - text_bounds.height() >> 1);
133 | stopX = (getWidth() - text_bounds.width() >> 1);
134 | stopY = (getHeight() - text_bounds.height() >> 1);
135 | path.moveTo(startX, startY);
136 | path.lineTo(stopX, stopY);
137 | }
138 |
139 | this.getPaint().setColor(this.getCurrentTextColor());
140 | // canvas.drawLine(startX, startY, stopX, stopY, this.getPaint());
141 | canvas.drawTextOnPath(getText().toString(), path, 0, 0, this.getPaint());
142 |
143 | canvas.restore();
144 | }
145 | }
146 |
--------------------------------------------------------------------------------